Prompt about unsaved changes when trying to load a map instead of prompting when opening the dialogue.

This commit is contained in:
Joakim Thorén committed 2024-11-18 23:09:08 +01:00
1 parent 5e898b9aa8
commit 2ed83e53b7
1 file changed
+4 -5
+4 -5
View File
@@ -448,9 +448,6 @@ void MainWindow::on_actionOpen_triggered()
void MainWindow::on_actionOpenRecent_triggered()
{
if(!getAnswerAboutUnsavedChanges())
return;
QSettings s(Ui::teamName, Ui::appName);
QStringList recentFiles = s.value(recentlyOpenedFilesSetting).toStringList();
@@ -483,8 +480,10 @@ void MainWindow::on_actionOpenRecent_triggered()
RecentFileDialog d(this, recentFiles);
auto onSelect = [this, &d](QListWidgetItem *item) {
QString filename = item->text();
openMap(filename);
if(getAnswerAboutUnsavedChanges()) {
QString filename = item->text();
openMap(filename);
}
d.close();
};