Skip to content

Commit

Permalink
qt: fix opening bitcoin.conf via Preferences on macOS; see bitcoin#15409
Browse files Browse the repository at this point in the history
  • Loading branch information
web3shannon committed Jun 3, 2019
1 parent 387eb5b commit 6e6494b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

#include <objc/objc-runtime.h>
#include <CoreServices/CoreServices.h>
#include <QProcess>
#endif

namespace GUIUtil {
Expand Down Expand Up @@ -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) :
Expand Down

0 comments on commit 6e6494b

Please sign in to comment.