New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gui: Fix issue: "default port not shown correctly in settings dialog" #12650
gui: Fix issue: "default port not shown correctly in settings dialog" #12650
Conversation
Concept ACK, soryr for making such a stupid mistake.
If we add that workaround, let's at least add a comment that explains that workaround, so that future maintainers know why it's there and when it can be removed. |
396b44f
to
9ff17ee
Compare
Thanks @laanwj! I have added a comment to both conditional statements to clarify the purpose of the second boolean condition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
src/qt/optionsmodel.cpp
Outdated
if (!settings.contains("addrProxy")) | ||
settings.setValue("addrProxy", QString("%1:%2").arg(DEFAULT_GUI_PROXY_HOST, DEFAULT_GUI_PROXY_PORT)); | ||
// The second condition in the boolean expression is a workaround to overwrite the 'addrProxy' setting | ||
// in case it has been set to an illegal default value by release 0.16.0 (see issue #12623; PR #12650). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to OptionsModel::checkAndMigrate()
?
9ff17ee
to
6bb2adb
Compare
He @Sjors, thanks! I took a stab at addressing your suggestion in 6bb2adb and rebased this feature branch onto master. I committed on top of 87bd26b in case you prefer that version and want me to revert the changes. |
6bb2adb
to
0592609
Compare
src/qt/optionsmodel.cpp
Outdated
@@ -485,4 +493,16 @@ void OptionsModel::checkAndMigrate() | |||
|
|||
settings.setValue(strSettingsVersionKey, CLIENT_VERSION); | |||
} | |||
|
|||
// Overwrite the 'addrProxy' setting in case it has been set to an illegal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace in this line
f120e8a
to
40141b7
Compare
Thanks @MarcoFalke! 1cd545e is rebased onto the master (048ac83) and addresses the trailing whitespace character. |
1cd545e
to
2f3ce02
Compare
squashed previous work in 2f3ce02, which is based on @Sjors' suggestion:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 2f3ce02
Nit: maybe change "Addresses" to "Fix" in your commit message, if only so it fits in 72 characters.
utACK 2f3ce024eb36f93f82f4fc644d57c45639b9f3de Nods for new migration/auto-fix code without EOL strategy. |
2f3ce02
to
40c5886
Compare
Thanks @jonasschnelli, @Sjors! @Sjors: I have addressed your feedback and changed the commit message in 40c5886 to make it fit in 72 characters. |
reACK 40c5886 |
…ttings dialog" 40c5886 Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251) Pull request description: In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method: https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L129 https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L139 This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`. This PR attempts to resolve #12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug. The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value. Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d
Tagged for backport in case there is a 16.1 release |
GitHub-Pull: bitcoin#12650 Rebased-From: 40c5886
8fca086 List support for BIP173 in bips.md (Pieter Wuille) 9645aa6 Remove blockmaxsize option from init.cpp (fanquake) 7847b92 Default to defining endian-conversion DECLs in compat w/o config (Matt Corallo) 1720eb3 qt:Show the entire Window when double clicking on taskbar (Chun Kuan Lee) e055bc0 depends: Fix Qt build with XCode 9.3 (fanquake) 0684cf9 Avoid launching as admin when NSIS installer ends. (JeremyRand) e802c22 [config] Remove blockmaxsize option (John Newbery) f118a7a Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251) f60e84d Limit the number of IPs we use from each DNS seeder (e0) Pull request description: Backports: - #12626 Limit the number of IPs addrman learns from each DNS seeder - #12650 gui: Fix issue: "default port not shown correctly in settings dialog" - #12756 [config] Remove blockmaxsize option - #12985 Windows: Avoid launching as admin when NSIS installer ends. - #12946 depends: Fix Qt build with XCode 9.3 - #12998 Default to defining endian-conversion DECLs in compat w/o config - #12999 qt: Show the Window when double clicking the taskbar icon - #13064 List support for BIP173 in bips.md to the 0.16 branch. Tree-SHA512: 3e6b47c54b2cd2bdd81fbc6176cb31e46423f6e05988984d3a09b3535e3cee101ffb071cf753a4beff3c9f0521eb5de4b7c0424a3e97da801d56b4015847ac0f
Backported in #12967 |
GitHub-Pull: bitcoin#12650 Rebased-From: 40c5886
…ttings dialog" Summary: 40c5886 Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251) Pull request description: In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method: https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L129 https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L139 This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`. This PR attempts to resolve #12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug. The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value. Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d Backport of Core PR12650 bitcoin/bitcoin#12650 Test Plan: make check bitcoin-qt -> settings -> options -> network -> verify proxy port is 9050 Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3885
…ttings dialog" Summary: 40c5886 Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251) Pull request description: In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method: https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L129 https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L139 This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`. This PR attempts to resolve #12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug. The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value. Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d Backport of Core PR12650 bitcoin/bitcoin#12650 Test Plan: make check bitcoin-qt -> settings -> options -> network -> verify proxy port is 9050 Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3885
…ttings dialog" Summary: 40c5886 Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251) Pull request description: In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method: https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L129 https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L139 This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`. This PR attempts to resolve #12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug. The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value. Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d Backport of Core PR12650 bitcoin/bitcoin#12650 Test Plan: make check bitcoin-qt -> settings -> options -> network -> verify proxy port is 9050 Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3885
…ttings dialog" Summary: 40c5886 Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251) Pull request description: In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method: https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L129 https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L139 This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`. This PR attempts to resolve #12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug. The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value. Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d Backport of Core PR12650 bitcoin/bitcoin#12650 Test Plan: make check bitcoin-qt -> settings -> options -> network -> verify proxy port is 9050 Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3885
…y in settings dialog" 40c5886 Fix illegal default `addProxy` and `addrSeparateProxyTor` settings. (251) Pull request description: In f05d349 the value of the `addrProxy` and `addrSeparateProxyTor` settings is set to an illegal default value, because the value of `DEFAULT_GUI_PROXY_PORT ` is passed to the `fieldWidth` parameter of the `QString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const` method: https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L129 https://github.com/bitcoin/bitcoin/blob/29fad97c320c892ab6a480c81e2078ec22ab354b/src/qt/optionsmodel.cpp#L139 This will create a default proxy setting that consists of 9053 characters and ends with the string `127.0.0.1:%2`. This PR attempts to resolve bitcoin#12623 by setting the correct value for the `addrProxy` and `addrSeparateProxyTor` settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug. The second condition is *only* relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value. Tree-SHA512: 3dc3de2eb7da831f6e318797df67341ced2076b48f9b561c73677bf6beb67b259d8e413095f290356fb92e32e4e8162d48accbc575c4e612060fd5d6dde7ac8d
In f05d349 the value of the
addrProxy
andaddrSeparateProxyTor
settings is set to an illegal default value, because the value ofDEFAULT_GUI_PROXY_PORT
is passed to thefieldWidth
parameter of theQString QString::arg(const QString &a, int fieldWidth = 0, QChar fillChar = QLatin1Char( ' ' )) const
method:bitcoin/src/qt/optionsmodel.cpp
Line 129 in 29fad97
bitcoin/src/qt/optionsmodel.cpp
Line 139 in 29fad97
This will create a default proxy setting that consists of 9053 characters and ends with the string
127.0.0.1:%2
.This PR attempts to resolve #12623 by setting the correct value for the
addrProxy
andaddrSeparateProxyTor
settings (i) if the proxy setting does not exist; or (ii) if the proxy setting has an illegal value caused by to the aforementioned bug.The second condition is only relevant if we don't want Bitcoin Core 0.16.0 users to explicitly reset their settings to see the correct default proxy port value.