mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 19:57:45 +00:00
Make open game dir button work on Windows
This commit is contained in:
parent
b8893ee0b0
commit
07fff42a00
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
}
|
Loading…
Add table
Reference in a new issue