Improve code for deleting table rows

Actually handle the case that deleting rows might fail in the
SqliteTableModel. That's where this sort of check belongs.

This allows us to get rid of the full refresh of the table view after
deleting a row in the Browse Data tab. Thanks to @innermous for pointing
this out!
This commit is contained in:
Martin Kleusberg
2016-08-14 16:37:00 +02:00
parent c6121c8d64
commit 777088fc80
2 changed files with 11 additions and 6 deletions

View File

@@ -595,7 +595,7 @@ void MainWindow::deleteRecord()
break;
}
}
populateTable(ui->comboBrowseTable->currentText());
if(old_row > m_browseTableModel->totalRowCount())
old_row = m_browseTableModel->totalRowCount();
selectTableLine(old_row);