aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/projectmanager.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-05-22 13:45:27 +0200
committerEike Ziller <eike.ziller@qt.io>2023-05-23 13:14:04 +0000
commit5ac582a9b65c96210cee578aa62489ca3377176f (patch)
treefaea997734058595cf6db6a7e847df1bc0bc2f83 /src/plugins/projectexplorer/projectmanager.cpp
parent2726f7716f0e419ac75cb18e4ab5d7a5298be62e (diff)
Remove usage of SessionManagerPrivate from project explorer
Change-Id: Ia12a9ba2d9e65605715110ea0330d5c1e1cae7c6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/projectmanager.cpp')
-rw-r--r--src/plugins/projectexplorer/projectmanager.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/plugins/projectexplorer/projectmanager.cpp b/src/plugins/projectexplorer/projectmanager.cpp
index ff5b214b10..6d0730786b 100644
--- a/src/plugins/projectexplorer/projectmanager.cpp
+++ b/src/plugins/projectexplorer/projectmanager.cpp
@@ -3,7 +3,6 @@
#include "projectmanager.h"
-#include "session_p.h"
#include "session.h"
#include "buildconfiguration.h"
@@ -280,7 +279,7 @@ void ProjectManager::addProject(Project *pro)
QTC_CHECK(!pro->displayName().isEmpty());
QTC_CHECK(pro->id().isValid());
- sb_d->m_virginSession = false;
+ SessionManager::markSessionFileDirty();
QTC_ASSERT(!d->m_projects.contains(pro), return);
d->m_projects.append(pro);
@@ -314,7 +313,7 @@ void ProjectManager::addProject(Project *pro)
void ProjectManager::removeProject(Project *project)
{
- sb_d->m_virginSession = false;
+ SessionManager::markSessionFileDirty();
QTC_ASSERT(project, return);
removeProjects({project});
}
@@ -396,7 +395,8 @@ void ProjectManagerPrivate::dependencies(const FilePath &proName, FilePaths &res
QString ProjectManagerPrivate::sessionTitle(const FilePath &filePath)
{
- if (SessionManager::isDefaultSession(sb_d->m_sessionName)) {
+ const QString sessionName = SessionManager::activeSession();
+ if (SessionManager::isDefaultSession(sessionName)) {
if (filePath.isEmpty()) {
// use single project's name if there is only one loaded.
const QList<Project *> projects = ProjectManager::projects();
@@ -404,10 +404,7 @@ QString ProjectManagerPrivate::sessionTitle(const FilePath &filePath)
return projects.first()->displayName();
}
} else {
- QString sessionName = sb_d->m_sessionName;
- if (sessionName.isEmpty())
- sessionName = Tr::tr("Untitled");
- return sessionName;
+ return sessionName.isEmpty() ? Tr::tr("Untitled") : sessionName;
}
return QString();
}