qt: fix opening bitcoin.conf via Preferences on macOS; see #15409
This commit is contained in:
parent
387eb5b343
commit
6e6494b3fb
1 changed files with 10 additions and 1 deletions
|
@ -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) :
|
||||
|
|
Loading…
Reference in a new issue