mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-17 09:19:38 -06:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user