Skip to content

Commit

Permalink
Remove magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
vtronko committed Aug 25, 2016
1 parent f91773b commit 50a1231
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,23 +1001,35 @@ void MainWindow::mainTabSelected(int tabindex)
{
editDock->setReadOnly(true);

if(tabindex == 0)
switch (tabindex)
{
case StructureTab:
populateStructure();
} else if(tabindex == 1) {
break;

case BrowseTab:
m_currentTabTableModel = m_browseTableModel;
populateStructure();
populateTable();
} else if(tabindex == 2) {
break;

case PragmaTab:
loadPragmas();
} else if(tabindex == 3) {
break;

case ExecuteTab:
{
SqlExecutionArea* sqlWidget = qobject_cast<SqlExecutionArea*>(ui->tabSqlAreas->currentWidget());

if (sqlWidget) {
m_currentTabTableModel = sqlWidget->getModel();

dataTableSelectionChanged(sqlWidget->getTableResult()->currentIndex());
}
break;
}

default: break;
}
}

Expand Down

0 comments on commit 50a1231

Please sign in to comment.