From f6af8ed275fade4347b2d5012bb7bc8910fa24c6 Mon Sep 17 00:00:00 2001 From: Liderate Date: Sat, 14 Oct 2023 05:19:14 -0400 Subject: [PATCH] Replace spaces with ? wildcard for #1605 --- src/settingsdialogpaths.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/settingsdialogpaths.cpp b/src/settingsdialogpaths.cpp index 1907b7fae..895edfac6 100644 --- a/src/settingsdialogpaths.cpp +++ b/src/settingsdialogpaths.cpp @@ -199,9 +199,14 @@ void PathsSettingsTab::on_browseGameDirBtn_clicked() { QFileInfo oldGameExe(ui->managedGameDirEdit->text()); - QString temp = - QFileDialog::getOpenFileName(&dialog(), QObject::tr("Select game executable"), - oldGameExe.absolutePath(), oldGameExe.fileName()); + // this gets the name of the game executable + // + // spaces in the name are interpreted as separators ";" in the filter, + // so we replace them with the single character matching wildcard "?" + // + QString temp = QFileDialog::getOpenFileName( + &dialog(), QObject::tr("Select game executable"), oldGameExe.absolutePath(), + oldGameExe.fileName().replace(QRegularExpression(" "), "?")); if (temp.isEmpty()) { return;