Don't refresh Browse Data tab if it isn't visible anyway

This doesn't reduce the number of populateTable calls (well, obviously)
but it reduces the cost of some of the more useless ones a lot.
This commit is contained in:
Martin Kleusberg
2016-08-16 22:27:56 +02:00
parent e9063235f9
commit 0dab0a28a1

View File

@@ -381,6 +381,10 @@ void MainWindow::populateStructure()
void MainWindow::populateTable(QString tablename)
{
// Early exit if the Browse Data tab isn't visible as there is no need to update it in this case
if(ui->mainTab->currentIndex() != 1)
return;
// Remove the model-view link if the table name is empty in order to remove any data from the view
if(ui->comboBrowseTable->model()->rowCount(ui->comboBrowseTable->rootModelIndex()) == 0 && tablename.isEmpty())
{