From 07fff42a001031ef4ba55e6262708d2afaafeda1 Mon Sep 17 00:00:00 2001 From: redstrate Date: Tue, 2 Nov 2021 08:27:11 -0400 Subject: [PATCH] Make open game dir button work on Windows --- src/settingswindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/settingswindow.cpp b/src/settingswindow.cpp index 29ae36b..9517467 100644 --- a/src/settingswindow.cpp +++ b/src/settingswindow.cpp @@ -84,7 +84,14 @@ SettingsWindow::SettingsWindow(LauncherWindow& window, QWidget* parent) : window auto gameDirectoryButton = new QPushButton("Open Game Directory"); connect(gameDirectoryButton, &QPushButton::pressed, [this] { +#if defined(Q_OS_WIN) + // for some reason, windows requires special treatment (what else is new?) + const QFileInfo fileInfo(this->window.gamePath); + + QProcess::startDetached("explorer.exe", QStringList(QDir::toNativeSeparators(fileInfo.canonicalFilePath()))); +#else QDesktopServices::openUrl("file://" + this->window.gamePath); +#endif }); layout->addWidget(gameDirectoryButton); } \ No newline at end of file