ProjectTree: Add missing registration of pre-existing projects

Register pre-existing projects when opening a new Project View. This
fixes missing parsing state on newly opened Project Views.

Task-number: QTCREATORBUG-20058
Change-Id: I47cd4791c1b8eac7717a7ce2b35d7f35bba5826a
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2018-03-14 13:48:22 +01:00
parent f4b13dc77c
commit 62007d922c

View File

@@ -85,7 +85,9 @@ FlatModel::FlatModel(QObject *parent)
connect(sm, &SessionManager::aboutToSaveSession, this, &FlatModel::saveExpandData); connect(sm, &SessionManager::aboutToSaveSession, this, &FlatModel::saveExpandData);
connect(sm, &SessionManager::projectAdded, this, &FlatModel::handleProjectAdded); connect(sm, &SessionManager::projectAdded, this, &FlatModel::handleProjectAdded);
connect(sm, &SessionManager::startupProjectChanged, this, [this] { layoutChanged(); }); connect(sm, &SessionManager::startupProjectChanged, this, [this] { layoutChanged(); });
rebuildModel();
for (Project *project : SessionManager::projects())
handleProjectAdded(project);
} }
QVariant FlatModel::data(const QModelIndex &index, int role) const QVariant FlatModel::data(const QModelIndex &index, int role) const