Rewrite export to SQL dump

Completely rewrite the code for exporting the entire database to an SQL
file. The new code is more concise and should be easier to understand.
It also displays a progress bar while exporting the data. Also this
change eliminated most compiler warnings.
This commit is contained in:
Martin Kleusberg
2013-01-10 19:49:55 +01:00
parent 2a7b3d47fa
commit ef197e29e3
4 changed files with 89 additions and 378 deletions

View File

@@ -879,14 +879,12 @@ void MainWindow::exportDatabaseToSQL()
defaultlocation,
"Text files(*.sql *.txt)");
if (fileName.size() > 0)
if(fileName.size())
{
if (!db.dump(fileName))
{
QMessageBox::warning( this, QApplication::applicationName(), "Could not create export file." );
} else {
QMessageBox::information( this, QApplication::applicationName(), "Export completed." );
}
if(!db.dump(fileName))
QMessageBox::warning(this, QApplication::applicationName(), "Export cancelled or failed.");
else
QMessageBox::information(this, QApplication::applicationName(), "Export completed.");
}
}