mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-02 05:17:52 +00:00
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.
This commit is contained in:
parent
1ac45342dd
commit
d33f641912
1 changed files with 8 additions and 2 deletions
|
@ -631,9 +631,15 @@ void GMainWindow::OnMenuLoadFile() {
|
|||
}
|
||||
|
||||
void GMainWindow::OnMenuLoadFolder() {
|
||||
QDir dir = QFileDialog::getExistingDirectory(this, tr("Open Extracted ROM Directory"));
|
||||
const QString dir_path =
|
||||
QFileDialog::getExistingDirectory(this, tr("Open Extracted ROM Directory"));
|
||||
|
||||
QStringList matching_main = dir.entryList(QStringList("main"), QDir::Files);
|
||||
if (dir_path.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const QDir dir{dir_path};
|
||||
const QStringList matching_main = dir.entryList(QStringList("main"), QDir::Files);
|
||||
if (matching_main.size() == 1) {
|
||||
BootGame(dir.path() + DIR_SEP + matching_main[0]);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue