Project files: prevent SQL tabs loss while closing the application

When a project file is loaded, changes are made, and the event close is
triggered, we lose the SQL file contents, because the project file is saved
when the tabs are close. Now the order is reversed, so the project saving
catches the correct state.

See issue #3007
This commit is contained in:
mgrojo
2022-07-31 17:43:17 +02:00
parent 0280d98a8f
commit fb43e0677a

View File

@@ -801,12 +801,14 @@ bool MainWindow::closeFiles()
return false;
}
bool projectClosed = closeProject();
// Now all tabs can be closed at once without asking user.
// Close tabs in reverse order (so indexes are not changed in the process).
for(int i=ui->tabSqlAreas->count()-1; i>=0; i--)
closeSqlTab(i, /* force */ true, /* askSaving */ false);
return closeProject();
return projectClosed;
}
bool MainWindow::closeProject()