ProjectExplorer: Move some not-fully-session related bits

... out of SessionManager.

The idea is to later move SessionManager into the Core plugin,
which both is sensible conceptually and also prerequisite to
merge the Bookmark plugin into TextEditor plugin.

Currently, only the interface is split, as the load/save
implemetations are non-mechanical to disentangle.

Change-Id: I31631db3094ea192825a2ccaa6add6188662940b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-02-14 15:47:22 +01:00
parent 03e1c18f78
commit 3e7d93c788
170 changed files with 1176 additions and 1040 deletions

View File

@@ -32,22 +32,28 @@
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
#include <cplusplus/CppDocument.h>
#include <cplusplus/LookupContext.h>
#include <cplusplus/Overview.h>
#include <cppeditor/cppeditorconstants.h>
#include <cppeditor/cppmodelmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorericons.h>
#include <projectexplorer/projectmanager.h>
#include <projectexplorer/projectpanelfactory.h>
#include <projectexplorer/runcontrol.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <texteditor/textdocument.h>
#include <texteditor/texteditor.h>
#include <utils/algorithm.h>
#include <utils/textutils.h>
#include <utils/utilsicons.h>
@@ -148,11 +154,11 @@ AutotestPluginPrivate::AutotestPluginPrivate()
m_testTreeModel.synchronizeTestFrameworks();
m_testTreeModel.synchronizeTestTools();
auto sessionManager = ProjectExplorer::SessionManager::instance();
connect(sessionManager, &ProjectExplorer::SessionManager::startupProjectChanged,
auto sessionManager = ProjectExplorer::ProjectManager::instance();
connect(sessionManager, &ProjectExplorer::ProjectManager::startupProjectChanged,
this, [this] { m_runconfigCache.clear(); });
connect(sessionManager, &ProjectExplorer::SessionManager::aboutToRemoveProject,
connect(sessionManager, &ProjectExplorer::ProjectManager::aboutToRemoveProject,
this, [](ProjectExplorer::Project *project) {
const auto it = s_projectSettings.constFind(project);
if (it != s_projectSettings.constEnd()) {
@@ -471,7 +477,7 @@ void AutotestPluginPrivate::onRunUnderCursorTriggered(TestRunMode mode)
TestFrameworks AutotestPlugin::activeTestFrameworks()
{
ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject();
TestFrameworks sorted;
if (!project || projectSettings(project)->useGlobalSettings()) {
sorted = Utils::filtered(TestFrameworkManager::registeredFrameworks(),
@@ -489,7 +495,7 @@ TestFrameworks AutotestPlugin::activeTestFrameworks()
void AutotestPlugin::updateMenuItemsEnabledState()
{
const ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject();
const ProjectExplorer::Project *project = ProjectExplorer::ProjectManager::startupProject();
const ProjectExplorer::Target *target = project ? project->activeTarget() : nullptr;
const bool canScan = !dd->m_testRunner.isTestRunning()
&& dd->m_testCodeParser.state() == TestCodeParser::Idle;