Skip to content

Commit fb43e06

Browse files
committed
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
1 parent 0280d98 commit fb43e06

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/MainWindow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,12 +801,14 @@ bool MainWindow::closeFiles()
801801
return false;
802802
}
803803

804+
bool projectClosed = closeProject();
805+
804806
// Now all tabs can be closed at once without asking user.
805807
// Close tabs in reverse order (so indexes are not changed in the process).
806808
for(int i=ui->tabSqlAreas->count()-1; i>=0; i--)
807809
closeSqlTab(i, /* force */ true, /* askSaving */ false);
808810

809-
return closeProject();
811+
return projectClosed;
810812
}
811813

812814
bool MainWindow::closeProject()

0 commit comments

Comments
 (0)