Qt: Prevent savestate load/save on empty filename

This commit is contained in:
sowens99 2023-05-01 19:57:58 -04:00
parent b514df1227
commit 9b1d657614
1 changed files with 4 additions and 2 deletions

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()