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

pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:linux_autostart_unique changing 1 files +4 −1
  1. luke-jr commented at 8:52 PM on November 17, 2015: member

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

  2. Bugfix: Use unique autostart filenames on Linux for testnet/regtest 2aa49ce9fe
  3. jonasschnelli commented at 7:56 AM on November 18, 2015: contributor

    utACK

  4. jonasschnelli added the label GUI on Nov 18, 2015
  5. jonasschnelli added the label Windows on Nov 18, 2015
  6. MarcoFalke commented at 8:15 AM on November 18, 2015: member

    utACK

  7. in src/qt/guiutil.cpp:None in 2aa49ce9fe
     353 | @@ -354,7 +354,10 @@ boost::filesystem::path static GetAutostartDir()
     354 |  
     355 |  boost::filesystem::path static GetAutostartFilePath()
     356 |  {
     357 | -    return GetAutostartDir() / "bitcoin.desktop";
     358 | +    std::string chain = ChainNameFromCommandLine();
     359 | +    if (chain == CBaseChainParams::MAIN)
    


    laanwj commented at 4:04 PM on November 18, 2015:

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


    luke-jr commented at 8:26 PM on November 18, 2015:

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


    laanwj commented at 12:41 PM on November 19, 2015:

    Hm, true. Yeah.

  8. laanwj commented at 4:04 PM on November 18, 2015: member

    Concept ACK

  9. in src/qt/guiutil.cpp:None in 2aa49ce9fe
     353 | @@ -354,7 +354,10 @@ boost::filesystem::path static GetAutostartDir()
     354 |  
     355 |  boost::filesystem::path static GetAutostartFilePath()
     356 |  {
     357 | -    return GetAutostartDir() / "bitcoin.desktop";
     358 | +    std::string chain = ChainNameFromCommandLine();
     359 | +    if (chain == CBaseChainParams::MAIN)
     360 | +        return GetAutostartDir() / "bitcoin.desktop";
     361 | +    return GetAutostartDir() / strprintf("bitcoin-%s.lnk", chain);
    


    jonasschnelli commented at 7:30 AM on November 19, 2015:

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


    paveljanik commented at 8:15 AM on November 19, 2015:

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


    MarcoFalke commented at 11:09 AM on November 19, 2015:

    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.


    jonasschnelli commented at 12:39 PM on November 19, 2015:

    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.


    laanwj commented at 12:41 PM on November 19, 2015:

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

  10. laanwj merged this on Nov 24, 2015
  11. laanwj closed this on Nov 24, 2015

  12. laanwj referenced this in commit 72dccfc29d on Nov 24, 2015
  13. luke-jr referenced this in commit 5fd1717f14 on Nov 30, 2015
  14. luke-jr referenced this in commit ce2809aef6 on Dec 8, 2015
  15. laanwj referenced this in commit e5abb59a9a on Jul 18, 2019
  16. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me