Use references for safety (#747)

This commit is contained in:
Vlad
2016-08-26 00:02:40 +03:00
committed by Martin Kleusberg
parent 281cf5cb73
commit 3ef9491d64
5 changed files with 24 additions and 27 deletions

View File

@@ -87,7 +87,7 @@ void MainWindow::init()
connect(m_browseTableModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(dataTableSelectionChanged(QModelIndex)));
// Set up DB structure tab
dbStructureModel = new DbStructureModel(ui->dbTreeWidget);
dbStructureModel = new DbStructureModel(db, this);
ui->dbTreeWidget->setModel(dbStructureModel);
ui->dbTreeWidget->setColumnHidden(1, true);
ui->dbTreeWidget->setColumnWidth(0, 300);
@@ -339,7 +339,7 @@ void MainWindow::populateStructure()
// Refresh the structure tab
db.updateSchema();
dbStructureModel->reloadData(&db);
dbStructureModel->reloadData();
ui->dbTreeWidget->setRootIndex(dbStructureModel->index(1, 0)); // Show the 'All' part of the db structure
ui->dbTreeWidget->expandToDepth(0);
ui->treeSchemaDock->setRootIndex(dbStructureModel->index(1, 0)); // Show the 'All' part of the db structure