mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Clear the tree widget in the Structure tab when after closing a DB
Clear the tree widget in the 'Database Structure' tab of the main window after closing a database. See issue #44.
This commit is contained in:
@@ -125,6 +125,13 @@ void DbStructureModel::reloadData(DBBrowserDB* db)
|
||||
rootItem->removeChild(rootItem->child(0));
|
||||
}
|
||||
|
||||
// Return here if no DB is opened
|
||||
if(!db->isOpen())
|
||||
{
|
||||
endResetModel();
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the nodes for tables, indices, views and triggers
|
||||
QMap<QString, QTreeWidgetItem*> typeToParentItem;
|
||||
QTreeWidgetItem* itemTables = new QTreeWidgetItem(rootItem);
|
||||
|
||||
Reference in New Issue
Block a user