Skip to content

Commit

Permalink
Merge pull request #1904 from Liderate/master
Browse files Browse the repository at this point in the history
Replace spaces with ? wildcard when looking for game executable, fix #1605.
  • Loading branch information
Holt59 authored Nov 5, 2023
2 parents 3c0cd1c + f6af8ed commit af5e042
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/settingsdialogpaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af5e042

Please sign in to comment.