diff options
| author | shannon1916 <[email protected]> | 2019-05-19 16:43:22 +0800 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2019-06-07 11:11:56 +0200 |
| commit | b55cbe82d98338c3c63770d624bda64cb0f472b9 (patch) | |
| tree | 0809f61a8610df6564b746d69cd3f8883aac2315 /src/qt/guiutil.cpp | |
| parent | Disallow extended encoding for non-witness transactions (take 3) (diff) | |
| download | discoin-b55cbe82d98338c3c63770d624bda64cb0f472b9.tar.xz discoin-b55cbe82d98338c3c63770d624bda64cb0f472b9.zip | |
qt: fix opening bitcoin.conf via Preferences on macOS; see #15409
Github-Pull: #16044
Rebased-From: 6e6494b3fb345848025494cb7a79c5bf8f35e417
Diffstat (limited to 'src/qt/guiutil.cpp')
| -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 ba0a5abdf..f6dba1006 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 { @@ -392,7 +393,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) : |