Changeset View
Changeset View
Standalone View
Standalone View
src/qt/optionsmodel.cpp
Show First 20 Lines • Show All 264 Lines • ▼ Show 20 Lines | static const ProxySetting default_val = { | ||||
false, DEFAULT_GUI_PROXY_HOST, | false, DEFAULT_GUI_PROXY_HOST, | ||||
QString("%1").arg(DEFAULT_GUI_PROXY_PORT)}; | QString("%1").arg(DEFAULT_GUI_PROXY_PORT)}; | ||||
// Handle the case that the setting is not set at all | // Handle the case that the setting is not set at all | ||||
if (!settings.contains(name)) { | if (!settings.contains(name)) { | ||||
return default_val; | return default_val; | ||||
} | } | ||||
// contains IP at index 0 and port at index 1 | // contains IP at index 0 and port at index 1 | ||||
QStringList ip_port = | QStringList ip_port = | ||||
settings.value(name).toString().split(":", QString::SkipEmptyParts); | GUIUtil::splitSkipEmptyParts(settings.value(name).toString(), ":"); | ||||
if (ip_port.size() == 2) { | if (ip_port.size() == 2) { | ||||
return {true, ip_port.at(0), ip_port.at(1)}; | return {true, ip_port.at(0), ip_port.at(1)}; | ||||
} else { // Invalid: return default | } else { // Invalid: return default | ||||
return default_val; | return default_val; | ||||
} | } | ||||
} | } | ||||
static void SetProxySetting(QSettings &settings, const QString &name, | static void SetProxySetting(QSettings &settings, const QString &name, | ||||
▲ Show 20 Lines • Show All 296 Lines • Show Last 20 Lines |