diff options
author | shannon1916 <shannon@unita.network> | 2019-05-19 16:43:22 +0800 |
---|---|---|
committer | shannon1916 <shannon@unita.network> | 2019-06-03 10:32:15 +0800 |
commit | 6e6494b3fb345848025494cb7a79c5bf8f35e417 (patch) | |
tree | 99b42abf71e1b74fd9c70ec8354864cb1b05bddd | |
parent | 387eb5b34307448f16d3769ac0245c4e3d996a38 (diff) |
qt: fix opening bitcoin.conf via Preferences on macOS; see #15409
-rw-r--r-- | src/qt/guiutil.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 45f21d50fc..70e52c9f1d 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -60,6 +60,7 @@ #include <objc/objc-runtime.h> #include <CoreServices/CoreServices.h> +#include <QProcess> #endif namespace GUIUtil { @@ -399,7 +400,15 @@ bool openBitcoinConf() configFile.close(); /* Open bitcoin.conf with the associated application */ - return QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); + bool res = QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); +#ifdef Q_OS_MAC + // Workaround for macOS-specific behavior; see #15409. + if (!res) { + res = QProcess::startDetached("/usr/bin/open", QStringList{"-t", boostPathToQString(pathConfig)}); + } +#endif + + return res; } ToolTipToRichTextFilter::ToolTipToRichTextFilter(int _size_threshold, QObject *parent) : |