1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor(proxy): Changed port type on unsigned int.

This commit is contained in:
Diadlo 2016-07-24 14:47:19 +03:00
parent 4dfe3ec226
commit f0e26e0f48
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
2 changed files with 5 additions and 4 deletions

View File

@ -394,7 +394,8 @@ void Settings::loadPersonal(Profile* profile)
ps.beginGroup("Proxy");
{
setProxyType(ps.value("proxyType", static_cast<int>(ProxyType::ptNone)).toInt());
int type = ps.value("proxyType", static_cast<int>(ProxyType::ptNone)).toInt();
setProxyType(static_cast<ProxyType>(type));
proxyAddr = ps.value("proxyAddr", "").toString();
proxyPort = static_cast<quint16>(ps.value("proxyPort", 0).toUInt());
}

View File

@ -49,8 +49,8 @@ AdvancedForm::AdvancedForm()
bodyUI->cbMakeToxPortable->setChecked(Settings::getInstance().getMakeToxPortable());
bodyUI->cbEnableUDP->setChecked(!s.getForceTCP());
bodyUI->proxyAddr->setText(s.getProxyAddr());
int port = s.getProxyPort();
if (port != -1)
quint16 port = s.getProxyPort();
if (port > 0)
bodyUI->proxyPort->setValue(port);
bodyUI->proxyType->setCurrentIndex(static_cast<int>(s.getProxyType()));
@ -116,7 +116,7 @@ void AdvancedForm::onProxyAddrEdited()
void AdvancedForm::onProxyPortEdited(int port)
{
if (port <= 0)
port = -1;
port = 0;
Settings::getInstance().setProxyPort(port);
}