merge bitcoin#16044: fix opening bitcoin.conf via Preferences on macOS

This commit is contained in:
Kittywhiskers Van Gogh 2021-11-08 20:20:39 +03:00
parent 6f98a32403
commit 843e6d4c86

View File

@ -606,8 +606,15 @@ void openConfigfile()
fs::path pathConfig = GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME));
/* Open dash.conf with the associated application */
if (fs::exists(pathConfig))
QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig)));
if (fs::exists(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
}
}
void showBackups()