summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythonutils.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-02-14 15:47:22 +0100
committerhjk <hjk@qt.io>2023-03-01 09:26:50 +0000
commit3e7d93c788773c7f8194a5465ee0f46961432d76 (patch)
tree115ed460e95c7c4043e71b37372f1e62b89834c5 /src/plugins/python/pythonutils.cpp
parent03e1c18f78c1103e149d7daee76ec070c8b001cf (diff)
downloadqt-creator-3e7d93c788773c7f8194a5465ee0f46961432d76.tar.gz
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>
Diffstat (limited to 'src/plugins/python/pythonutils.cpp')
-rw-r--r--src/plugins/python/pythonutils.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp
index 346c42d183..8635605092 100644
--- a/src/plugins/python/pythonutils.cpp
+++ b/src/plugins/python/pythonutils.cpp
@@ -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;