Commit 87faa62f authored by Tobias Hunger's avatar Tobias Hunger
Browse files

QmlJsTools: Use the startup project for context in the code model



ProjectTree::currentProject is not the right project to track.

Change-Id: Ia9da32a24e73565c4b9a3739c4000c13b803375f
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@theqtcompany.com>
parent 31032ffb
......@@ -51,6 +51,8 @@ CurrentProjectFilter::CurrentProjectFilter()
connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged,
this, &CurrentProjectFilter::currentProjectChanged);
connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
this, &CurrentProjectFilter::currentProjectChanged);
}
void CurrentProjectFilter::markFilesAsOutOfDate()
......
......@@ -48,6 +48,8 @@ CurrentProjectFind::CurrentProjectFind()
{
connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged,
this, &CurrentProjectFind::handleProjectChanged);
connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
this, &CurrentProjectFind::handleProjectChanged);
connect(SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(handleProjectChanged()));
connect(SessionManager::instance(), SIGNAL(projectAdded(ProjectExplorer::Project*)),
......
......@@ -223,9 +223,9 @@ void ModelManager::delayedInitialization()
this, SLOT(maybeQueueCppQmlTypeUpdate(CPlusPlus::Document::Ptr)), Qt::DirectConnection);
}
connect(ProjectExplorer::SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(removeProjectInfo(ProjectExplorer::Project*)));
connect(ProjectExplorer::ProjectTree::instance(), &ProjectExplorer::ProjectTree::currentProjectChanged,
connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::projectRemoved,
this, &ModelManager::removeProjectInfo);
connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::startupProjectChanged,
this, &ModelManager::updateDefaultProjectInfo);
QmlJS::ViewerContext qbsVContext;
......@@ -265,7 +265,7 @@ ModelManagerInterface::WorkingCopy ModelManager::workingCopyInternal() const
void ModelManager::updateDefaultProjectInfo()
{
// needs to be performed in the ui thread
ProjectExplorer::Project *currentProject = ProjectExplorer::ProjectTree::currentProject();
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::startupProject();
ProjectInfo newDefaultProjectInfo = projectInfo(currentProject,
defaultProjectInfoForProject(currentProject));
setDefaultProject(projectInfo(currentProject,newDefaultProjectInfo), currentProject);
......
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