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

View File

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