Clear SQL log when closing a DB and close DB before opening a new one

Clear the SQL log when closing the associated DB file.

Before opening a new database file make sure the last one is closed
correctly.
This commit is contained in:
Martin Kleusberg
2013-01-09 20:22:18 +01:00
parent dff9221963
commit 2a7b3d47fa

View File

@@ -124,9 +124,10 @@ void MainWindow::fileOpen(const QString & fileName)
"Choose a database file",
defaultlocation);
}
if (QFile::exists(wFile) )
if(QFile::exists(wFile) )
{
if (db.open(wFile))
fileClose();
if(db.open(wFile))
{
setCurrentFile(wFile);
} else {
@@ -287,6 +288,7 @@ void MainWindow::fileClose()
populateStructure();
loadPragmas();
activateFields(false);
logWin->clearLog();
}
void MainWindow::fileExit()