DBBrowserDB: Remove getTableSQL() function

Delete the getTableSQL() method in DBBrowserDB. Because we reload and
store the SQL statements for tables after every change to the DB layout
we can just use these strings instead of having an extra function doing
an extra DB query. This simplifies the code a bit and also reduces the
number of SQL statements executed by the application.
This commit is contained in:
Martin Kleusberg
2013-06-13 18:11:18 +02:00
parent 7bf3b87411
commit bd169e034f
3 changed files with 4 additions and 37 deletions

View File

@@ -30,7 +30,7 @@ EditTableDialog::EditTableDialog(DBBrowserDB* db, const QString& tableName, QWid
m_bNewTable = false; // we are editing an existing table
// Existing table, so load and set the current layout
QString sTablesql = pdb->getTableSQL(curTable);
QString sTablesql = pdb->getObjectByName(curTable).getsql();
m_table = sqlb::Table::parseSQL(sTablesql);
populateFields();
}
@@ -366,7 +366,7 @@ void EditTableDialog::removeField()
QMessageBox::warning(0, QApplication::applicationName(), pdb->lastErrorMessage);
} else {
//relayout
QString sTablesql = pdb->getTableSQL(curTable);
QString sTablesql = pdb->getObjectByName(curTable).getsql();
m_table = sqlb::Table::parseSQL(sTablesql);
populateFields();
}