Bugfix: Use unique autostart filenames on Linux for testnet/regtest #7045

Merged
merged 1 commit into from Nov 24, 2015

Conversation

Projects
None yet
5 participants
@luke-jr
Member

luke-jr commented Nov 17, 2015

Currently, mainnet/testnet/regtest use the same file for their autostarts.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
Member

jonasschnelli commented Nov 18, 2015

utACK

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Nov 18, 2015

Member

utACK

Member

MarcoFalke commented Nov 18, 2015

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)

This comment has been minimized.

@laanwj

laanwj Nov 18, 2015

Member

I don't think we need this special case.
What's wrong with bitcoin-main.lnk?

@laanwj

laanwj Nov 18, 2015

Member

I don't think we need this special case.
What's wrong with bitcoin-main.lnk?

This comment has been minimized.

@luke-jr

luke-jr Nov 18, 2015

Member

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...

@luke-jr

luke-jr Nov 18, 2015

Member

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...

This comment has been minimized.

@laanwj

laanwj Nov 19, 2015

Member

Hm, true. Yeah.

@laanwj

laanwj Nov 19, 2015

Member

Hm, true. Yeah.

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Nov 18, 2015

Member

Concept ACK

Member

laanwj commented Nov 18, 2015

Concept ACK

+ std::string chain = ChainNameFromCommandLine();
+ if (chain == CBaseChainParams::MAIN)
+ return GetAutostartDir() / "bitcoin.desktop";
+ return GetAutostartDir() / strprintf("bitcoin-%s.lnk", chain);

This comment has been minimized.

@jonasschnelli

jonasschnelli Nov 19, 2015

Member

nit: s/strprintf("bitcoin-%s.lnk", chain) / "bitcoin-"+chain+".lnk"? But maybe a matter of taste.

@jonasschnelli

jonasschnelli Nov 19, 2015

Member

nit: s/strprintf("bitcoin-%s.lnk", chain) / "bitcoin-"+chain+".lnk"? But maybe a matter of taste.

This comment has been minimized.

@paveljanik

paveljanik Nov 19, 2015

Contributor

Depends on from where you come :-) But of course this should be C++ ;-)

@paveljanik

paveljanik Nov 19, 2015

Contributor

Depends on from where you come :-) But of course this should be C++ ;-)

This comment has been minimized.

@MarcoFalke

MarcoFalke Nov 19, 2015

Member

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.

@MarcoFalke

MarcoFalke Nov 19, 2015

Member

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.

This comment has been minimized.

@jonasschnelli

jonasschnelli Nov 19, 2015

Member

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.

@jonasschnelli

jonasschnelli Nov 19, 2015

Member

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.

This comment has been minimized.

@laanwj

laanwj Nov 19, 2015

Member

This is only called once per invocation of the application at most, so let's not micro-optimize.

@laanwj

laanwj Nov 19, 2015

Member

This is only called once per invocation of the application at most, so let's not micro-optimize.

@laanwj laanwj merged commit 2aa49ce into bitcoin:master Nov 24, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Nov 24, 2015

Merge pull request #7045
2aa49ce Bugfix: Use unique autostart filenames on Linux for testnet/regtest (Luke Dashjr)

luke-jr added a commit to luke-jr/bitcoin that referenced this pull request Nov 30, 2015

Merge pull request #7045 (rewrite)
2aa49ce Bugfix: Use unique autostart filenames on Linux for testnet/regtest (Luke Dashjr)

luke-jr added a commit to luke-jr/bitcoin that referenced this pull request Dec 8, 2015

Merge pull request #7045 (rewrite)
2aa49ce Bugfix: Use unique autostart filenames on Linux for testnet/regtest (Luke Dashjr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment