Commit 1ba91e30 authored by hjk's avatar hjk

ProjectExplorer: Apply static pattern to ProjectExplorerPlugin

Adjust caller sites and surroundings.

Change-Id: I6c3c80e42f35eabedc1f89c8c42cca1025aca12f
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent d066e3ca
...@@ -85,7 +85,7 @@ void CMakeEditor::finalizeInitialization() ...@@ -85,7 +85,7 @@ void CMakeEditor::finalizeInitialization()
foreach (Project *p, SessionManager::projects()) { foreach (Project *p, SessionManager::projects()) {
if (CMakeProject *cmakeProject = qobject_cast<CMakeProject *>(p)) { if (CMakeProject *cmakeProject = qobject_cast<CMakeProject *>(p)) {
if (cmakeProject->isProjectFile(document->filePath())) { if (cmakeProject->isProjectFile(document->filePath())) {
ProjectExplorerPlugin::instance()->buildProject(cmakeProject); ProjectExplorerPlugin::buildProject(cmakeProject);
break; break;
} }
} }
......
...@@ -118,7 +118,7 @@ void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection) const ...@@ -118,7 +118,7 @@ void CMakeLocatorFilter::accept(Core::LocatorFilterEntry selection) const
makeStep->setBuildTarget(selection.displayName, true); makeStep->setBuildTarget(selection.displayName, true);
// Build // Build
ProjectExplorer::ProjectExplorerPlugin::instance()->buildProject(cmakeProject); ProjectExplorerPlugin::buildProject(cmakeProject);
makeStep->setBuildTargets(oldTargets); makeStep->setBuildTargets(oldTargets);
} }
......
...@@ -852,7 +852,7 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog() ...@@ -852,7 +852,7 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
void CMakeBuildSettingsWidget::runCMake() void CMakeBuildSettingsWidget::runCMake()
{ {
if (!ProjectExplorer::ProjectExplorerPlugin::instance()->saveModifiedFiles()) if (!ProjectExplorer::ProjectExplorerPlugin::saveModifiedFiles())
return; return;
CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project()); CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
CMakeBuildInfo info(m_buildConfiguration); CMakeBuildInfo info(m_buildConfiguration);
......
...@@ -94,7 +94,7 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project) ...@@ -94,7 +94,7 @@ void CMakeManager::runCMake(ProjectExplorer::Project *project)
if (!cmakeProject || !cmakeProject->activeTarget() || !cmakeProject->activeTarget()->activeBuildConfiguration()) if (!cmakeProject || !cmakeProject->activeTarget() || !cmakeProject->activeTarget()->activeBuildConfiguration())
return; return;
if (!ProjectExplorer::ProjectExplorerPlugin::instance()->saveModifiedFiles()) if (!ProjectExplorer::ProjectExplorerPlugin::saveModifiedFiles())
return; return;
CMakeBuildConfiguration *bc CMakeBuildConfiguration *bc
......
...@@ -117,15 +117,14 @@ public: ...@@ -117,15 +117,14 @@ public:
class ExampleProjectConfigurator class ExampleProjectConfigurator
{ {
public: public:
ExampleProjectConfigurator(const QString &projectFile, ExampleProjectConfigurator(const QString &projectFile)
ProjectExplorerPlugin *projectExplorer)
{ {
const QString projectUserFile = projectFile + _(".user"); const QString projectUserFile = projectFile + _(".user");
QVERIFY(!QFileInfo(projectUserFile).exists()); QVERIFY(!QFileInfo(projectUserFile).exists());
// Open project // Open project
QString errorOpeningProject; QString errorOpeningProject;
m_project = projectExplorer->openProject(projectFile, &errorOpeningProject); m_project = ProjectExplorerPlugin::openProject(projectFile, &errorOpeningProject);
QVERIFY(m_project); QVERIFY(m_project);
QVERIFY(errorOpeningProject.isEmpty()); QVERIFY(errorOpeningProject.isEmpty());
...@@ -671,8 +670,7 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles() ...@@ -671,8 +670,7 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles()
const QString projectFile = testDataDirectory.file(_("testdata_guiproject1.pro")); const QString projectFile = testDataDirectory.file(_("testdata_guiproject1.pro"));
// Open project with *.ui file // Open project with *.ui file
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance(); ExampleProjectConfigurator exampleProjectConfigurator(projectFile);
ExampleProjectConfigurator exampleProjectConfigurator(projectFile, pe);
Project *project = exampleProjectConfigurator.project(); Project *project = exampleProjectConfigurator.project();
// Check working copy. // Check working copy.
......
...@@ -1540,20 +1540,17 @@ void DebuggerPluginPrivate::languagesChanged() ...@@ -1540,20 +1540,17 @@ void DebuggerPluginPrivate::languagesChanged()
void DebuggerPluginPrivate::debugProject() void DebuggerPluginPrivate::debugProject()
{ {
if (Project *pro = SessionManager::startupProject()) ProjectExplorerPlugin::runProject(SessionManager::startupProject(), DebugRunMode);
ProjectExplorerPlugin::instance()->runProject(pro, DebugRunMode);
} }
void DebuggerPluginPrivate::debugProjectWithoutDeploy() void DebuggerPluginPrivate::debugProjectWithoutDeploy()
{ {
if (Project *pro = SessionManager::startupProject()) ProjectExplorerPlugin::runProject(SessionManager::startupProject(), DebugRunMode, true);
ProjectExplorerPlugin::instance()->runProject(pro, DebugRunMode, true);
} }
void DebuggerPluginPrivate::debugProjectBreakMain() void DebuggerPluginPrivate::debugProjectBreakMain()
{ {
if (Project *pro = SessionManager::startupProject()) ProjectExplorerPlugin::runProject(SessionManager::startupProject(), DebugRunModeWithBreakOnMain);
ProjectExplorerPlugin::instance()->runProject(pro, DebugRunModeWithBreakOnMain);
} }
void DebuggerPluginPrivate::startAndDebugApplication() void DebuggerPluginPrivate::startAndDebugApplication()
...@@ -3527,13 +3524,12 @@ void DebuggerPlugin::extensionsInitialized() ...@@ -3527,13 +3524,12 @@ void DebuggerPlugin::extensionsInitialized()
void DebuggerPluginPrivate::testLoadProject(const QString &proFile, const TestCallBack &cb) void DebuggerPluginPrivate::testLoadProject(const QString &proFile, const TestCallBack &cb)
{ {
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance(); connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::currentProjectChanged,
connect(pe, SIGNAL(currentProjectChanged(ProjectExplorer::Project*)), this, &DebuggerPluginPrivate::testProjectLoaded);
this, SLOT(testProjectLoaded(ProjectExplorer::Project*)));
m_testCallbacks.append(cb); m_testCallbacks.append(cb);
QString error; QString error;
if (pe->openProject(proFile, &error)) { if (ProjectExplorerPlugin::openProject(proFile, &error)) {
// Will end up in callback below due to the connections to // Will end up in callback below due to the connections to
// signal currentProjectChanged(). // signal currentProjectChanged().
return; return;
...@@ -3563,7 +3559,7 @@ void DebuggerPluginPrivate::testProjectEvaluated() ...@@ -3563,7 +3559,7 @@ void DebuggerPluginPrivate::testProjectEvaluated()
qWarning("Project %s loaded", qPrintable(fileName)); qWarning("Project %s loaded", qPrintable(fileName));
connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)), connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)),
SLOT(testProjectBuilt(bool))); SLOT(testProjectBuilt(bool)));
ProjectExplorerPlugin::instance()->buildProject(m_testProject); ProjectExplorerPlugin::buildProject(m_testProject);
} }
void DebuggerPluginPrivate::testProjectBuilt(bool success) void DebuggerPluginPrivate::testProjectBuilt(bool success)
......
...@@ -457,11 +457,11 @@ DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun(const Debugg ...@@ -457,11 +457,11 @@ DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun(const Debugg
QString errorMessage; QString errorMessage;
DebuggerRunControl *rc = doCreate(sp, 0, &errorMessage); DebuggerRunControl *rc = doCreate(sp, 0, &errorMessage);
if (!rc) { if (!rc) {
ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage); ProjectExplorerPlugin::showRunErrorMessage(errorMessage);
return 0; return 0;
} }
debuggerCore()->showMessage(sp.startMessage, 0); debuggerCore()->showMessage(sp.startMessage, 0);
ProjectExplorerPlugin::instance()->startRunControl(rc, DebugRunMode); ProjectExplorerPlugin::startRunControl(rc, DebugRunMode);
return rc; return rc;
} }
......
...@@ -54,9 +54,6 @@ namespace { ...@@ -54,9 +54,6 @@ namespace {
class ProjectExplorerHelper class ProjectExplorerHelper
{ {
public: public:
static ProjectExplorerPlugin *getInstance()
{ return ProjectExplorerPlugin::instance(); }
ProjectExplorerHelper() ProjectExplorerHelper()
{ {
QVERIFY(!SessionManager::hasProjects()); QVERIFY(!SessionManager::hasProjects());
...@@ -65,13 +62,13 @@ public: ...@@ -65,13 +62,13 @@ public:
~ProjectExplorerHelper() ~ProjectExplorerHelper()
{ {
foreach (Project *project, m_openProjects) foreach (Project *project, m_openProjects)
getInstance()->unloadProject(project); ProjectExplorerPlugin::unloadProject(project);
} }
Project *openProject(const QString &projectFile) Project *openProject(const QString &projectFile)
{ {
QString error; QString error;
Project *project = getInstance()->openProject(projectFile, &error); Project *project = ProjectExplorerPlugin::openProject(projectFile, &error);
if (!error.isEmpty()) if (!error.isEmpty())
qWarning() << error; qWarning() << error;
if (!project) if (!project)
......
...@@ -39,7 +39,7 @@ CoreListener::CoreListener() ...@@ -39,7 +39,7 @@ CoreListener::CoreListener()
bool CoreListener::coreAboutToClose() bool CoreListener::coreAboutToClose()
{ {
return ProjectExplorerPlugin::instance()->coreAboutToClose(); return ProjectExplorerPlugin::coreAboutToClose();
} }
} }
......
...@@ -524,7 +524,7 @@ bool CustomProjectWizard::postGenerateOpen(const Core::GeneratedFiles &l, QStrin ...@@ -524,7 +524,7 @@ bool CustomProjectWizard::postGenerateOpen(const Core::GeneratedFiles &l, QStrin
// Post-Generate: Open the project and the editors as desired // Post-Generate: Open the project and the editors as desired
foreach (const Core::GeneratedFile &file, l) { foreach (const Core::GeneratedFile &file, l) {
if (file.attributes() & Core::GeneratedFile::OpenProjectAttribute) { if (file.attributes() & Core::GeneratedFile::OpenProjectAttribute) {
if (!ProjectExplorerPlugin::instance()->openProject(file.path(), errorMessage)) if (!ProjectExplorerPlugin::openProject(file.path(), errorMessage))
return false; return false;
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QPoint; class QPoint;
class QMenu;
class QAction; class QAction;
QT_END_NAMESPACE QT_END_NAMESPACE
...@@ -54,14 +53,10 @@ class RunConfiguration; ...@@ -54,14 +53,10 @@ class RunConfiguration;
class IRunControlFactory; class IRunControlFactory;
class Project; class Project;
class Node; class Node;
class BuildConfiguration;
class FolderNode; class FolderNode;
class TaskHub;
namespace Internal { class ProjectExplorerSettings; } namespace Internal { class ProjectExplorerSettings; }
struct ProjectExplorerPluginPrivate;
class PROJECTEXPLORER_EXPORT ProjectExplorerPlugin class PROJECTEXPLORER_EXPORT ProjectExplorerPlugin
: public ExtensionSystem::IPlugin : public ExtensionSystem::IPlugin
{ {
...@@ -74,20 +69,20 @@ public: ...@@ -74,20 +69,20 @@ public:
static ProjectExplorerPlugin *instance(); static ProjectExplorerPlugin *instance();
Project *openProject(const QString &fileName, QString *error); static Project *openProject(const QString &fileName, QString *error);
QList<Project *> openProjects(const QStringList &fileNames, QString *error); static QList<Project *> openProjects(const QStringList &fileNames, QString *error);
Q_SLOT void openProjectWelcomePage(const QString &fileName); Q_SLOT void openProjectWelcomePage(const QString &fileName);
void unloadProject(Project *project); static void unloadProject(Project *project);
static Project *currentProject(); static Project *currentProject();
Node *currentNode() const; static Node *currentNode();
void setCurrentFile(Project *project, const QString &file); static void setCurrentFile(Project *project, const QString &file);
void setCurrentNode(Node *node); static void setCurrentNode(Node *node);
bool saveModifiedFiles(); static bool saveModifiedFiles();
void showContextMenu(QWidget *view, const QPoint &globalPos, Node *node); static void showContextMenu(QWidget *view, const QPoint &globalPos, Node *node);
//PluginInterface //PluginInterface
bool initialize(const QStringList &arguments, QString *errorMessage); bool initialize(const QStringList &arguments, QString *errorMessage);
...@@ -97,34 +92,33 @@ public: ...@@ -97,34 +92,33 @@ public:
static void setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes); static void setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes);
static Internal::ProjectExplorerSettings projectExplorerSettings(); static Internal::ProjectExplorerSettings projectExplorerSettings();
void startRunControl(RunControl *runControl, RunMode runMode); static void startRunControl(RunControl *runControl, RunMode runMode);
static void showRunErrorMessage(const QString &errorMessage); static void showRunErrorMessage(const QString &errorMessage);
// internal public for FlatModel // internal public for FlatModel
void renameFile(Node *node, const QString &to); static void renameFile(Node *node, const QString &to);
static QStringList projectFilePatterns(); static QStringList projectFilePatterns();
bool coreAboutToClose(); static bool coreAboutToClose();
QList<QPair<QString, QString> > recentProjects(); static QList<QPair<QString, QString> > recentProjects();
static bool canRun(Project *pro, RunMode runMode, QString *whyNot = 0); static bool canRun(Project *pro, RunMode runMode, QString *whyNot = 0);
void runProject(Project *pro, RunMode, const bool forceSkipDeploy = false); static void runProject(Project *pro, RunMode, const bool forceSkipDeploy = false);
void runRunConfiguration(ProjectExplorer::RunConfiguration *rc, RunMode runMode, static void runRunConfiguration(RunConfiguration *rc, RunMode runMode,
const bool forceSkipDeploy = false); const bool forceSkipDeploy = false);
void addExistingFiles(ProjectExplorer::FolderNode *projectNode, const QStringList &filePaths); static void addExistingFiles(FolderNode *projectNode, const QStringList &filePaths);
void addExistingFiles(const QStringList &filePaths); static void addExistingFiles(const QStringList &filePaths);
void buildProject(ProjectExplorer::Project *p); static void buildProject(Project *p);
/// Normally there's no need to call this function. /// Normally there's no need to call this function.
/// This function needs to be called, only if the pages that support a project changed. /// This function needs to be called, only if the pages that support a project changed.
void requestProjectModeUpdate(ProjectExplorer::Project *p); static void requestProjectModeUpdate(Project *p);
void initiateInlineRenaming(); static void initiateInlineRenaming();
static QString displayNameForStepId(Core::Id stepId); static QString displayNameForStepId(Core::Id stepId);
static QString directoryFor(Node *node); static QString directoryFor(Node *node);
static QString pathFor(Node *node);
static QStringList projectFileGlobs(); static QStringList projectFileGlobs();
signals: signals:
...@@ -147,7 +141,7 @@ signals: ...@@ -147,7 +141,7 @@ signals:
void updateRunActions(); void updateRunActions();
public slots: public slots:
void openOpenProjectDialog(); static void openOpenProjectDialog();
private slots: private slots:
void buildStateChanged(ProjectExplorer::Project * pro); void buildStateChanged(ProjectExplorer::Project * pro);
...@@ -220,17 +214,15 @@ private slots: ...@@ -220,17 +214,15 @@ private slots:
void activeTargetChanged(); void activeTargetChanged();
void activeRunConfigurationChanged(); void activeRunConfigurationChanged();
void updateDeployActions();
void slotUpdateRunActions(); void slotUpdateRunActions();
void currentModeChanged(Core::IMode *mode, Core::IMode *oldMode); void currentModeChanged(Core::IMode *mode, Core::IMode *oldMode);
void updateActions();
void loadCustomWizards(); void loadCustomWizards();
void updateRunWithoutDeployMenu();
void updateWelcomePage(); void updateWelcomePage();
void updateExternalFileWarning(); void updateExternalFileWarning();
void updateActions();
void updateContext(); void updateContext();
void runConfigurationConfigurationFinished(); void runConfigurationConfigurationFinished();
...@@ -275,27 +267,6 @@ private slots: ...@@ -275,27 +267,6 @@ private slots:
void testCustomWizardPreprocessor_data(); void testCustomWizardPreprocessor_data();
void testCustomWizardPreprocessor(); void testCustomWizardPreprocessor();
#endif #endif
private:
void deploy(QList<Project *>);
int queue(QList<Project *>, QList<Core::Id> stepIds);
void updateContextMenuActions();
bool parseArguments(const QStringList &arguments, QString *error);
void executeRunConfiguration(RunConfiguration *, RunMode mode);
bool hasBuildSettings(Project *pro);
QPair<bool, QString> buildSettingsEnabledForSession();
QPair<bool, QString> buildSettingsEnabled(Project *pro);
bool hasDeploySettings(Project *pro);
void setCurrent(Project *project, QString filePath, Node *node);
QStringList allFilesWithDependencies(Project *pro);
IRunControlFactory *findRunControlFactory(RunConfiguration *config, RunMode mode);
void addToRecentProjects(const QString &fileName, const QString &displayName);
static ProjectExplorerPlugin *m_instance;
ProjectExplorerPluginPrivate *d;
}; };
} // namespace ProjectExplorer } // namespace ProjectExplorer
......
...@@ -348,7 +348,7 @@ bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int rol ...@@ -348,7 +348,7 @@ bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int rol
if (role != Qt::EditRole) if (role != Qt::EditRole)
return false; return false;
ProjectExplorerPlugin::instance()->renameFile(nodeForIndex(index), value.toString()); ProjectExplorerPlugin::renameFile(nodeForIndex(index), value.toString());
return true; return true;
} }
......
...@@ -111,7 +111,6 @@ private: ...@@ -111,7 +111,6 @@ private:
*/ */
ProjectTreeWidget::ProjectTreeWidget(QWidget *parent) ProjectTreeWidget::ProjectTreeWidget(QWidget *parent)
: QWidget(parent), : QWidget(parent),
m_explorer(ProjectExplorerPlugin::instance()),
m_view(0), m_view(0),
m_model(0), m_model(0),
m_filterProjectsAction(0), m_filterProjectsAction(0),
...@@ -282,7 +281,7 @@ void ProjectTreeWidget::recursiveSaveExpandData(const QModelIndex &index, QStrin ...@@ -282,7 +281,7 @@ void ProjectTreeWidget::recursiveSaveExpandData(const QModelIndex &index, QStrin
void ProjectTreeWidget::foldersAboutToBeRemoved(FolderNode *, const QList<FolderNode*> &list) void ProjectTreeWidget::foldersAboutToBeRemoved(FolderNode *, const QList<FolderNode*> &list)
{ {
Node *n = m_explorer->currentNode(); Node *n = ProjectExplorerPlugin::currentNode();
while (n) { while (n) {
if (FolderNode *fn = qobject_cast<FolderNode *>(n)) { if (FolderNode *fn = qobject_cast<FolderNode *>(n)) {
if (list.contains(fn)) { if (list.contains(fn)) {
...@@ -290,7 +289,7 @@ void ProjectTreeWidget::foldersAboutToBeRemoved(FolderNode *, const QList<Folder ...@@ -290,7 +289,7 @@ void ProjectTreeWidget::foldersAboutToBeRemoved(FolderNode *, const QList<Folder
// Make sure the node we are switching too isn't going to be removed also // Make sure the node we are switching too isn't going to be removed also
while (list.contains(pn)) while (list.contains(pn))
pn = pn->parentFolderNode()->projectNode(); pn = pn->parentFolderNode()->projectNode();
m_explorer->setCurrentNode(pn); ProjectExplorerPlugin::setCurrentNode(pn);
break; break;
} }
} }
...@@ -300,9 +299,9 @@ void ProjectTreeWidget::foldersAboutToBeRemoved(FolderNode *, const QList<Folder ...@@ -300,9 +299,9 @@ void ProjectTreeWidget::foldersAboutToBeRemoved(FolderNode *, const QList<Folder
void ProjectTreeWidget::filesAboutToBeRemoved(FolderNode *, const QList<FileNode*> &list) void ProjectTreeWidget::filesAboutToBeRemoved(FolderNode *, const QList<FileNode*> &list)
{ {
if (FileNode *fileNode = qobject_cast<FileNode *>(m_explorer->currentNode())) { if (FileNode *fileNode = qobject_cast<FileNode *>(ProjectExplorerPlugin::currentNode())) {
if (list.contains(fileNode)) if (list.contains(fileNode))
m_explorer->setCurrentNode(fileNode->projectNode()); ProjectExplorerPlugin::setCurrentNode(fileNode->projectNode());
} }
} }
...@@ -332,13 +331,13 @@ void ProjectTreeWidget::setAutoSynchronization(bool sync, bool syncNow) ...@@ -332,13 +331,13 @@ void ProjectTreeWidget::setAutoSynchronization(bool sync, bool syncNow)
if (debug) if (debug)
qDebug() << (m_autoSync ? "Enabling auto synchronization" : "Disabling auto synchronization"); qDebug() << (m_autoSync ? "Enabling auto synchronization" : "Disabling auto synchronization");
if (m_autoSync) { if (m_autoSync) {
connect(m_explorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*,ProjectExplorer::Project*)), connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::currentNodeChanged,
this, SLOT(setCurrentItem(ProjectExplorer::Node*,ProjectExplorer::Project*))); this, &ProjectTreeWidget::setCurrentItem);
if (syncNow) if (syncNow)
setCurrentItem(m_explorer->currentNode(), ProjectExplorerPlugin::currentProject()); setCurrentItem(ProjectExplorerPlugin::currentNode(), ProjectExplorerPlugin::currentProject());
} else { } else {
disconnect(m_explorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*,ProjectExplorer::Project*)), disconnect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::currentNodeChanged,
this, SLOT(setCurrentItem(ProjectExplorer::Node*,ProjectExplorer::Project*))); this, &ProjectTreeWidget::setCurrentItem);
} }
} }
...@@ -383,7 +382,7 @@ void ProjectTreeWidget::handleCurrentItemChange(const QModelIndex &current) ...@@ -383,7 +382,7 @@ void ProjectTreeWidget::handleCurrentItemChange(const QModelIndex &current)
// node might be 0. that's okay // node might be 0. that's okay
bool autoSync = autoSynchronization(); bool autoSync = autoSynchronization();
setAutoSynchronization(false); setAutoSynchronization(false);
m_explorer->setCurrentNode(node); ProjectExplorerPlugin::setCurrentNode(node);
setAutoSynchronization(autoSync, false); setAutoSynchronization(autoSync, false);
} }
...@@ -391,7 +390,7 @@ void ProjectTreeWidget::showContextMenu(const QPoint &pos) ...@@ -391,7 +390,7 @@ void ProjectTreeWidget::showContextMenu(const QPoint &pos)
{ {
QModelIndex index = m_view->indexAt(pos); QModelIndex index = m_view->indexAt(pos);
Node *node = m_model->nodeForIndex(index); Node *node = m_model->nodeForIndex(index);
m_explorer->showContextMenu(this, m_view->mapToGlobal(pos), node); ProjectExplorerPlugin::showContextMenu(this, m_view->mapToGlobal(pos), node);
} }
void ProjectTreeWidget::handleProjectAdded(ProjectExplorer::Project *project) void ProjectTreeWidget::handleProjectAdded(ProjectExplorer::Project *project)
...@@ -427,7 +426,7 @@ void ProjectTreeWidget::initView() ...@@ -427,7 +426,7 @@ void ProjectTreeWidget::initView()
for (int i = 0; i < m_model->rowCount(sessionIndex); ++i) for (int i = 0; i < m_model->rowCount(sessionIndex); ++i)
m_view->expand(m_model->index(i, 0, sessionIndex)); m_view->expand(m_model->index(i, 0, sessionIndex));
setCurrentItem(m_explorer->currentNode(), ProjectExplorerPlugin::currentProject()); setCurrentItem(ProjectExplorerPlugin::currentNode(), ProjectExplorerPlugin::currentProject());
}