From a5b034d4a9c44f9bc1e83b01de82530f8fc63013 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 4 Apr 2015 14:41:04 -0400 Subject: Imported Upstream version 3.0.4 --- SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp') diff --git a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp index 281510f..a4e736f 100644 --- a/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp +++ b/SQLiteStudio3/guiSQLiteStudio/dbtree/dbtreemodel.cpp @@ -222,15 +222,16 @@ void DbTreeModel::restoreGroup(const Config::DbGroupPtr& group, QList* dbLi } else { - // If db is managed by manager, it means it was successfully loaded. - // Otherwise there was a problem with the file, or with plugin for that database - // and we still want to have dbtree item for that database, we will just hide it. - // Later, when plugin is loaded, item might become visible. + db = DBLIST->getByName(group->referencedDbName); + + // Databases referenced in groups must exist on database list. If not, we ignore them. + // Even invalid (no plugin, no file) databases have entry in dblist. + if (!db) + return; + item = DbTreeItemFactory::createDb(group->referencedDbName, this); item->setDb(group->referencedDbName); - - db = DBLIST->getByName(group->referencedDbName); - if (db && dbList) + if (dbList) dbList->removeOne(db); } @@ -297,6 +298,7 @@ void DbTreeModel::dbUpdated(const QString& oldName, Db* db) item->setText(db->getName()); item->setDb(db->getName()); + item->updateDbIcon(); } void DbTreeModel::dbRemoved(Db* db) -- cgit v1.2.3