Merge pull request #11809 from malleoz/malleo/savestate-action-cancel-upstream

Qt: Prevent savestate load/save on empty filename
This commit is contained in:
Admiral H. Curtiss 2023-05-02 17:31:35 +02:00 committed by GitHub
commit 2fa84c73f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1352,7 +1352,8 @@ void MainWindow::StateLoad()
QString path =
DolphinFileDialog::getOpenFileName(this, tr("Select a File"), QDir::currentPath(),
tr("All Save States (*.sav *.s##);; All Files (*)"));
State::LoadAs(path.toStdString());
if (!path.isEmpty())
State::LoadAs(path.toStdString());
}
void MainWindow::StateSave()
@ -1360,7 +1361,8 @@ void MainWindow::StateSave()
QString path =
DolphinFileDialog::getSaveFileName(this, tr("Select a File"), QDir::currentPath(),
tr("All Save States (*.sav *.s##);; All Files (*)"));
State::SaveAs(path.toStdString());
if (!path.isEmpty())
State::SaveAs(path.toStdString());
}
void MainWindow::StateLoadSlot()