forked from qt-creator/qt-creator
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:
@@ -10,7 +10,7 @@
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
@@ -152,7 +152,7 @@ void PythonEditorWidget::setUserDefinedPython(const Interpreter &interpreter)
|
||||
QTC_ASSERT(pythonDocument, return);
|
||||
FilePath documentPath = pythonDocument->filePath();
|
||||
QTC_ASSERT(!documentPath.isEmpty(), return);
|
||||
if (Project *project = SessionManager::projectForFile(documentPath)) {
|
||||
if (Project *project = ProjectManager::projectForFile(documentPath)) {
|
||||
if (Target *target = project->activeTarget()) {
|
||||
if (RunConfiguration *rc = target->activeRunConfiguration()) {
|
||||
if (auto interpretersAspect= rc->aspect<InterpreterAspect>()) {
|
||||
@@ -184,7 +184,7 @@ void PythonEditorWidget::updateInterpretersSelector()
|
||||
disconnect(connection);
|
||||
m_projectConnections.clear();
|
||||
const FilePath documentPath = textDocument()->filePath();
|
||||
if (Project *project = SessionManager::projectForFile(documentPath)) {
|
||||
if (Project *project = ProjectManager::projectForFile(documentPath)) {
|
||||
m_projectConnections << connect(project,
|
||||
&Project::activeTargetChanged,
|
||||
this,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <languageserverprotocol/workspace.h>
|
||||
|
||||
#include <projectexplorer/extracompiler.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <coreplugin/messagemanager.h>
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
@@ -31,9 +31,9 @@ static QHash<FilePath, FilePath> &userDefinedPythonsForDocument()
|
||||
FilePath detectPython(const FilePath &documentPath)
|
||||
{
|
||||
Project *project = documentPath.isEmpty() ? nullptr
|
||||
: SessionManager::projectForFile(documentPath);
|
||||
: ProjectManager::projectForFile(documentPath);
|
||||
if (!project)
|
||||
project = SessionManager::startupProject();
|
||||
project = ProjectManager::startupProject();
|
||||
|
||||
Environment env = Environment::systemEnvironment();
|
||||
|
||||
@@ -107,7 +107,7 @@ void openPythonRepl(QObject *parent, const FilePath &file, ReplType type)
|
||||
{
|
||||
static const auto workingDir = [](const FilePath &file) {
|
||||
if (file.isEmpty()) {
|
||||
if (Project *project = SessionManager::startupProject())
|
||||
if (Project *project = ProjectManager::startupProject())
|
||||
return project->projectDirectory();
|
||||
return FilePath::currentWorkingPath();
|
||||
}
|
||||
@@ -155,7 +155,7 @@ QString pythonName(const FilePath &pythonPath)
|
||||
|
||||
PythonProject *pythonProjectForFile(const FilePath &pythonFile)
|
||||
{
|
||||
for (Project *project : SessionManager::projects()) {
|
||||
for (Project *project : ProjectManager::projects()) {
|
||||
if (auto pythonProject = qobject_cast<PythonProject *>(project)) {
|
||||
if (pythonProject->isKnownFile(pythonFile))
|
||||
return pythonProject;
|
||||
|
||||
Reference in New Issue
Block a user