Commit fc3abe99 authored by Daniel Teske's avatar Daniel Teske
Browse files

ProjectTree: Make project loading fast again



Change-Id: I4a84579311a606d442805acbac2793e8b5ddf515
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent cca10304
......@@ -192,7 +192,9 @@ void ProjectTree::updateFromDocumentManager(bool invalidCurrentNode)
void ProjectTree::update(Node *node, Project *project)
{
if (project != m_currentProject) {
bool changedProject = project != m_currentProject;
bool changedNode = node != m_currentNode;
if (changedProject) {
if (m_currentProject) {
disconnect(m_currentProject, &Project::projectContextUpdated,
this, &ProjectTree::updateContext);
......@@ -216,15 +218,17 @@ void ProjectTree::update(Node *node, Project *project)
Qt::UniqueConnection);
}
if (node != m_currentNode) {
if (changedNode) {
m_currentNode = node;
emit currentNodeChanged(m_currentNode, project);
}
emit currentProjectChanged(m_currentProject);
updateDefaultLocationForNewFiles();
updateContext();
if (changedProject) {
emit currentProjectChanged(m_currentProject);
updateDefaultLocationForNewFiles();
updateContext();
}
}
void ProjectTree::updateDefaultLocationForNewFiles()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment