mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Remove the valid flag from the SqliteTableModel class
Remove the valid flag from the SqliteTableModel class and remove its usage in the Execute SQL tab of the main window. I believe this hasn't been used for some time now because the main sources of error should really be noticed before the query is even handed over to the model. Additionally the valid flag wasn't as realible either anymore because of the multi-threaded execution of the model queries.
This commit is contained in:
@@ -1081,20 +1081,13 @@ void MainWindow::executeQuery()
|
||||
case SQLITE_ROW:
|
||||
{
|
||||
sqlWidget->getModel()->setQuery(queryPart);
|
||||
if(sqlWidget->getModel()->valid())
|
||||
{
|
||||
// The query takes the last placeholder as it may itself contain the sequence '%' + number
|
||||
statusMessage = tr("%1 rows returned in %2ms from: %3").arg(
|
||||
sqlWidget->getModel()->totalRowCount()).arg(timer.elapsed()).arg(queryPart.trimmed());
|
||||
ui->actionSqlResultsSave->setEnabled(true);
|
||||
ui->actionSqlResultsSaveAsView->setEnabled(!db.readOnly());
|
||||
sql3status = SQLITE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
statusMessage = tr("Error executing query: %1").arg(queryPart);
|
||||
sql3status = SQLITE_ERROR;
|
||||
}
|
||||
|
||||
// The query takes the last placeholder as it may itself contain the sequence '%' + number
|
||||
statusMessage = tr("%1 rows returned in %2ms from: %3").arg(
|
||||
sqlWidget->getModel()->totalRowCount()).arg(timer.elapsed()).arg(queryPart.trimmed());
|
||||
ui->actionSqlResultsSave->setEnabled(true);
|
||||
ui->actionSqlResultsSaveAsView->setEnabled(!db.readOnly());
|
||||
sql3status = SQLITE_OK;
|
||||
}
|
||||
case SQLITE_DONE:
|
||||
case SQLITE_OK:
|
||||
|
||||
Reference in New Issue
Block a user