summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-06 14:02:31 -0400
committerGravatar Lioncash2018-08-06 14:02:34 -0400
commitd33f641912f987b65e696d158f190519a4d50c01 (patch)
tree32fe215579607263e84bcdb571b8e864d73e6773
parentMerge pull request #933 from lioncash/memory (diff)
downloadyuzu-d33f641912f987b65e696d158f190519a4d50c01.tar.gz
yuzu-d33f641912f987b65e696d158f190519a4d50c01.tar.xz
yuzu-d33f641912f987b65e696d158f190519a4d50c01.zip
qt: Don't show error dialog when canceling the Load Folder dialog
Previously, when canceling out of the Load Folder dialog, a user would get an error dialog about the selected folder not containing a main file, however, by canceling out of the dialog, no selection was actually made.
-rw-r--r--src/yuzu/main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index e28679cd1..bb7f93a8c 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -631,9 +631,15 @@ void GMainWindow::OnMenuLoadFile() {
631} 631}
632 632
633void GMainWindow::OnMenuLoadFolder() { 633void GMainWindow::OnMenuLoadFolder() {
634 QDir dir = QFileDialog::getExistingDirectory(this, tr("Open Extracted ROM Directory")); 634 const QString dir_path =
635 QFileDialog::getExistingDirectory(this, tr("Open Extracted ROM Directory"));
635 636
636 QStringList matching_main = dir.entryList(QStringList("main"), QDir::Files); 637 if (dir_path.isNull()) {
638 return;
639 }
640
641 const QDir dir{dir_path};
642 const QStringList matching_main = dir.entryList(QStringList("main"), QDir::Files);
637 if (matching_main.size() == 1) { 643 if (matching_main.size() == 1) {
638 BootGame(dir.path() + DIR_SEP + matching_main[0]); 644 BootGame(dir.path() + DIR_SEP + matching_main[0]);
639 } else { 645 } else {