Skip to content

Commit a6cbc02

Browse files
committed
Bugfix: Default -uiplatform is not actually the platform this build was compiled on
1 parent fa41d4c commit a6cbc02

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

src/qt/bitcoin.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,8 @@ BitcoinApplication::BitcoinApplication(int &argc, char **argv):
311311
// UI per-platform customization
312312
// This must be done inside the BitcoinApplication constructor, or after it, because
313313
// PlatformStyle::instantiate requires a QApplication
314-
#if defined(Q_OS_MAC)
315-
std::string platformName = "macosx";
316-
#elif defined(Q_OS_WIN)
317-
std::string platformName = "windows";
318-
#else
319-
std::string platformName = "other";
320-
#endif
321-
platformName = GetArg("-uiplatform", platformName);
314+
std::string platformName;
315+
platformName = GetArg("-uiplatform", BitcoinGUI::DEFAULT_UIPLATFORM);
322316
platformStyle = PlatformStyle::instantiate(QString::fromStdString(platformName));
323317
if (!platformStyle) // Fall back to "other" if specified name not found
324318
platformStyle = PlatformStyle::instantiate("other");

src/qt/bitcoingui.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@
5959
#include <QUrlQuery>
6060
#endif
6161

62+
const std::string BitcoinGUI::DEFAULT_UIPLATFORM =
63+
#if defined(Q_OS_MAC)
64+
"macosx"
65+
#elif defined(Q_OS_WIN)
66+
"windows"
67+
#else
68+
"other"
69+
#endif
70+
;
71+
6272
const QString BitcoinGUI::DEFAULT_WALLET = "~Default";
6373

6474
BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :

src/qt/bitcoingui.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class BitcoinGUI : public QMainWindow
4848

4949
public:
5050
static const QString DEFAULT_WALLET;
51+
static const std::string DEFAULT_UIPLATFORM;
5152

5253
explicit BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent = 0);
5354
~BitcoinGUI();

src/qt/utilitydialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
8686
strUsage += HelpMessageOpt("-splash", strprintf(_("Show splash screen on startup (default: %u)"), DEFAULT_SPLASHSCREEN));
8787
strUsage += HelpMessageOpt("-resetguisettings", _("Reset all settings changes made over the GUI"));
8888
if (showDebug) {
89-
strUsage += HelpMessageOpt("-uiplatform", "Select platform to customize UI for (one of windows, macosx, other; default: platform compiled on)");
89+
strUsage += HelpMessageOpt("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM));
9090
}
9191
QString coreOptions = QString::fromStdString(strUsage);
9292
text = version + "\n" + header + "\n" + coreOptions;

0 commit comments

Comments
 (0)