Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14864647
D3885.id10813.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D3885.id10813.diff
View Options
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -24,6 +24,8 @@
const char *DEFAULT_GUI_PROXY_HOST = "127.0.0.1";
+static const QString GetDefaultProxyAddress();
+
OptionsModel::OptionsModel(interfaces::Node &node, QObject *parent,
bool resetSettings)
: QAbstractListModel(parent), m_node(node) {
@@ -149,9 +151,7 @@
settings.setValue("fUseProxy", false);
}
if (!settings.contains("addrProxy")) {
- settings.setValue("addrProxy",
- QString("%1:%2").arg(DEFAULT_GUI_PROXY_HOST,
- DEFAULT_GUI_PROXY_PORT));
+ settings.setValue("addrProxy", GetDefaultProxyAddress());
}
// Only try to set -proxy, if user has enabled fUseProxy
if (settings.value("fUseProxy").toBool() &&
@@ -167,9 +167,7 @@
settings.setValue("fUseSeparateProxyTor", false);
}
if (!settings.contains("addrSeparateProxyTor")) {
- settings.setValue("addrSeparateProxyTor",
- QString("%1:%2").arg(DEFAULT_GUI_PROXY_HOST,
- DEFAULT_GUI_PROXY_PORT));
+ settings.setValue("addrSeparateProxyTor", GetDefaultProxyAddress());
}
// Only try to set -onion, if user has enabled fUseSeparateProxyTor
if (settings.value("fUseSeparateProxyTor").toBool() &&
@@ -249,6 +247,12 @@
settings.setValue(name, ip_port.ip + ":" + ip_port.port);
}
+static const QString GetDefaultProxyAddress() {
+ return QString("%1:%2")
+ .arg(DEFAULT_GUI_PROXY_HOST)
+ .arg(DEFAULT_GUI_PROXY_PORT);
+}
+
// read QSettings values and return them
QVariant OptionsModel::data(const QModelIndex &index, int role) const {
if (role == Qt::EditRole) {
@@ -502,4 +506,18 @@
settings.setValue(strSettingsVersionKey, CLIENT_VERSION);
}
+
+ // Overwrite the 'addrProxy' setting in case it has been set to an illegal
+ // default value (see issue #12623; PR #12650).
+ if (settings.contains("addrProxy") &&
+ settings.value("addrProxy").toString().endsWith("%2")) {
+ settings.setValue("addrProxy", GetDefaultProxyAddress());
+ }
+
+ // Overwrite the 'addrSeparateProxyTor' setting in case it has been set to
+ // an illegal default value (see issue #12623; PR #12650).
+ if (settings.contains("addrSeparateProxyTor") &&
+ settings.value("addrSeparateProxyTor").toString().endsWith("%2")) {
+ settings.setValue("addrSeparateProxyTor", GetDefaultProxyAddress());
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 20, 21:27 (10 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5865952
Default Alt Text
D3885.id10813.diff (2 KB)
Attached To
D3885: Merge #12650: gui: Fix issue: "default port not shown correctly in settings dialog"
Event Timeline
Log In to Comment