-
Notifications
You must be signed in to change notification settings - Fork 37.7k
[Qt] honor current network when creating autostart link #5793
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
Hopefully fixed the Travis build and also added the change for Linux (needs testing). |
// Start client minimized | ||
QString strArgs = "-min"; | ||
// Start testnet client, if we are currently running testnet | ||
if (Params().NetworkIDString() == "test") |
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.
You could generalize this by passing the current value of testnet, or even regtest to the link,
strprintf("-testnet=%d -regtest=%d", GetBoolArg("-testnet"), GetBoolArg("-regtest"))
Not that I think there is much use in an autostarting regtest instance.
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.
If you do keep it like this based on special-casing the network name, make sure that you avoid doing anything if the net is not main
or test
Failing travis on windows
|
Yeah I already saw this... will need to rework :). |
Who is able to test this :)? |
|
||
#ifdef UNICODE | ||
// Convert the QString to TCHAR* | ||
TCHAR* args = new TCHAR[strArgs.length() + 1]; |
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.
We should use RAII here, could be done in various ways. Most obvious is boost::scoped_array, e.g.
scoped_array<TCHAR> args (new TCHAR[strArgs.length() + 1]);
Another option would be going through std::wstring, e.g.
std::wstring wstrArgs = strArgs.toStdWString();
TCHAR *args = W2T(wstrArgs.c_str());
In this case the manual appending of a NULL byte can be avoided, and the code can be shorter.
@laanwj I choose the scoped_array, because the other macro wasn't available here. I also updated to your generic approach for testnet/tegtest. |
- creates a "Bitcoin (testnet).lnk" when on testnet or a "Bitcoin (regtest).lnk, when on regtest - fixes #5778
utACK |
@tykling can you test this? |
I have no means of building this, sorry, but from reviewing the code it appears to do exactly what is should :) Is there somewhere I can download the executable travis built and try that? |
Tested ACK. Binaries to test: https://builds.jonasschnelli.ch/pulls/5793/ |
e2fee5c [GUI] Use wchar_t API explicitly on Windows (Fuzzbawls) Pull request description: backport of bitcoin#13734 to use the wchar API for windows startup function. This is the first in a long list of upstream PRs that aim to bring full Unicode support to Windows clients as detailed in bitcoin#13869 Also included here is the relevant parts of bitcoin#5793, to use per-network auto startup shortcuts. ACKs for top commit: furszy: utACK e2fee5c . random-zebra: utACK e2fee5c and merging... Tree-SHA512: dc4ea84ee10199bdf293977f00c09caf65cbdd1ee2ae14b1adb34fd75c05b847d5971abd17732a77be88bed9e06092b670b09c5760a686b29d64ba8f02d2e4b2
(regtest).lnk, when on regtest