summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-14 20:44:49 +0200
committerGitHub <noreply@github.com>2018-10-14 20:44:49 +0200
commit3203193a673f65d093a6ace18a034e1add4d8828 (patch)
treee6d6ea028ee8d07bc8e864d8b3732d17ea381d44
parentMerge pull request #1488 from Hexagon12/astc-types (diff)
parentyuzu/main: Simplify OnMenuLoadFile() (diff)
downloadyuzu-3203193a673f65d093a6ace18a034e1add4d8828.tar
yuzu-3203193a673f65d093a6ace18a034e1add4d8828.tar.gz
yuzu-3203193a673f65d093a6ace18a034e1add4d8828.tar.bz2
yuzu-3203193a673f65d093a6ace18a034e1add4d8828.tar.lz
yuzu-3203193a673f65d093a6ace18a034e1add4d8828.tar.xz
yuzu-3203193a673f65d093a6ace18a034e1add4d8828.tar.zst
yuzu-3203193a673f65d093a6ace18a034e1add4d8828.zip
-rw-r--r--src/yuzu/main.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index beb57ea5d..cc92ea5b8 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -908,22 +908,20 @@ void GMainWindow::OnGameListNavigateToGamedbEntry(u64 program_id,
}
void GMainWindow::OnMenuLoadFile() {
- QString extensions;
- for (const auto& piece : game_list->supported_file_extensions)
- extensions += "*." + piece + " ";
+ const QString extensions =
+ QString("*.").append(GameList::supported_file_extensions.join(" *.")).append(" main");
+ const QString file_filter = tr("Switch Executable (%1);;All Files (*.*)",
+ "%1 is an identifier for the Switch executable file extensions.")
+ .arg(extensions);
+ const QString filename = QFileDialog::getOpenFileName(
+ this, tr("Load File"), UISettings::values.roms_path, file_filter);
- extensions += "main ";
-
- QString file_filter = tr("Switch Executable") + " (" + extensions + ")";
- file_filter += ";;" + tr("All Files (*.*)");
-
- QString filename = QFileDialog::getOpenFileName(this, tr("Load File"),
- UISettings::values.roms_path, file_filter);
- if (!filename.isEmpty()) {
- UISettings::values.roms_path = QFileInfo(filename).path();
-
- BootGame(filename);
+ if (filename.isEmpty()) {
+ return;
}
+
+ UISettings::values.roms_path = QFileInfo(filename).path();
+ BootGame(filename);
}
void GMainWindow::OnMenuLoadFolder() {