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:
parent
4dfe3ec226
commit
f0e26e0f48
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user