Commit 9fe97068 authored by hjk's avatar hjk
Browse files

ProjectExplorer: Clean up remaining SessionManager uses



Change-Id: I170edc81cc2bcb4de4168c5ec38d3897c2e7c7e8
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent 01266723
......@@ -46,34 +46,28 @@
namespace ProjectExplorer {
namespace Internal {
DependenciesModel::DependenciesModel(SessionManager *session,
Project *project,
QObject *parent)
DependenciesModel::DependenciesModel(Project *project, QObject *parent)
: QAbstractListModel(parent)
, m_session(session)
, m_project(project)
, m_projects(session->projects())
, m_projects(SessionManager::projects())
{
// We can't select ourselves as a dependency
m_projects.removeAll(m_project);
connect(session, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
QObject *sessionManager = SessionManager::instance();
connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(resetModel()));
connect(session, SIGNAL(projectAdded(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
this, SLOT(resetModel()));
connect(session, SIGNAL(sessionLoaded(QString)),
connect(sessionManager, SIGNAL(sessionLoaded(QString)),
this, SLOT(resetModel()));
// qDebug()<<"Dependencies Model"<<this<<"for project"<<project<<"("<<project->file()->fileName()<<")";
}
DependenciesModel::~DependenciesModel()
{
// qDebug()<<"~DependenciesModel"<<this;
}
void DependenciesModel::resetModel()
{
beginResetModel();
m_projects = m_session->projects();
m_projects = SessionManager::projects();
m_projects.removeAll(m_project);
endResetModel();
}
......@@ -101,7 +95,7 @@ QVariant DependenciesModel::data(const QModelIndex &index, int role) const
case Qt::DisplayRole:
return p->displayName();
case Qt::CheckStateRole:
return m_session->hasDependency(m_project, p) ? Qt::Checked : Qt::Unchecked;
return SessionManager::hasDependency(m_project, p) ? Qt::Checked : Qt::Unchecked;
case Qt::DecorationRole:
return Core::FileIconProvider::instance()->icon(QFileInfo(p->projectFilePath()));
default:
......@@ -116,7 +110,7 @@ bool DependenciesModel::setData(const QModelIndex &index, const QVariant &value,
const Qt::CheckState c = static_cast<Qt::CheckState>(value.toInt());
if (c == Qt::Checked) {
if (m_session->addDependency(m_project, p)) {
if (SessionManager::addDependency(m_project, p)) {
emit dataChanged(index, index);
return true;
} else {
......@@ -124,8 +118,8 @@ bool DependenciesModel::setData(const QModelIndex &index, const QVariant &value,
QCoreApplication::translate("DependenciesModel", "This would create a circular dependency."));
}
} else if (c == Qt::Unchecked) {
if (m_session->hasDependency(m_project, p)) {
m_session->removeDependency(m_project, p);
if (SessionManager::hasDependency(m_project, p)) {
SessionManager::removeDependency(m_project, p);
emit dataChanged(index, index);
return true;
}
......@@ -157,11 +151,6 @@ DependenciesView::DependenciesView(QWidget *parent)
setRootIsDecorated(false);
}
DependenciesView::~DependenciesView()
{
}
QSize DependenciesView::sizeHint() const
{
return m_sizeHint;
......@@ -219,13 +208,10 @@ void DependenciesView::updateSizeHint()
// DependenciesWidget
//
DependenciesWidget::DependenciesWidget(SessionManager *session,
Project *project,
QWidget *parent)
DependenciesWidget::DependenciesWidget(Project *project, QWidget *parent)
: QWidget(parent)
, m_session(session)
, m_project(project)
, m_model(new DependenciesModel(session, project, this))
, m_model(new DependenciesModel(project, this))
{
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->setContentsMargins(0, 0, 0, 0);
......@@ -248,14 +234,9 @@ DependenciesWidget::DependenciesWidget(SessionManager *session,
// DependenciesPanelFactory
//
DependenciesPanelFactory::DependenciesPanelFactory(SessionManager *session)
: m_session(session)
{
}
QString DependenciesPanelFactory::id() const
{
return QLatin1String(DEPENDENCIES_PANEL_ID);
return QLatin1String("ProjectExplorer.DependenciesPanel");
}
QString DependenciesPanelFactory::displayName() const
......@@ -277,7 +258,7 @@ bool DependenciesPanelFactory::supports(Project *project)
PropertiesPanel *DependenciesPanelFactory::createPanel(Project *project)
{
PropertiesPanel *panel = new PropertiesPanel;
panel->setWidget(new DependenciesWidget(m_session, project));
panel->setWidget(new DependenciesWidget(project));
panel->setIcon(QIcon(QLatin1String(":/projectexplorer/images/ProjectDependencies.png")));
panel->setDisplayName(QCoreApplication::translate("DependenciesPanel", "Dependencies"));
return panel;
......
......@@ -36,33 +36,24 @@
#include <QTreeView>
namespace Utils {
class DetailsWidget;
}
namespace Utils { class DetailsWidget; }
namespace ProjectExplorer {
class Project;
class SessionManager;
namespace Internal {
const char DEPENDENCIES_PANEL_ID[] = "ProjectExplorer.DependenciesPanel";
class DependenciesWidget;
class DependenciesPanelFactory : public IProjectPanelFactory
{
public:
DependenciesPanelFactory(SessionManager *session);
DependenciesPanelFactory() {}
QString id() const;
QString displayName() const;
int priority() const;
bool supports(Project *project);
PropertiesPanel *createPanel(Project *project);
private:
SessionManager *m_session;
};
......@@ -73,9 +64,9 @@ private:
class DependenciesModel : public QAbstractListModel
{
Q_OBJECT
public:
DependenciesModel(SessionManager *session, Project *project, QObject *parent = 0);
~DependenciesModel();
explicit DependenciesModel(Project *project, QObject *parent = 0);
int rowCount(const QModelIndex &index) const;
int columnCount(const QModelIndex &index) const;
......@@ -87,7 +78,6 @@ public slots:
void resetModel();
private:
SessionManager *m_session;
Project *m_project;
QList<Project *> m_projects;
};
......@@ -95,13 +85,16 @@ private:
class DependenciesView : public QTreeView
{
Q_OBJECT
public:
DependenciesView(QWidget *parent);
~DependenciesView();
virtual QSize sizeHint() const;
virtual void setModel(QAbstractItemModel *model);
QSize sizeHint() const;
void setModel(QAbstractItemModel *model);
private slots:
void updateSizeHint();
private:
QSize m_sizeHint;
};
......@@ -109,11 +102,11 @@ private:
class DependenciesWidget : public QWidget
{
Q_OBJECT
public:
DependenciesWidget(SessionManager *session, Project *project,
QWidget *parent = 0);
explicit DependenciesWidget(Project *project, QWidget *parent = 0);
private:
SessionManager *m_session;
Project *m_project;
DependenciesModel *m_model;
Utils::DetailsWidget *m_detailsContainer;
......
......@@ -209,16 +209,17 @@ int ListWidget::padding()
////////
// ProjectListWidget
////////
ProjectListWidget::ProjectListWidget(SessionManager *sessionManager, QWidget *parent)
: ListWidget(parent), m_sessionManager(sessionManager), m_ignoreIndexChange(false)
ProjectListWidget::ProjectListWidget(QWidget *parent)
: ListWidget(parent), m_ignoreIndexChange(false)
{
connect(m_sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
QObject *sessionManager = SessionManager::instance();
connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
this, SLOT(addProject(ProjectExplorer::Project*)));
connect(m_sessionManager, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
this, SLOT(removeProject(ProjectExplorer::Project*)));
connect(m_sessionManager, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
this, SLOT(changeStartupProject(ProjectExplorer::Project*)));
connect(m_sessionManager, SIGNAL(projectDisplayNameChanged(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectDisplayNameChanged(ProjectExplorer::Project*)),
this, SLOT(projectDisplayNameChanged(ProjectExplorer::Project*)));
connect(this, SIGNAL(currentRowChanged(int)),
this, SLOT(setProject(int)));
......@@ -363,7 +364,7 @@ void ProjectListWidget::setProject(int index)
if (index < 0)
return;
Project *p = item(index)->data(Qt::UserRole).value<Project *>();
m_sessionManager->setStartupProject(p);
SessionManager::setStartupProject(p);
}
void ProjectListWidget::changeStartupProject(Project *project)
......@@ -539,8 +540,8 @@ QWidget *MiniProjectTargetSelector::createTitleLabel(const QString &text)
return bar;
}
MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorAction, SessionManager *sessionManager, QWidget *parent) :
QWidget(parent), m_projectAction(targetSelectorAction), m_sessionManager(sessionManager),
MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorAction, QWidget *parent) :
QWidget(parent), m_projectAction(targetSelectorAction),
m_project(0),
m_target(0),
m_buildConfiguration(0),
......@@ -570,7 +571,7 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
m_listWidgets[PROJECT] = 0; //project is not a generic list widget
m_titleWidgets[PROJECT] = createTitleLabel(tr("Project"));
m_projectListWidget = new ProjectListWidget(m_sessionManager, this);
m_projectListWidget = new ProjectListWidget(this);
QStringList titles;
titles << tr("Kit") << tr("Build")
......@@ -581,21 +582,23 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
m_listWidgets[i] = new GenericListWidget(this);
}
changeStartupProject(m_sessionManager->startupProject());
if (m_sessionManager->startupProject())
activeTargetChanged(m_sessionManager->startupProject()->activeTarget());
Project *startup = SessionManager::startupProject();
changeStartupProject(startup);
if (startup)
activeTargetChanged(startup->activeTarget());
connect(m_summaryLabel, SIGNAL(linkActivated(QString)),
this, SLOT(switchToProjectsMode()));
connect(m_sessionManager, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
QObject *sessionManager = SessionManager::instance();
connect(sessionManager, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
this, SLOT(changeStartupProject(ProjectExplorer::Project*)));
connect(m_sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
this, SLOT(projectAdded(ProjectExplorer::Project*)));
connect(m_sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(projectRemoved(ProjectExplorer::Project*)));
connect(m_sessionManager, SIGNAL(projectDisplayNameChanged(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectDisplayNameChanged(ProjectExplorer::Project*)),
this, SLOT(updateActionAndSummary()));
// for icon changes:
......@@ -760,7 +763,7 @@ void MiniProjectTargetSelector::doLayout(bool keepSize)
onlySummary = true;
} else {
if (visibleLineCount < 3) {
foreach (Project *p, m_sessionManager->projects()) {
foreach (Project *p, SessionManager::projects()) {
if (p->needsConfiguration()) {
visibleLineCount = 3;
break;
......@@ -1063,10 +1066,11 @@ void MiniProjectTargetSelector::slotRemovedRunConfiguration(ProjectExplorer::Run
void MiniProjectTargetSelector::updateProjectListVisible()
{
bool visible = m_sessionManager->projects().size() > 1;
int count = SessionManager::projects().size();
bool visible = count > 1;
m_projectListWidget->setVisible(visible);
m_projectListWidget->setMaxCount(m_sessionManager->projects().size());
m_projectListWidget->setMaxCount(count);
m_titleWidgets[PROJECT]->setVisible(visible);
updateSummary();
......@@ -1075,7 +1079,7 @@ void MiniProjectTargetSelector::updateProjectListVisible()
void MiniProjectTargetSelector::updateTargetListVisible()
{
int maxCount = 0;
foreach (Project *p, m_sessionManager->projects())
foreach (Project *p, SessionManager::projects())
maxCount = qMax(p->targets().size(), maxCount);
bool visible = maxCount > 1;
......@@ -1088,7 +1092,7 @@ void MiniProjectTargetSelector::updateTargetListVisible()
void MiniProjectTargetSelector::updateBuildListVisible()
{
int maxCount = 0;
foreach (Project *p, m_sessionManager->projects())
foreach (Project *p, SessionManager::projects())
foreach (Target *t, p->targets())
maxCount = qMax(t->buildConfigurations().size(), maxCount);
......@@ -1102,7 +1106,7 @@ void MiniProjectTargetSelector::updateBuildListVisible()
void MiniProjectTargetSelector::updateDeployListVisible()
{
int maxCount = 0;
foreach (Project *p, m_sessionManager->projects())
foreach (Project *p, SessionManager::projects())
foreach (Target *t, p->targets())
maxCount = qMax(t->deployConfigurations().size(), maxCount);
......@@ -1116,7 +1120,7 @@ void MiniProjectTargetSelector::updateDeployListVisible()
void MiniProjectTargetSelector::updateRunListVisible()
{
int maxCount = 0;
foreach (Project *p, m_sessionManager->projects())
foreach (Project *p, SessionManager::projects())
foreach (Target *t, p->targets())
maxCount = qMax(t->runConfigurations().size(), maxCount);
......@@ -1444,10 +1448,10 @@ void MiniProjectTargetSelector::updateActionAndSummary()
void MiniProjectTargetSelector::updateSummary()
{
QString summary;
if (Project *startupProject = m_sessionManager->startupProject()) {
if (Project *startupProject = SessionManager::startupProject()) {
if (!m_projectListWidget->isVisibleTo(this))
summary.append(tr("Project: <b>%1</b><br/>").arg(startupProject->displayName()));
if (Target *activeTarget = m_sessionManager->startupProject()->activeTarget()) {
if (Target *activeTarget = startupProject->activeTarget()) {
if (!m_listWidgets[TARGET]->isVisibleTo(this))
summary.append(tr("Kit: <b>%1</b><br/>").arg( activeTarget->displayName()));
if (!m_listWidgets[BUILD]->isVisibleTo(this) && activeTarget->activeBuildConfiguration())
......
......@@ -47,7 +47,6 @@ class BuildConfiguration;
class DeployConfiguration;
class ProjectConfiguration;
class RunConfiguration;
class SessionManager;
namespace Internal {
......@@ -75,7 +74,7 @@ class ProjectListWidget : public ListWidget
{
Q_OBJECT
public:
explicit ProjectListWidget(SessionManager *sessionManager, QWidget *parent = 0);
explicit ProjectListWidget(QWidget *parent = 0);
private slots:
void addProject(ProjectExplorer::Project *project);
void removeProject(ProjectExplorer::Project *project);
......@@ -85,7 +84,6 @@ private slots:
private:
QListWidgetItem *itemForProject(Project *project);
QString fullName(ProjectExplorer::Project *project);
SessionManager *m_sessionManager;
bool m_ignoreIndexChange;
};
......@@ -114,7 +112,7 @@ class MiniProjectTargetSelector : public QWidget
{
Q_OBJECT
public:
explicit MiniProjectTargetSelector(QAction *projectAction, SessionManager *sessionManager, QWidget *parent = 0);
explicit MiniProjectTargetSelector(QAction *projectAction, QWidget *parent = 0);
void setVisible(bool visible);
void keyPressEvent(QKeyEvent *ke);
......@@ -175,7 +173,6 @@ private:
QWidget *createTitleLabel(const QString &text);
QAction *m_projectAction;
SessionManager *m_sessionManager;
enum TYPES { PROJECT = 0, TARGET = 1, BUILD = 2, DEPLOY = 3, RUN = 4, LAST = 5 };
ProjectListWidget *m_projectListWidget;
......
......@@ -209,7 +209,6 @@ struct ProjectExplorerPluginPrivate {
QAction *m_runSubProject;
Internal::ProjectWindow *m_proWindow;
SessionManager *m_session;
QString m_sessionToRestoreAtStartup;
Project *m_currentProject;
......@@ -358,27 +357,27 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(DocumentManager::instance(), SIGNAL(currentFileChanged(QString)),
this, SLOT(setCurrentFile(QString)));
d->m_session = new SessionManager(this);
QObject *sessionManager = new SessionManager(this);
connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
this, SIGNAL(fileListChanged()));
connect(d->m_session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project*)),
this, SLOT(invalidateProject(ProjectExplorer::Project*)));
connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SIGNAL(fileListChanged()));
connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)),
this, SLOT(projectAdded(ProjectExplorer::Project*)));
connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(projectRemoved(ProjectExplorer::Project*)));
connect(d->m_session, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
this, SLOT(startupProjectChanged()));
connect(d->m_session, SIGNAL(projectDisplayNameChanged(ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(projectDisplayNameChanged(ProjectExplorer::Project*)),
this, SLOT(projectDisplayNameChanged(ProjectExplorer::Project*)));
connect(d->m_session, SIGNAL(dependencyChanged(ProjectExplorer::Project*,ProjectExplorer::Project*)),
connect(sessionManager, SIGNAL(dependencyChanged(ProjectExplorer::Project*,ProjectExplorer::Project*)),
this, SLOT(updateActions()));
connect(d->m_session, SIGNAL(sessionLoaded(QString)),
connect(sessionManager, SIGNAL(sessionLoaded(QString)),
this, SLOT(updateActions()));
connect(d->m_session, SIGNAL(sessionLoaded(QString)),
connect(sessionManager, SIGNAL(sessionLoaded(QString)),
this, SLOT(updateWelcomePage()));
d->m_proWindow = new ProjectWindow;
......@@ -400,7 +399,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_outputPane = new AppOutputPane;
addAutoReleasedObject(d->m_outputPane);
connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project*)),
connect(SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)),
d->m_outputPane, SLOT(projectRemoved()));
connect(d->m_outputPane, SIGNAL(runControlStarted(ProjectExplorer::RunControl*)),
......@@ -415,7 +414,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
addAutoReleasedObject(new RunSettingsPanelFactory);
addAutoReleasedObject(new EditorSettingsPanelFactory);
addAutoReleasedObject(new CodeStyleSettingsPanelFactory);
addAutoReleasedObject(new DependenciesPanelFactory(d->m_session));
addAutoReleasedObject(new DependenciesPanelFactory);
addAutoReleasedObject(new ProcessStepFactory);
......@@ -861,7 +860,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_projectSelectorAction->setCheckable(true);
d->m_projectSelectorAction->setEnabled(false);
QWidget *mainWindow = ICore::mainWindow();
d->m_targetSelector = new Internal::MiniProjectTargetSelector(d->m_projectSelectorAction, d->m_session, mainWindow);
d->m_targetSelector = new Internal::MiniProjectTargetSelector(d->m_projectSelectorAction, mainWindow);
connect(d->m_projectSelectorAction, SIGNAL(triggered()), d->m_targetSelector, SLOT(show()));
ModeManager::addProjectSelector(d->m_projectSelectorAction);
......@@ -1073,7 +1072,7 @@ void ProjectExplorerPlugin::unloadProject()
void ProjectExplorerPlugin::unloadProject(Project *project)
{
d->m_session->removeProject(project);
SessionManager::removeProject(project);
updateActions();
}
......@@ -1085,7 +1084,7 @@ void ProjectExplorerPlugin::closeAllProjects()
if (!EditorManager::closeAllEditors())
return; // Action has been cancelled
d->m_session->closeAllProjects();
SessionManager::closeAllProjects();
updateActions();
ModeManager::activateMode(Core::Constants::MODE_WELCOME);
......@@ -1175,7 +1174,7 @@ void ProjectExplorerPlugin::updateRunWithoutDeployMenu()
ExtensionSystem::IPlugin::ShutdownFlag ProjectExplorerPlugin::aboutToShutdown()
{
d->m_proWindow->aboutToShutdown(); // disconnect from session
d->m_session->closeAllProjects();
SessionManager::closeAllProjects();
d->m_projectsMode = 0;
d->m_shuttingDown = true;
// Attempt to synchronously shutdown all run controls.
......@@ -1203,12 +1202,12 @@ void ProjectExplorerPlugin::showSessionManager()
if (debug)
qDebug() << "ProjectExplorerPlugin::showSessionManager";
if (d->m_session->isDefaultVirgin()) {
if (SessionManager::isDefaultVirgin()) {
// do not save new virgin default sessions
} else {
d->m_session->save();
SessionManager::save();
}
SessionDialog sessionDialog(d->m_session, ICore::mainWindow());
SessionDialog sessionDialog(ICore::mainWindow());
sessionDialog.setAutoLoadSession(d->m_projectExplorerSettings.autorestoreLastSession);
sessionDialog.exec();
d->m_projectExplorerSettings.autorestoreLastSession = sessionDialog.autoLoadSession();
......@@ -1227,13 +1226,13 @@ void ProjectExplorerPlugin::setStartupProject(Project *project)
if (!project)
return;
d->m_session->setStartupProject(project);
SessionManager::setStartupProject(project);
updateActions();
}
void ProjectExplorerPlugin::publishProject()
{
const Project * const project = d->m_session->startupProject();
const Project * const project = SessionManager::startupProject();
QTC_ASSERT(project, return);
PublishingWizardSelectionDialog selectionDialog(project);
if (selectionDialog.exec() == QDialog::Accepted) {
......@@ -1252,19 +1251,19 @@ void ProjectExplorerPlugin::savePersistentSettings()
if (d->m_shuttingDown)
return;
if (!d->m_session->loadingSession()) {
foreach (Project *pro, d->m_session->projects())
if (!SessionManager::loadingSession()) {
foreach (Project *pro, SessionManager::projects())
pro->saveSettings();
if (d->m_session->isDefaultVirgin()) {
if (SessionManager::isDefaultVirgin()) {
// do not save new virgin default sessions
} else {
d->m_session->save();
SessionManager::save();
}
}
QSettings *s = ICore::settings();
s->setValue(QLatin1String("ProjectExplorer/StartupSession"), d->m_session->activeSession());
s->setValue(QLatin1String("ProjectExplorer/StartupSession"), SessionManager::activeSession());
s->remove(QLatin1String("ProjectExplorer/RecentProjects/Files"));
QStringList fileNames;
......@@ -1311,7 +1310,7 @@ Project *ProjectExplorerPlugin::openProject(const QString &fileName, QString *er
QList<Project *> list = openProjects(QStringList() << fileName, errorString);
if (!list.isEmpty()) {
addToRecentProjects(fileName, list.first()->displayName());
d->m_session->setStartupProject(list.first());
SessionManager::setStartupProject(list.first());
return list.first();
}
return 0;
......@@ -1355,7 +1354,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
if (found) {
appendError(errorString, tr("Failed opening project '%1': Project already open")
.arg(QDir::toNativeSeparators(fileName)));
d->m_session->reportProjectLoadingProgress();
SessionManager::reportProjectLoadingProgress();
continue;
}
......@@ -1366,7 +1365,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
if (Project *pro = manager->openProject(canonicalFilePath, &tmp)) {
if (pro->restoreSettings()) {
connect(pro, SIGNAL(fileListChanged()), this, SIGNAL(fileListChanged()));
d->m_session->addProject(pro);
SessionManager::addProject(pro);
// Make sure we always have a current project / node
if (!d->m_currentProject && !openedPro.isEmpty())
setCurrentNode(pro->rootProjectNode());
......@@ -1381,7 +1380,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName
}
}
}
d->m_session->reportProjectLoadingProgress();
SessionManager::reportProjectLoadingProgress();