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