Commit e1b14565 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppTools: Do not clear project state on session unload

Affected functionality was, among others:
 * Getting the correct project part when opening a file
 * Fallback project part (merged defines/includes) not up to date
 * Fallback for "Switch Header/Source" not up to date

In the early days sessions switching was probably implemented by "close
all projects of session X, open all projects of session Y". That's not
the case anymore today.

Change-Id: I4c6a80e2eb219615d3ea6fcf07be7c05072c8832
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent eb96cb45
......@@ -326,8 +326,6 @@ CppModelManager::CppModelManager(QObject *parent)
this, SLOT(onAboutToRemoveProject(ProjectExplorer::Project*)));
connect(sessionManager, SIGNAL(aboutToLoadSession(QString)),
this, SLOT(onAboutToLoadSession()));
connect(sessionManager, SIGNAL(aboutToUnloadSession(QString)),
this, SLOT(onAboutToUnloadSession()));
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
this, &CppModelManager::onCurrentEditorChanged);
......@@ -1061,17 +1059,6 @@ void CppModelManager::onAboutToLoadSession()
GC();
}
void CppModelManager::onAboutToUnloadSession()
{
Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX);
do {
QMutexLocker locker(&d->m_projectMutex);
d->m_projectToProjectsInfo.clear();
recalculateProjectPartMappings();
d->m_dirty = true;
} while (0);
}
void CppModelManager::renameIncludes(const QString &oldFileName, const QString &newFileName)
{
if (oldFileName.isEmpty() || newFileName.isEmpty())
......@@ -1103,6 +1090,7 @@ void CppModelManager::renameIncludes(const QString &oldFileName, const QString &
void CppModelManager::onCoreAboutToClose()
{
Core::ProgressManager::cancelTasks(CppTools::Constants::TASK_INDEX);
d->m_enableGC = false;
}
......
......@@ -197,7 +197,6 @@ private slots:
// This should be executed in the GUI thread.
friend class Tests::ModelManagerTestHelper;
void onAboutToLoadSession();
void onAboutToUnloadSession();
void renameIncludes(const QString &oldFileName, const QString &newFileName);
void onProjectAdded(ProjectExplorer::Project *project);
void onAboutToRemoveProject(ProjectExplorer::Project *project);
......
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