-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Bugfix: Use unique autostart filenames on Linux for testnet/regtest #7045
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
Conversation
|
utACK |
|
utACK |
| @@ -354,7 +354,10 @@ boost::filesystem::path static GetAutostartDir() | |||
|
|
|||
| boost::filesystem::path static GetAutostartFilePath() | |||
| { | |||
| return GetAutostartDir() / "bitcoin.desktop"; | |||
| std::string chain = ChainNameFromCommandLine(); | |||
| if (chain == CBaseChainParams::MAIN) | |||
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.
I don't think we need this special case.
What's wrong with bitcoin-main.lnk?
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.
It's not the same filename being used presently. Thus, users with 0.11 autostarting would see the checkbox uncheck itself, and checking it would result in trying to autostart twice...
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.
Hm, true. Yeah.
|
Concept ACK |
| std::string chain = ChainNameFromCommandLine(); | ||
| if (chain == CBaseChainParams::MAIN) | ||
| return GetAutostartDir() / "bitcoin.desktop"; | ||
| return GetAutostartDir() / strprintf("bitcoin-%s.lnk", chain); |
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.
nit: s/strprintf("bitcoin-%s.lnk", chain) / "bitcoin-"+chain+".lnk"? But maybe a matter of taste.
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.
Depends on from where you come :-) But of course this should be C++ ;-)
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.
I used this + "" + syntax a lot in earlier days but I don't think this is suitable for a project like bitcoin: The "+something+" syntax usually produces unreadable and nasty diffs when changed.
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.
No strong opinion. Just wanted to say that strprintf in a non-std function brought in over a tiny headers only library (tinyformat) and the + " " + syntax will very likely result in simpler and faster machine code.
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.
This is only called once per invocation of the application at most, so let's not micro-optimize.
2aa49ce Bugfix: Use unique autostart filenames on Linux for testnet/regtest (Luke Dashjr)
2aa49ce Bugfix: Use unique autostart filenames on Linux for testnet/regtest (Luke Dashjr)
2aa49ce Bugfix: Use unique autostart filenames on Linux for testnet/regtest (Luke Dashjr)
ae311bc Fix autostart filenames on Linux (Hennadii Stepanov) Pull request description: Currently, on master the `bitcoin-test.lnk` and `bitcoin-regtest.lnk` files do not work as autostart application `.desktop` files. This PR fixes it. Refs: - #7045 - [Autostart Of Applications During Startup](https://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html) ACKs for top commit: promag: utACK ae311bc, weird why extension `.lnk` was used in #7045. laanwj: Code review ACK ae311bc Tree-SHA512: 210cc346600d52b0a262c81ed5f258365a3cea2e5522f4b5f4798fd3b54f45ed82aba68eefae59a6b6f1d8e4d00221476c23bdffc038f16f2f45c1acc837f522
Currently, mainnet/testnet/regtest use the same file for their autostarts.