diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index d23e0ee8d3d8752a50b3e4b308af773665aef699..4396f78646341f32e94f96c3447db4763611b74a 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -37,6 +37,7 @@ #include <coreplugin/icore.h> #include <coreplugin/uniqueidmanager.h> #include <projectexplorer/projectexplorer.h> +#include <projectexplorer/session.h> #include <texteditor/basetexteditor.h> #include <utils/qtcassert.h> diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 23265bcfc1a88962784cb915de2f77688d37952e..2b7da6fc0d0e21e20318d91281aee2e3b675d5da 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -158,8 +158,7 @@ QString CMakeManager::qtVersionForQMake(const QString &qmakePath) CMakeSettingsPage::CMakeSettingsPage() - : m_process(0), - m_pathchooser(0) + : m_pathchooser(0), m_process(0) { Core::ICore *core = Core::ICore::instance(); QSettings * settings = core->settings(); diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index 56b49d717a84ea1c92faf36260ec50aef4f491da..39b0b07e754460df06a7b9d84c2087c8a9608ba7 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -47,7 +47,7 @@ using namespace CMakeProjectManager; using namespace CMakeProjectManager::Internal; CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory, const QString &title) - : ProjectExplorer::ApplicationRunConfiguration(pro) + : ProjectExplorer::LocalApplicationRunConfiguration(pro) , m_runMode(Gui) , m_target(target) , m_workingDirectory(workingDirectory) @@ -77,7 +77,7 @@ QString CMakeRunConfiguration::executable() const return m_target; } -ProjectExplorer::ApplicationRunConfiguration::RunMode CMakeRunConfiguration::runMode() const +ProjectExplorer::LocalApplicationRunConfiguration::RunMode CMakeRunConfiguration::runMode() const { return m_runMode; } @@ -128,7 +128,7 @@ void CMakeRunConfiguration::setUserWorkingDirectory(const QString &wd) void CMakeRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writer) const { - ProjectExplorer::ApplicationRunConfiguration::save(writer); + ProjectExplorer::LocalApplicationRunConfiguration::save(writer); writer.saveValue("CMakeRunConfiguration.Target", m_target); writer.saveValue("CMakeRunConfiguration.WorkingDirectory", m_workingDirectory); writer.saveValue("CMakeRunConfiguration.UserWorkingDirectory", m_userWorkingDirectory); @@ -142,7 +142,7 @@ void CMakeRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writ void CMakeRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReader &reader) { - ProjectExplorer::ApplicationRunConfiguration::restore(reader); + ProjectExplorer::LocalApplicationRunConfiguration::restore(reader); m_target = reader.restoreValue("CMakeRunConfiguration.Target").toString(); m_workingDirectory = reader.restoreValue("CMakeRunConfiguration.WorkingDirectory").toString(); m_userWorkingDirectory = reader.restoreValue("CMakeRunConfiguration.UserWorkingDirectory").toString(); diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h index c21891ac320d95fc340227f8250ef58ac7271249..ce542f1be8ddfa0c6b0c6fada15b1034d95eafc4 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h @@ -45,7 +45,7 @@ namespace Internal { class CMakeProject; -class CMakeRunConfiguration : public ProjectExplorer::ApplicationRunConfiguration +class CMakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration { friend class CMakeRunConfigurationWidget; Q_OBJECT diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index abe055554c896b8fe95841b37ddb21dbe1895e3c..cb9ffe037a5579dd2859c3bd5ff0383cfb4d0def 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -41,6 +41,8 @@ #include <vcsbase/vcsbaseoutputwindow.h> #include <utils/synchronousprocess.h> #include <utils/parameteraction.h> +#include <projectexplorer/session.h> +#include <projectexplorer/project.h> #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h> diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 6414c4e6e6f40cd834eb59e767d1db7a2cfbfcab..24a0da228009bef2edc88170ea9c924be7856303 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -773,8 +773,8 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess //addAutoReleasedObject(m_debugMode); // register factory of DebuggerRunControl - m_debuggerRunner = new DebuggerRunner(m_manager); - addAutoReleasedObject(m_debuggerRunner); + m_debuggerRunControlFactory = new DebuggerRunControlFactory(m_manager); + addAutoReleasedObject(m_debuggerRunControlFactory); QList<int> context; context.append(uidm->uniqueIdentifier(Core::Constants::C_EDITORMANAGER)); @@ -1231,10 +1231,10 @@ void DebuggerPlugin::startExternalApplication() RunConfigurationPtr rc = activeRunConfiguration(); if (rc.isNull()) - rc = DebuggerRunner::createDefaultRunConfiguration(sp->executable); + rc = DebuggerRunControlFactory::createDefaultRunConfiguration(sp->executable); - if (RunControl *runControl = m_debuggerRunner - ->run(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) + if (RunControl *runControl = m_debuggerRunControlFactory + ->create(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) runControl->start(); } @@ -1257,9 +1257,9 @@ void DebuggerPlugin::attachExternalApplication(qint64 pid, const QString &crashP sp->startMode = crashParameter.isEmpty() ? AttachExternal : AttachCrashedExternal; RunConfigurationPtr rc = activeRunConfiguration(); if (rc.isNull()) - rc = DebuggerRunner::createDefaultRunConfiguration(); - if (RunControl *runControl = m_debuggerRunner - ->run(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) + rc = DebuggerRunControlFactory::createDefaultRunConfiguration(); + if (RunControl *runControl = m_debuggerRunControlFactory + ->create(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) runControl->start(); } @@ -1282,9 +1282,9 @@ void DebuggerPlugin::attachCore() sp->startMode = AttachCore; RunConfigurationPtr rc = activeRunConfiguration(); if (rc.isNull()) - rc = DebuggerRunner::createDefaultRunConfiguration(); - if (RunControl *runControl = m_debuggerRunner - ->run(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) + rc = DebuggerRunControlFactory::createDefaultRunConfiguration(); + if (RunControl *runControl = m_debuggerRunControlFactory + ->create(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) runControl->start(); } @@ -1318,9 +1318,9 @@ void DebuggerPlugin::startRemoteApplication() RunConfigurationPtr rc = activeRunConfiguration(); if (rc.isNull()) - rc = DebuggerRunner::createDefaultRunConfiguration(); - if (RunControl *runControl = m_debuggerRunner - ->run(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) + rc = DebuggerRunControlFactory::createDefaultRunConfiguration(); + if (RunControl *runControl = m_debuggerRunControlFactory + ->create(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) runControl->start(); } @@ -1354,9 +1354,9 @@ void DebuggerPlugin::attachRemoteTcf() RunConfigurationPtr rc = activeRunConfiguration(); if (rc.isNull()) - rc = DebuggerRunner::createDefaultRunConfiguration(); - if (RunControl *runControl = m_debuggerRunner - ->run(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) + rc = DebuggerRunControlFactory::createDefaultRunConfiguration(); + if (RunControl *runControl = m_debuggerRunControlFactory + ->create(rc, ProjectExplorer::Constants::DEBUGMODE, sp)) runControl->start(); } diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index fb0e69b3012f9885c33d70f4fc4138ce2dcf9996..a0777d7f284d7d52313cd8c33f7e837d9934b38c 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -59,7 +59,7 @@ namespace Internal { class BreakpointData; class DebuggerManager; -class DebuggerRunner; +class DebuggerRunControlFactory; class DebugMode; class DisassemblerViewAgent; struct StackFrame; @@ -126,7 +126,7 @@ private: DebuggerManager *m_manager; DebugMode *m_debugMode; - DebuggerRunner *m_debuggerRunner; + DebuggerRunControlFactory *m_debuggerRunControlFactory; QString m_previousMode; TextEditor::BaseTextMark *m_locationMark; diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index f64b54998ba07d30802c0b29b9f7121c5849bab4..dc622cf2e35255816064b35a69c324954920c49f 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -48,61 +48,61 @@ namespace Internal { using ProjectExplorer::RunConfiguration; using ProjectExplorer::RunControl; -using ProjectExplorer::ApplicationRunConfiguration; +using ProjectExplorer::LocalApplicationRunConfiguration; -DefaultApplicationRunConfiguration::DefaultApplicationRunConfiguration(const QString &executable) : - ProjectExplorer::ApplicationRunConfiguration(0), +DefaultLocalApplicationRunConfiguration::DefaultLocalApplicationRunConfiguration(const QString &executable) : + ProjectExplorer::LocalApplicationRunConfiguration(0), m_executable(executable) { } //////////////////////////////////////////////////////////////////////// // -// DebuggerRunner +// DebuggerRunControlFactory // //////////////////////////////////////////////////////////////////////// // A factory to create DebuggerRunControls -DebuggerRunner::DebuggerRunner(DebuggerManager *manager) +DebuggerRunControlFactory::DebuggerRunControlFactory(DebuggerManager *manager) : m_manager(manager) {} -bool DebuggerRunner::canRun(RunConfigurationPtr runConfiguration, const QString &mode) +bool DebuggerRunControlFactory::canRun(const RunConfigurationPtr &runConfiguration, const QString &mode) const { return mode == ProjectExplorer::Constants::DEBUGMODE - && !runConfiguration.objectCast<ApplicationRunConfiguration>().isNull(); + && !runConfiguration.objectCast<LocalApplicationRunConfiguration>().isNull(); } -QString DebuggerRunner::displayName() const +QString DebuggerRunControlFactory::displayName() const { return tr("Debug"); } -RunConfigurationPtr DebuggerRunner::createDefaultRunConfiguration(const QString &executable) +RunConfigurationPtr DebuggerRunControlFactory::createDefaultRunConfiguration(const QString &executable) { - return RunConfigurationPtr(new DefaultApplicationRunConfiguration(executable)); + return RunConfigurationPtr(new DefaultLocalApplicationRunConfiguration(executable)); } -RunControl *DebuggerRunner::run(RunConfigurationPtr runConfiguration, - const QString &mode, - const DebuggerStartParametersPtr &sp) +RunControl *DebuggerRunControlFactory::create(const RunConfigurationPtr &runConfiguration, + const QString &mode, + const DebuggerStartParametersPtr &sp) { QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0); - ApplicationRunConfigurationPtr rc = - runConfiguration.objectCast<ApplicationRunConfiguration>(); + LocalApplicationRunConfigurationPtr rc = + runConfiguration.objectCast<LocalApplicationRunConfiguration>(); QTC_ASSERT(!rc.isNull(), return 0); return new DebuggerRunControl(m_manager, sp, rc); } -RunControl *DebuggerRunner::run(RunConfigurationPtr runConfiguration, - const QString &mode) +RunControl *DebuggerRunControlFactory::create(const RunConfigurationPtr &runConfiguration, + const QString &mode) { const DebuggerStartParametersPtr sp(new DebuggerStartParameters); sp->startMode = StartInternal; - return run(runConfiguration, mode, sp); + return create(runConfiguration, mode, sp); } -QWidget *DebuggerRunner::configurationWidget(RunConfigurationPtr runConfiguration) +QWidget *DebuggerRunControlFactory::configurationWidget(const RunConfigurationPtr &runConfiguration) { // NBS TODO: Add GDB-specific configuration widget Q_UNUSED(runConfiguration) @@ -120,7 +120,7 @@ QWidget *DebuggerRunner::configurationWidget(RunConfigurationPtr runConfiguratio DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager, const DebuggerStartParametersPtr &startParameters, - QSharedPointer<ApplicationRunConfiguration> runConfiguration) + QSharedPointer<LocalApplicationRunConfiguration> runConfiguration) : RunControl(runConfiguration), m_startParameters(startParameters), m_manager(manager), @@ -164,7 +164,7 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager, project->buildDirectory(project->activeBuildConfiguration()); } m_startParameters->useTerminal = - runConfiguration->runMode() == ApplicationRunConfiguration::Console; + runConfiguration->runMode() == LocalApplicationRunConfiguration::Console; m_startParameters->dumperLibrary = runConfiguration->dumperLibrary(); m_startParameters->dumperLibraryLocations = diff --git a/src/plugins/debugger/debuggerrunner.h b/src/plugins/debugger/debuggerrunner.h index 28362044566e6b431ed608a2593082a6d9909e4b..dcb996afe8306f1887cbb0b62a6a30b55325c698 100644 --- a/src/plugins/debugger/debuggerrunner.h +++ b/src/plugins/debugger/debuggerrunner.h @@ -36,7 +36,7 @@ #include <projectexplorer/applicationrunconfiguration.h> namespace ProjectExplorer { -class ApplicationRunConfiguration; +class LocalApplicationRunConfiguration; } namespace Debugger { @@ -48,28 +48,28 @@ class StartData; typedef QSharedPointer<ProjectExplorer::RunConfiguration> RunConfigurationPtr; -typedef QSharedPointer<ProjectExplorer::ApplicationRunConfiguration> - ApplicationRunConfigurationPtr; +typedef QSharedPointer<ProjectExplorer::LocalApplicationRunConfiguration> + LocalApplicationRunConfigurationPtr; -class DebuggerRunner - : public ProjectExplorer::IRunConfigurationRunner +class DebuggerRunControlFactory + : public ProjectExplorer::IRunControlFactory { Q_OBJECT public: - explicit DebuggerRunner(DebuggerManager *manager); + explicit DebuggerRunControlFactory(DebuggerManager *manager); - // ProjectExplorer::IRunConfigurationRunner - bool canRun(RunConfigurationPtr runConfiguration, const QString &mode); - virtual ProjectExplorer::RunControl *run(RunConfigurationPtr runConfiguration, - const QString &mode); + // ProjectExplorer::IRunControlFactory + bool canRun(const RunConfigurationPtr &runConfiguration, const QString &mode) const; + virtual ProjectExplorer::RunControl *create(const RunConfigurationPtr &runConfiguration, + const QString &mode); virtual QString displayName() const; - virtual QWidget *configurationWidget(RunConfigurationPtr runConfiguration); + virtual QWidget *configurationWidget(const RunConfigurationPtr &runConfiguration); - virtual ProjectExplorer::RunControl *run(RunConfigurationPtr runConfiguration, - const QString &mode, - const DebuggerStartParametersPtr &sp); + virtual ProjectExplorer::RunControl *create(const RunConfigurationPtr &runConfiguration, + const QString &mode, + const DebuggerStartParametersPtr &sp); static RunConfigurationPtr createDefaultRunConfiguration(const QString &executable = QString()); @@ -87,7 +87,7 @@ class DebuggerRunControl public: DebuggerRunControl(DebuggerManager *manager, const DebuggerStartParametersPtr &startParamters, - ApplicationRunConfigurationPtr runConfiguration); + LocalApplicationRunConfigurationPtr runConfiguration); // ProjectExplorer::RunControl virtual void start(); @@ -111,12 +111,12 @@ private: // A default run configuration for external executables or attaching to // running processes by id. -class DefaultApplicationRunConfiguration - : public ProjectExplorer::ApplicationRunConfiguration +class DefaultLocalApplicationRunConfiguration + : public ProjectExplorer::LocalApplicationRunConfiguration { Q_OBJECT public: - explicit DefaultApplicationRunConfiguration(const QString &executable = QString()); + explicit DefaultLocalApplicationRunConfiguration(const QString &executable = QString()); virtual QString executable() const { return m_executable; } virtual RunMode runMode() const { return Gui; } diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp index 9e13b7aaa4a213d2ffdbcbb7b75917f44dc2c4c6..1b9f9b3eb473e1777232cb693ef53cfc264aadd3 100644 --- a/src/plugins/designer/formwindoweditor.cpp +++ b/src/plugins/designer/formwindoweditor.cpp @@ -37,6 +37,8 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectnodes.h> #include <projectexplorer/nodesvisitor.h> +#include <projectexplorer/project.h> +#include <projectexplorer/session.h> #include <utils/qtcassert.h> diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 1756a499023571830b7ac0c3ef65b59aa8a1a4b0..4d64437ec39bb33be3e2ebc464ec78ed68779346 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -48,9 +48,13 @@ #include <vcsbase/vcsbaseeditor.h> #include <vcsbase/vcsbaseoutputwindow.h> +#include <projectexplorer/environment.h> + #include <QtCore/QRegExp> #include <QtCore/QTemporaryFile> #include <QtCore/QTime> +#include <QtCore/QFileInfo> +#include <QtCore/QDir> #include <QtGui/QMainWindow> // for msg box parent #include <QtGui/QMessageBox> diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 5997982569ab6ba82be08ec481017658a9171451..9ca3e82c1f1a1fe5dfc86690d3f58dfdd941e831 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -56,6 +56,9 @@ #include <vcsbase/basevcssubmiteditorfactory.h> #include <vcsbase/vcsbaseoutputwindow.h> +#include <projectexplorer/projectexplorer.h> +#include <projectexplorer/project.h> + #include <QtCore/QDebug> #include <QtCore/QDir> #include <QtCore/QFileInfo> @@ -138,7 +141,6 @@ GitPlugin::GitPlugin() : m_stashPopAction(0), m_stashListAction(0), m_branchListAction(0), - m_projectExplorer(0), m_gitClient(0), m_changeSelectionDialog(0), m_submitActionTriggered(false) @@ -418,7 +420,6 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) void GitPlugin::extensionsInitialized() { - m_projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance(); } void GitPlugin::submitEditorDiff(const QStringList &unstaged, const QStringList &staged) @@ -452,9 +453,10 @@ QFileInfo GitPlugin::currentFile() const QString GitPlugin::getWorkingDirectory() { QString workingDirectory; - if (m_projectExplorer && m_projectExplorer->currentNode()) { - workingDirectory = QFileInfo(m_projectExplorer->currentNode()->path()).absolutePath(); - } + if (const ProjectExplorer::ProjectExplorerPlugin *p = ProjectExplorer::ProjectExplorerPlugin::instance()) + if (p && p->currentNode()) + workingDirectory = QFileInfo(p->currentNode()->path()).absolutePath(); + if (Git::Constants::debug > 1) qDebug() << Q_FUNC_INFO << "Project" << workingDirectory; @@ -795,11 +797,10 @@ void GitPlugin::updateActions() // We only know the file is in some repository, we do not know // anything about any project so far. - using namespace ProjectExplorer; QString project; - if (m_projectExplorer) { - if (const Node *node = m_projectExplorer->currentNode()) - if (const Node *projectNode = node->projectNode()) + if (const ProjectExplorer::ProjectExplorerPlugin *p = ProjectExplorer::ProjectExplorerPlugin::instance()) { + if (const ProjectExplorer::Node *node = p->currentNode()) + if (const ProjectExplorer::Node *projectNode = node->projectNode()) project = QFileInfo(projectNode->path()).completeBaseName(); } diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index bc3ed2aa5502e0291554ab023ee53181ba29e695..2970b6f32c09bae62da36fa921d8094a04bc0be3 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -35,7 +35,6 @@ #include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/icorelistener.h> #include <extensionsystem/iplugin.h> -#include <projectexplorer/projectexplorer.h> #include <QtCore/QObject> #include <QtCore/QProcess> @@ -44,6 +43,7 @@ QT_BEGIN_NAMESPACE class QFile; class QAction; +class QFileInfo; QT_END_NAMESPACE namespace Core { @@ -87,8 +87,8 @@ public: static GitPlugin *instance(); - bool initialize(const QStringList &arguments, QString *error_message); - void extensionsInitialized(); + virtual bool initialize(const QStringList &arguments, QString *error_message); + virtual void extensionsInitialized(); QString getWorkingDirectory(); @@ -160,7 +160,6 @@ private: QAction *m_stashListAction; QAction *m_branchListAction; - ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer; GitClient *m_gitClient; ChangeSelectionDialog *m_changeSelectionDialog; QString m_submitRepository; diff --git a/src/plugins/git/settingspage.cpp b/src/plugins/git/settingspage.cpp index 2c932b863b1dbd1faf5dcc2f5b6ecd87192e58a7..9060bdd76201d4032600b9cf066e91294f4587d1 100644 --- a/src/plugins/git/settingspage.cpp +++ b/src/plugins/git/settingspage.cpp @@ -34,6 +34,7 @@ #include <vcsbase/vcsbaseconstants.h> #include <QtCore/QCoreApplication> +#include <QtCore/QFileInfo> #include <QtCore/QDebug> #include <QtGui/QMessageBox> diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 2c12882530e362e3cdcb57894dc08787d535e926..a26ec7d4959ab027d90a6c293e5af0d516c25d76 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -52,6 +52,8 @@ #include <vcsbase/basevcssubmiteditorfactory.h> #include <vcsbase/vcsbaseeditor.h> #include <vcsbase/vcsbaseoutputwindow.h> +#include <projectexplorer/project.h> +#include <projectexplorer/session.h> #include <QtCore/QtPlugin> #include <QtCore/QDebug> diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index 4065b012d320cfc532f3f7b47cade5edff596797..7e1ee9d8da6ee735c518bdaa2dda83ffb59e4f50 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -30,6 +30,7 @@ #include "allprojectsfind.h" #include "project.h" +#include "session.h" #include "projectexplorer.h" #include <utils/qtcassert.h> diff --git a/src/plugins/projectexplorer/applicationrunconfiguration.cpp b/src/plugins/projectexplorer/applicationrunconfiguration.cpp index 8325b7327c2b08fc17f03af8474eebadaa38db93..9199583196b2423dde8018efc44687223224471d 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.cpp +++ b/src/plugins/projectexplorer/applicationrunconfiguration.cpp @@ -42,64 +42,60 @@ using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -/// ApplicationRunConfiguration +/// LocalApplicationRunConfiguration -ApplicationRunConfiguration::ApplicationRunConfiguration(Project *pro) +LocalApplicationRunConfiguration::LocalApplicationRunConfiguration(Project *pro) : RunConfiguration(pro) { } -ApplicationRunConfiguration::~ApplicationRunConfiguration() +LocalApplicationRunConfiguration::~LocalApplicationRunConfiguration() { } -QString ApplicationRunConfiguration::type() const +QString LocalApplicationRunConfiguration::type() const { - return "ProjectExplorer.ApplicationRunConfiguration"; + return "ProjectExplorer.LocalApplicationRunConfiguration"; } -void ApplicationRunConfiguration::save(PersistentSettingsWriter &writer) const +void LocalApplicationRunConfiguration::save(PersistentSettingsWriter &writer) const { RunConfiguration::save(writer); } -void ApplicationRunConfiguration::restore(const PersistentSettingsReader &reader) +void LocalApplicationRunConfiguration::restore(const PersistentSettingsReader &reader) { RunConfiguration::restore(reader); } -/// ApplicationRunConfigurationRunner +/// LocalApplicationRunControlFactory -ApplicationRunConfigurationRunner::ApplicationRunConfigurationRunner() +LocalApplicationRunControlFactory::LocalApplicationRunControlFactory() { } -ApplicationRunConfigurationRunner::~ApplicationRunConfigurationRunner() +LocalApplicationRunControlFactory::~LocalApplicationRunControlFactory() { } -bool ApplicationRunConfigurationRunner::canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) +bool LocalApplicationRunControlFactory::canRun(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) const { return (mode == ProjectExplorer::Constants::RUNMODE) - && (!runConfiguration.objectCast<ApplicationRunConfiguration>().isNull()); + && (!runConfiguration.objectCast<LocalApplicationRunConfiguration>().isNull()); } -QString ApplicationRunConfigurationRunner::displayName() const +QString LocalApplicationRunControlFactory::displayName() const { return tr("Run"); } -RunControl *ApplicationRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) +RunControl *LocalApplicationRunControlFactory::create(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) { - QSharedPointer<ApplicationRunConfiguration> rc = runConfiguration.objectCast<ApplicationRunConfiguration>(); - Q_ASSERT(!rc.isNull()); - Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE); - - ApplicationRunControl *runControl = new ApplicationRunControl(rc); - return runControl; + QTC_ASSERT(canRun(runConfiguration, mode), return 0); + return new LocalApplicationRunControl(runConfiguration.objectCast<LocalApplicationRunConfiguration>()); } -QWidget *ApplicationRunConfigurationRunner::configurationWidget(QSharedPointer<RunConfiguration> runConfiguration) +QWidget *LocalApplicationRunControlFactory::configurationWidget(const QSharedPointer<RunConfiguration> &runConfiguration) { Q_UNUSED(runConfiguration) return new QLabel("TODO add Configuration widget"); @@ -107,7 +103,7 @@ QWidget *ApplicationRunConfigurationRunner::configurationWidget(QSharedPointer<R // ApplicationRunControl -ApplicationRunControl::ApplicationRunControl(QSharedPointer<ApplicationRunConfiguration> runConfiguration) +LocalApplicationRunControl::LocalApplicationRunControl(const QSharedPointer<LocalApplicationRunConfiguration> &runConfiguration) : RunControl(runConfiguration) { connect(&m_applicationLauncher, SIGNAL(applicationError(QString)), @@ -120,13 +116,13 @@ ApplicationRunControl::ApplicationRunControl(QSharedPointer<ApplicationRunConfig this, SLOT(bringApplicationToForeground(qint64))); } -ApplicationRunControl::~ApplicationRunControl() +LocalApplicationRunControl::~LocalApplicationRunControl() { } -void ApplicationRunControl::start() +void LocalApplicationRunControl::start() { - QSharedPointer<ApplicationRunConfiguration> rc = runConfiguration().objectCast<ApplicationRunConfiguration>(); + QSharedPointer<LocalApplicationRunConfiguration> rc = runConfiguration().objectCast<LocalApplicationRunConfiguration>(); Q_ASSERT(!rc.isNull()); m_applicationLauncher.setEnvironment(rc->environment().toStringList()); @@ -141,28 +137,28 @@ void ApplicationRunControl::start() emit addToOutputWindow(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable))); } -void ApplicationRunControl::stop() +void LocalApplicationRunControl::stop() { m_applicationLauncher.stop(); } -bool ApplicationRunControl::isRunning() const +bool LocalApplicationRunControl::isRunning() const { return m_applicationLauncher.isRunning(); } -void ApplicationRunControl::slotError(const QString & err) +void LocalApplicationRunControl::slotError(const QString & err) { emit error(this, err); emit finished(); } -void ApplicationRunControl::slotAddToOutputWindow(const QString &line) +void LocalApplicationRunControl::slotAddToOutputWindow(const QString &line) { emit addToOutputWindowInline(this, line); } -void ApplicationRunControl::processExited(int exitCode) +void LocalApplicationRunControl::processExited(int exitCode) { emit addToOutputWindow(this, tr("%1 exited with code %2").arg(QDir::toNativeSeparators(m_executable)).arg(exitCode)); emit finished(); diff --git a/src/plugins/projectexplorer/applicationrunconfiguration.h b/src/plugins/projectexplorer/applicationrunconfiguration.h index c65885146ab4d7fe8c378109a7b08556094d889d..dfa6134d895fc9b05b998b5bff2c00c85975b10f 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.h +++ b/src/plugins/projectexplorer/applicationrunconfiguration.h @@ -39,7 +39,7 @@ namespace ProjectExplorer { class Environment; -class PROJECTEXPLORER_EXPORT ApplicationRunConfiguration : public RunConfiguration +class PROJECTEXPLORER_EXPORT LocalApplicationRunConfiguration : public RunConfiguration { Q_OBJECT public: @@ -48,8 +48,8 @@ public: Gui }; - ApplicationRunConfiguration(Project *pro); - virtual ~ApplicationRunConfiguration(); + LocalApplicationRunConfiguration(Project *pro); + virtual ~LocalApplicationRunConfiguration(); virtual QString type() const; virtual QString executable() const = 0; virtual RunMode runMode() const = 0; @@ -66,24 +66,24 @@ public: namespace Internal { -class ApplicationRunConfigurationRunner : public IRunConfigurationRunner +class LocalApplicationRunControlFactory : public IRunControlFactory { Q_OBJECT public: - ApplicationRunConfigurationRunner(); - virtual ~ApplicationRunConfigurationRunner(); - virtual bool canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode); + LocalApplicationRunControlFactory (); + virtual ~LocalApplicationRunControlFactory(); + virtual bool canRun(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) const; virtual QString displayName() const; - virtual RunControl* run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode); - virtual QWidget *configurationWidget(QSharedPointer<RunConfiguration> runConfiguration); + virtual RunControl* create(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode); + virtual QWidget *configurationWidget(const QSharedPointer<RunConfiguration> &runConfiguration); }; -class ApplicationRunControl : public RunControl +class LocalApplicationRunControl : public RunControl { Q_OBJECT public: - ApplicationRunControl(QSharedPointer<ApplicationRunConfiguration> runConfiguration); - virtual ~ApplicationRunControl(); + LocalApplicationRunControl(const QSharedPointer<LocalApplicationRunConfiguration> &runConfiguration); + virtual ~LocalApplicationRunControl(); virtual void start(); virtual void stop(); virtual bool isRunning() const; diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 0c832de3b18c5a6c3cc3a63bebcc9afbcfd3c4ae..bd114e87996405994c5bb57360e604b1c1222891 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -34,6 +34,7 @@ #include "compileoutputwindow.h" #include "projectexplorerconstants.h" #include "projectexplorer.h" +#include "projectexplorersettings.h" #include "taskwindow.h" #include <coreplugin/icore.h> diff --git a/src/plugins/projectexplorer/cesdkhandler.cpp b/src/plugins/projectexplorer/cesdkhandler.cpp index d1afa263e78e5463da45ac8136da2debe723f384..9f1a0325211b31090788d47b75236304ac534c89 100644 --- a/src/plugins/projectexplorer/cesdkhandler.cpp +++ b/src/plugins/projectexplorer/cesdkhandler.cpp @@ -28,6 +28,7 @@ **************************************************************************/ #include "cesdkhandler.h" +#include "environment.h" #include <QtCore/QFile> #include <QtCore/QDebug> diff --git a/src/plugins/projectexplorer/cesdkhandler.h b/src/plugins/projectexplorer/cesdkhandler.h index 5f2ec540a66898eb84a96121980716257986d5e4..42ae477746b42a8ecc72a2b0c6191a97d6ed9c2d 100644 --- a/src/plugins/projectexplorer/cesdkhandler.h +++ b/src/plugins/projectexplorer/cesdkhandler.h @@ -39,6 +39,7 @@ #define VSINSTALL_MACRO "$(VSInstallDir)" namespace ProjectExplorer { +class Environment; class PROJECTEXPLORER_EXPORT CeSdkInfo { diff --git a/src/plugins/projectexplorer/corelistenercheckingforrunningbuild.cpp b/src/plugins/projectexplorer/corelistenercheckingforrunningbuild.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f91c31477c6e38c8dd1198e6a0897fd690de8b4e --- /dev/null +++ b/src/plugins/projectexplorer/corelistenercheckingforrunningbuild.cpp @@ -0,0 +1,61 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#include "corelistenercheckingforrunningbuild.h" +#include "buildmanager.h" + +#include <QtGui/QMessageBox> +#include <QtGui/QPushButton> + +namespace ProjectExplorer { +namespace Internal { + +CoreListenerCheckingForRunningBuild::CoreListenerCheckingForRunningBuild(BuildManager *manager) + : Core::ICoreListener(0), m_manager(manager) +{ +} + +bool CoreListenerCheckingForRunningBuild::coreAboutToClose() +{ + if (m_manager->isBuilding()) { + QMessageBox box; + QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Close"), QMessageBox::AcceptRole); + QPushButton *cancelClose = box.addButton(tr("Don't Close"), QMessageBox::RejectRole); + box.setDefaultButton(cancelClose); + box.setWindowTitle(tr("Close Qt Creator?")); + box.setText(tr("A project is currently being built.")); + box.setInformativeText(tr("Do you want to cancel the build process and close Qt Creator anyway?")); + box.exec(); + return (box.clickedButton() == closeAnyway); + } + return true; +} + +} +} diff --git a/src/plugins/projectexplorer/corelistenercheckingforrunningbuild.h b/src/plugins/projectexplorer/corelistenercheckingforrunningbuild.h new file mode 100644 index 0000000000000000000000000000000000000000..fe8deb69ef04a9ea42ce15fdc49a91b94087e49a --- /dev/null +++ b/src/plugins/projectexplorer/corelistenercheckingforrunningbuild.h @@ -0,0 +1,56 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef CORELISTENERCHECKINGFORRUNNINGBUILD_H +#define CORELISTENERCHECKINGFORRUNNINGBUILD_H + +#include <coreplugin/icorelistener.h> + +namespace ProjectExplorer { + +class BuildManager; + +namespace Internal { + +class CoreListenerCheckingForRunningBuild : public Core::ICoreListener +{ + Q_OBJECT +public: + explicit CoreListenerCheckingForRunningBuild(BuildManager *manager); + + bool coreAboutToClose(); + +private: + BuildManager *m_manager; +}; + +} // namespace Internal +} // namespace ProjectExplorer + +#endif // CORELISTENERCHECKINGFORRUNNINGBUILD_H diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index dce894c6ea6c11a8a5cfd33da96a1a06988ab859..ede1f5b5202b2bbffa59c0879bd9d05d5a47b485 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -225,8 +225,8 @@ void CustomExecutableConfigurationWidget::setUserName(const QString &name) void CustomExecutableConfigurationWidget::termToggled(bool on) { m_ignoreChange = true; - m_runConfiguration->setRunMode(on ? ApplicationRunConfiguration::Console - : ApplicationRunConfiguration::Gui); + m_runConfiguration->setRunMode(on ? LocalApplicationRunConfiguration::Console + : LocalApplicationRunConfiguration::Gui); m_ignoreChange = false; } @@ -246,12 +246,12 @@ void CustomExecutableConfigurationWidget::changed() m_executableChooser->setPath(executable); m_commandLineArgumentsLineEdit->setText(ProjectExplorer::Environment::joinArgumentList(m_runConfiguration->commandLineArguments())); m_workingDirectory->setPath(m_runConfiguration->baseWorkingDirectory()); - m_useTerminalCheck->setChecked(m_runConfiguration->runMode() == ApplicationRunConfiguration::Console); + m_useTerminalCheck->setChecked(m_runConfiguration->runMode() == LocalApplicationRunConfiguration::Console); m_userName->setText(m_runConfiguration->userName()); } CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *pro) - : ApplicationRunConfiguration(pro), + : LocalApplicationRunConfiguration(pro), m_runMode(Gui), m_userSetName(false), m_baseEnvironmentBase(CustomExecutableRunConfiguration::BuildEnvironmentBase) @@ -326,7 +326,7 @@ QString CustomExecutableRunConfiguration::executable() const return exec; } -ApplicationRunConfiguration::RunMode CustomExecutableRunConfiguration::runMode() const +LocalApplicationRunConfiguration::RunMode CustomExecutableRunConfiguration::runMode() const { return m_runMode; } @@ -405,7 +405,7 @@ void CustomExecutableRunConfiguration::save(PersistentSettingsWriter &writer) co writer.saveValue("UserName", m_userName); writer.saveValue("UserEnvironmentChanges", ProjectExplorer::EnvironmentItem::toStringList(m_userEnvironmentChanges)); writer.saveValue("BaseEnvironmentBase", m_baseEnvironmentBase); - ApplicationRunConfiguration::save(writer); + LocalApplicationRunConfiguration::save(writer); } void CustomExecutableRunConfiguration::restore(const PersistentSettingsReader &reader) @@ -417,7 +417,7 @@ void CustomExecutableRunConfiguration::restore(const PersistentSettingsReader &r m_userSetName = reader.restoreValue("UserSetName").toBool(); m_userName = reader.restoreValue("UserName").toString(); m_userEnvironmentChanges = ProjectExplorer::EnvironmentItem::fromStringList(reader.restoreValue("UserEnvironmentChanges").toStringList()); - ApplicationRunConfiguration::restore(reader); + LocalApplicationRunConfiguration::restore(reader); QVariant tmp = reader.restoreValue("BaseEnvironmentBase"); m_baseEnvironmentBase = tmp.isValid() ? BaseEnvironmentBase(tmp.toInt()) : CustomExecutableRunConfiguration::BuildEnvironmentBase; } diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.h b/src/plugins/projectexplorer/customexecutablerunconfiguration.h index b7c579fc6c484cdbf31de4d17c4be2236743e9bc..99300a78aba1604fb36680f19ca1d8147fb84e01 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.h +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.h @@ -49,7 +49,7 @@ namespace Internal { class CustomExecutableConfigurationWidget; } -class PROJECTEXPLORER_EXPORT CustomExecutableRunConfiguration : public ApplicationRunConfiguration +class PROJECTEXPLORER_EXPORT CustomExecutableRunConfiguration : public LocalApplicationRunConfiguration { // the configuration widget needs to setExecutable setWorkingDirectory and setCommandLineArguments friend class Internal::CustomExecutableConfigurationWidget; @@ -78,7 +78,7 @@ public: */ QString userName() const; - virtual ApplicationRunConfiguration::RunMode runMode() const; + virtual LocalApplicationRunConfiguration::RunMode runMode() const; virtual QString workingDirectory() const; QString baseWorkingDirectory() const; virtual QStringList commandLineArguments() const; diff --git a/src/plugins/projectexplorer/pluginfilefactory.cpp b/src/plugins/projectexplorer/pluginfilefactory.cpp index de809bdb07e9f53c9cf18177bd5ac6a56328a62a..b135ce6a6faa8a608a0c1ab33e39e5ff149a4b96 100644 --- a/src/plugins/projectexplorer/pluginfilefactory.cpp +++ b/src/plugins/projectexplorer/pluginfilefactory.cpp @@ -29,8 +29,10 @@ #include "pluginfilefactory.h" #include "projectexplorer.h" +#include "project.h" #include "projectexplorerconstants.h" #include "iprojectmanager.h" +#include "session.h" #include <extensionsystem/pluginmanager.h> #include <coreplugin/icore.h> diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 3f798a45999f5eab66e03da312235896c33f9915..df19d838b9df6df15afaf3658381acc1f980e748 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -27,6 +27,8 @@ ** **************************************************************************/ +#include "projectexplorer.h" +#include "projectexplorersettings.h" #include "applicationrunconfiguration.h" #include "allprojectsfilter.h" #include "allprojectsfind.h" @@ -45,7 +47,6 @@ #include "persistentsettings.h" #include "pluginfilefactory.h" #include "processstep.h" -#include "projectexplorer.h" #include "projectexplorerconstants.h" #include "projectfilewizardextension.h" #include "projecttreewidget.h" @@ -59,6 +60,7 @@ #include "projectexplorersettingspage.h" #include "projectwelcomepage.h" #include "projectwelcomepagewidget.h" +#include "corelistenercheckingforrunningbuild.h" #include <coreplugin/basemode.h> #include <coreplugin/coreconstants.h> @@ -103,47 +105,107 @@ namespace { bool debug = false; } +namespace ProjectExplorer { + +struct ProjectExplorerPluginPrivate { + ProjectExplorerPluginPrivate(); + + QMenu *m_sessionContextMenu; + QMenu *m_sessionMenu; + QMenu *m_projectMenu; + QMenu *m_subProjectMenu; + QMenu *m_folderMenu; + QMenu *m_fileMenu; + QMenu *m_openWithMenu; + + QMultiMap<int, QObject*> m_actionMap; + QAction *m_sessionManagerAction; + QAction *m_newAction; +#if 0 + QAction *m_loadAction; +#endif + Core::Utils::ParameterAction *m_unloadAction; + QAction *m_clearSession; + QAction *m_buildProjectOnlyAction; + Core::Utils::ParameterAction *m_buildAction; + QAction *m_buildSessionAction; + QAction *m_rebuildProjectOnlyAction; + Core::Utils::ParameterAction *m_rebuildAction; + QAction *m_rebuildSessionAction; + QAction *m_cleanProjectOnlyAction; + Core::Utils::ParameterAction *m_cleanAction; + QAction *m_cleanSessionAction; + QAction *m_runAction; + QAction *m_runActionContextMenu; + QAction *m_cancelBuildAction; + QAction *m_debugAction; + QAction *m_addNewFileAction; + QAction *m_addExistingFilesAction; + QAction *m_openFileAction; + QAction *m_showInGraphicalShell; + QAction *m_removeFileAction; + QAction *m_renameFileAction; + + QMenu *m_buildConfigurationMenu; + QActionGroup *m_buildConfigurationActionGroup; + QMenu *m_runConfigurationMenu; + QActionGroup *m_runConfigurationActionGroup; + + Internal::ProjectWindow *m_proWindow; + SessionManager *m_session; + QString m_sessionToRestoreAtStartup; + + Project *m_currentProject; + Node *m_currentNode; + + BuildManager *m_buildManager; + + QList<Internal::ProjectFileFactory*> m_fileFactories; + QStringList m_profileMimeTypes; + Internal::OutputPane *m_outputPane; + + QList<QPair<QString, QString> > m_recentProjects; // pair of filename, displayname + static const int m_maxRecentProjects = 7; + + QString m_lastOpenDirectory; + QSharedPointer<RunConfiguration> m_delayedRunConfiguration; + RunControl *m_debuggingRunControl; + QString m_runMode; + QString m_projectFilterString; + Internal::ProjectExplorerSettings m_projectExplorerSettings; + Internal::ProjectWelcomePage *m_welcomePlugin; + Internal::ProjectWelcomePageWidget *m_welcomePage; +}; + +ProjectExplorerPluginPrivate::ProjectExplorerPluginPrivate() : + m_buildConfigurationActionGroup(0), + m_runConfigurationActionGroup(0), + m_currentProject(0), + m_currentNode(0), + m_delayedRunConfiguration(0), + m_debuggingRunControl(0) +{ +} + +} // namespace ProjectExplorer + using namespace ProjectExplorer; using namespace ProjectExplorer::Internal; -CoreListenerCheckingForRunningBuild::CoreListenerCheckingForRunningBuild(BuildManager *manager) - : Core::ICoreListener(0), m_manager(manager) -{ -} - -bool CoreListenerCheckingForRunningBuild::coreAboutToClose() -{ - if (m_manager->isBuilding()) { - QMessageBox box; - QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Close"), QMessageBox::AcceptRole); - QPushButton *cancelClose = box.addButton(tr("Don't Close"), QMessageBox::RejectRole); - box.setDefaultButton(cancelClose); - box.setWindowTitle(tr("Close Qt Creator?")); - box.setText(tr("A project is currently being built.")); - box.setInformativeText(tr("Do you want to cancel the build process and close Qt Creator anyway?")); - box.exec(); - return (box.clickedButton() == closeAnyway); - } - return true; -} ProjectExplorerPlugin *ProjectExplorerPlugin::m_instance = 0; ProjectExplorerPlugin::ProjectExplorerPlugin() - : m_buildConfigurationActionGroup(0), - m_runConfigurationActionGroup(0), - m_currentProject(0), - m_currentNode(0), - m_delayedRunConfiguration(0), - m_debuggingRunControl(0) + : d(new ProjectExplorerPluginPrivate) { m_instance = this; } ProjectExplorerPlugin::~ProjectExplorerPlugin() { - removeObject(m_welcomePlugin); + removeObject(d->m_welcomePlugin); removeObject(this); + delete d; } ProjectExplorerPlugin *ProjectExplorerPlugin::instance() @@ -159,28 +221,28 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er Core::ICore *core = Core::ICore::instance(); Core::ActionManager *am = core->actionManager(); - m_welcomePlugin = new ProjectWelcomePage; - m_welcomePage = qobject_cast<Internal::ProjectWelcomePageWidget*>(m_welcomePlugin->page()); - Q_ASSERT(m_welcomePage); - connect(m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager())); - addObject(m_welcomePlugin); + d->m_welcomePlugin = new ProjectWelcomePage; + d->m_welcomePage = qobject_cast<Internal::ProjectWelcomePageWidget*>(d->m_welcomePlugin->page()); + Q_ASSERT(d->m_welcomePage); + connect(d->m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager())); + addObject(d->m_welcomePlugin); addObject(this); connect(core->fileManager(), SIGNAL(currentFileChanged(QString)), this, SLOT(setCurrentFile(QString))); - m_session = new SessionManager(this); + d->m_session = new SessionManager(this); - connect(m_session, SIGNAL(projectAdded(ProjectExplorer::Project *)), + connect(d->m_session, SIGNAL(projectAdded(ProjectExplorer::Project *)), this, SIGNAL(fileListChanged())); - connect(m_session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project *)), + connect(d->m_session, SIGNAL(aboutToRemoveProject(ProjectExplorer::Project *)), this, SLOT(invalidateProject(ProjectExplorer::Project *))); - connect(m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)), + connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)), this, SIGNAL(fileListChanged())); - connect(m_session, SIGNAL(startupProjectChanged(ProjectExplorer::Project *)), + connect(d->m_session, SIGNAL(startupProjectChanged(ProjectExplorer::Project *)), this, SLOT(startupProjectChanged())); - m_proWindow = new ProjectWindow; + d->m_proWindow = new ProjectWindow; QList<int> globalcontext; globalcontext.append(Core::Constants::C_GLOBAL_ID); @@ -193,23 +255,23 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er mode->setUniqueModeName(Constants::MODE_SESSION); mode->setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png"))); mode->setPriority(Constants::P_MODE_SESSION); - mode->setWidget(m_proWindow); + mode->setWidget(d->m_proWindow); mode->setContext(QList<int>() << pecontext); addAutoReleasedObject(mode); - m_proWindow->layout()->addWidget(new Core::FindToolBarPlaceHolder(m_proWindow)); + d->m_proWindow->layout()->addWidget(new Core::FindToolBarPlaceHolder(d->m_proWindow)); - m_buildManager = new BuildManager(this); - connect(m_buildManager, SIGNAL(buildStateChanged(ProjectExplorer::Project *)), + d->m_buildManager = new BuildManager(this); + connect(d->m_buildManager, SIGNAL(buildStateChanged(ProjectExplorer::Project *)), this, SLOT(buildStateChanged(ProjectExplorer::Project *))); - connect(m_buildManager, SIGNAL(buildQueueFinished(bool)), + connect(d->m_buildManager, SIGNAL(buildQueueFinished(bool)), this, SLOT(buildQueueFinished(bool))); - addAutoReleasedObject(new CoreListenerCheckingForRunningBuild(m_buildManager)); + addAutoReleasedObject(new CoreListenerCheckingForRunningBuild(d->m_buildManager)); - m_outputPane = new OutputPane; - addAutoReleasedObject(m_outputPane); - connect(m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)), - m_outputPane, SLOT(projectRemoved())); + d->m_outputPane = new OutputPane; + addAutoReleasedObject(d->m_outputPane); + connect(d->m_session, SIGNAL(projectRemoved(ProjectExplorer::Project *)), + d->m_outputPane, SLOT(projectRemoved())); AllProjectsFilter *allProjectsFilter = new AllProjectsFilter(this); addAutoReleasedObject(allProjectsFilter); @@ -220,7 +282,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er addAutoReleasedObject(new BuildSettingsPanelFactory); addAutoReleasedObject(new RunSettingsPanelFactory); addAutoReleasedObject(new EditorSettingsPanelFactory); - addAutoReleasedObject(new DependenciesPanelFactory(m_session)); + addAutoReleasedObject(new DependenciesPanelFactory(d->m_session)); ProcessStepFactory *processStepFactory = new ProcessStepFactory; addAutoReleasedObject(processStepFactory); @@ -234,7 +296,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er pm->getObject<Find::SearchResultWindow>()); addAutoReleasedObject(currentProjectFind); - addAutoReleasedObject(new ApplicationRunConfigurationRunner); + addAutoReleasedObject(new LocalApplicationRunControlFactory); addAutoReleasedObject(new CustomExecutableRunConfigurationFactory); addAutoReleasedObject(new ProjectFileWizardExtension); @@ -258,11 +320,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er Core::ActionContainer *mfilec = am->createMenu(Constants::M_FILECONTEXT); - m_sessionContextMenu = msessionContextMenu->menu(); - m_projectMenu = mproject->menu(); - m_subProjectMenu = msubProject->menu(); - m_folderMenu = mfolder->menu(); - m_fileMenu = mfilec->menu(); + d->m_sessionContextMenu = msessionContextMenu->menu(); + d->m_projectMenu = mproject->menu(); + d->m_subProjectMenu = msubProject->menu(); + d->m_folderMenu = mfolder->menu(); + d->m_fileMenu = mfilec->menu(); Core::ActionContainer *mfile = am->actionContainer(Core::Constants::M_FILE); @@ -328,11 +390,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er // "open with" submenu Core::ActionContainer * const openWith = am->createMenu(ProjectExplorer::Constants::M_OPENFILEWITHCONTEXT); - m_openWithMenu = openWith->menu(); - m_openWithMenu->setTitle(tr("Open With")); + d->m_openWithMenu = openWith->menu(); + d->m_openWithMenu->setTitle(tr("Open With")); connect(mfilec->menu(), SIGNAL(aboutToShow()), this, SLOT(populateOpenWithMenu())); - connect(m_openWithMenu, SIGNAL(triggered(QAction *)), + connect(d->m_openWithMenu, SIGNAL(triggered(QAction *)), this, SLOT(openWithMenuTriggered(QAction *))); // @@ -395,39 +457,39 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er // // new session action - m_sessionManagerAction = new QAction(tr("Session Manager..."), this); - cmd = am->registerAction(m_sessionManagerAction, Constants::NEWSESSION, globalcontext); + d->m_sessionManagerAction = new QAction(tr("Session Manager..."), this); + cmd = am->registerAction(d->m_sessionManagerAction, Constants::NEWSESSION, globalcontext); cmd->setDefaultKeySequence(QKeySequence()); // new action - m_newAction = new QAction(tr("New Project..."), this); - cmd = am->registerAction(m_newAction, Constants::NEWPROJECT, globalcontext); + d->m_newAction = new QAction(tr("New Project..."), this); + cmd = am->registerAction(d->m_newAction, Constants::NEWPROJECT, globalcontext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+N"))); msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES); #if 0 // open action - m_loadAction = new QAction(tr("Load Project..."), this); - cmd = am->registerAction(m_loadAction, Constants::LOAD, globalcontext); + d->m_loadAction = new QAction(tr("Load Project..."), this); + cmd = am->registerAction(d->m_loadAction, Constants::LOAD, globalcontext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+O"))); mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT); msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES); #endif // Default open action - m_openFileAction = new QAction(tr("Open File"), this); - cmd = am->registerAction(m_openFileAction, ProjectExplorer::Constants::OPENFILE, + d->m_openFileAction = new QAction(tr("Open File"), this); + cmd = am->registerAction(d->m_openFileAction, ProjectExplorer::Constants::OPENFILE, globalcontext); mfilec->addAction(cmd, Constants::G_FILE_OPEN); #if defined(Q_OS_WIN) - m_showInGraphicalShell = new QAction(tr("Show in Explorer..."), this); + d->m_showInGraphicalShell = new QAction(tr("Show in Explorer..."), this); #elif defined(Q_OS_MAC) - m_showInGraphicalShell = new QAction(tr("Show in Finder..."), this); + d->m_showInGraphicalShell = new QAction(tr("Show in Finder..."), this); #else - m_showInGraphicalShell = new QAction(tr("Show containing folder..."), this); + d->m_showInGraphicalShell = new QAction(tr("Show containing folder..."), this); #endif - cmd = am->registerAction(m_showInGraphicalShell, ProjectExplorer::Constants::SHOWINGRAPHICALSHELL, + cmd = am->registerAction(d->m_showInGraphicalShell, ProjectExplorer::Constants::SHOWINGRAPHICALSHELL, globalcontext); mfilec->addAction(cmd, Constants::G_FILE_OPEN); mfolder->addAction(cmd, Constants::G_FOLDER_FILES); @@ -444,17 +506,17 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er this, SLOT(updateRecentProjectMenu())); // unload action - m_unloadAction = new Core::Utils::ParameterAction(tr("Close Project"), tr("Close Project \"%1\""), + d->m_unloadAction = new Core::Utils::ParameterAction(tr("Close Project"), tr("Close Project \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this); - cmd = am->registerAction(m_unloadAction, Constants::UNLOAD, globalcontext); + cmd = am->registerAction(d->m_unloadAction, Constants::UNLOAD, globalcontext); cmd->setAttribute(Core::Command::CA_UpdateText); - cmd->setDefaultText(m_unloadAction->text()); + cmd->setDefaultText(d->m_unloadAction->text()); mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT); mproject->addAction(cmd, Constants::G_PROJECT_FILES); // unload session action - m_clearSession = new QAction(tr("Close All Projects"), this); - cmd = am->registerAction(m_clearSession, Constants::CLEARSESSION, globalcontext); + d->m_clearSession = new QAction(tr("Close All Projects"), this); + cmd = am->registerAction(d->m_clearSession, Constants::CLEARSESSION, globalcontext); mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT); msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES); @@ -462,87 +524,87 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er Core::ActionContainer *msession = am->createMenu(Constants::M_SESSION); msession->menu()->setTitle(tr("Session")); mfile->addMenu(msession, Core::Constants::G_FILE_PROJECT); - m_sessionMenu = msession->menu(); + d->m_sessionMenu = msession->menu(); connect(mfile->menu(), SIGNAL(aboutToShow()), this, SLOT(updateSessionMenu())); // build menu Core::ActionContainer *mbc = am->createMenu(Constants::BUILDCONFIGURATIONMENU); - m_buildConfigurationMenu = mbc->menu(); - m_buildConfigurationMenu->setTitle(tr("Set Build Configuration")); + d->m_buildConfigurationMenu = mbc->menu(); + d->m_buildConfigurationMenu->setTitle(tr("Set Build Configuration")); //TODO this means it is build twice, rrr connect(mproject->menu(), SIGNAL(aboutToShow()), this, SLOT(populateBuildConfigurationMenu())); connect(mbuild->menu(), SIGNAL(aboutToShow()), this, SLOT(populateBuildConfigurationMenu())); - connect(m_buildConfigurationMenu, SIGNAL(aboutToShow()), this, SLOT(populateBuildConfigurationMenu())); - connect(m_buildConfigurationMenu, SIGNAL(triggered(QAction *)), this, SLOT(buildConfigurationMenuTriggered(QAction *))); + connect(d->m_buildConfigurationMenu, SIGNAL(aboutToShow()), this, SLOT(populateBuildConfigurationMenu())); + connect(d->m_buildConfigurationMenu, SIGNAL(triggered(QAction *)), this, SLOT(buildConfigurationMenuTriggered(QAction *))); // build session action QIcon buildIcon(Constants::ICON_BUILD); buildIcon.addFile(Constants::ICON_BUILD_SMALL); - m_buildSessionAction = new QAction(buildIcon, tr("Build All"), this); - cmd = am->registerAction(m_buildSessionAction, Constants::BUILDSESSION, globalcontext); + d->m_buildSessionAction = new QAction(buildIcon, tr("Build All"), this); + cmd = am->registerAction(d->m_buildSessionAction, Constants::BUILDSESSION, globalcontext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B"))); mbuild->addAction(cmd, Constants::G_BUILD_SESSION); msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD); // Add to mode bar - modeManager->addAction(cmd, Constants::P_ACTION_BUILDSESSION, m_buildConfigurationMenu); + modeManager->addAction(cmd, Constants::P_ACTION_BUILDSESSION, d->m_buildConfigurationMenu); // rebuild session action QIcon rebuildIcon(Constants::ICON_REBUILD); rebuildIcon.addFile(Constants::ICON_REBUILD_SMALL); - m_rebuildSessionAction = new QAction(rebuildIcon, tr("Rebuild All"), this); - cmd = am->registerAction(m_rebuildSessionAction, Constants::REBUILDSESSION, globalcontext); + d->m_rebuildSessionAction = new QAction(rebuildIcon, tr("Rebuild All"), this); + cmd = am->registerAction(d->m_rebuildSessionAction, Constants::REBUILDSESSION, globalcontext); mbuild->addAction(cmd, Constants::G_BUILD_SESSION); msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD); // clean session QIcon cleanIcon(Constants::ICON_CLEAN); cleanIcon.addFile(Constants::ICON_CLEAN_SMALL); - m_cleanSessionAction = new QAction(cleanIcon, tr("Clean All"), this); - cmd = am->registerAction(m_cleanSessionAction, Constants::CLEANSESSION, globalcontext); + d->m_cleanSessionAction = new QAction(cleanIcon, tr("Clean All"), this); + cmd = am->registerAction(d->m_cleanSessionAction, Constants::CLEANSESSION, globalcontext); mbuild->addAction(cmd, Constants::G_BUILD_SESSION); msessionContextMenu->addAction(cmd, Constants::G_SESSION_BUILD); // build action - m_buildAction = new Core::Utils::ParameterAction(tr("Build Project"), tr("Build Project \"%1\""), + d->m_buildAction = new Core::Utils::ParameterAction(tr("Build Project"), tr("Build Project \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this); - cmd = am->registerAction(m_buildAction, Constants::BUILD, globalcontext); + cmd = am->registerAction(d->m_buildAction, Constants::BUILD, globalcontext); cmd->setAttribute(Core::Command::CA_UpdateText); - cmd->setDefaultText(m_buildAction->text()); + cmd->setDefaultText(d->m_buildAction->text()); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+B"))); mbuild->addAction(cmd, Constants::G_BUILD_PROJECT); mproject->addAction(cmd, Constants::G_PROJECT_BUILD); // rebuild action - m_rebuildAction = new Core::Utils::ParameterAction(tr("Rebuild Project"), tr("Rebuild Project \"%1\""), + d->m_rebuildAction = new Core::Utils::ParameterAction(tr("Rebuild Project"), tr("Rebuild Project \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this); - cmd = am->registerAction(m_rebuildAction, Constants::REBUILD, globalcontext); + cmd = am->registerAction(d->m_rebuildAction, Constants::REBUILD, globalcontext); cmd->setAttribute(Core::Command::CA_UpdateText); - cmd->setDefaultText(m_rebuildAction->text()); + cmd->setDefaultText(d->m_rebuildAction->text()); mbuild->addAction(cmd, Constants::G_BUILD_PROJECT); mproject->addAction(cmd, Constants::G_PROJECT_BUILD); // clean action - m_cleanAction = new Core::Utils::ParameterAction(tr("Clean Project"), tr("Clean Project \"%1\""), + d->m_cleanAction = new Core::Utils::ParameterAction(tr("Clean Project"), tr("Clean Project \"%1\""), Core::Utils::ParameterAction::EnabledWithParameter, this); - cmd = am->registerAction(m_cleanAction, Constants::CLEAN, globalcontext); + cmd = am->registerAction(d->m_cleanAction, Constants::CLEAN, globalcontext); cmd->setAttribute(Core::Command::CA_UpdateText); - cmd->setDefaultText(m_cleanAction->text()); + cmd->setDefaultText(d->m_cleanAction->text()); mbuild->addAction(cmd, Constants::G_BUILD_PROJECT); mproject->addAction(cmd, Constants::G_PROJECT_BUILD); // build without dependencies action - m_buildProjectOnlyAction = new QAction(tr("Build Without Dependencies"), this); - cmd = am->registerAction(m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext); + d->m_buildProjectOnlyAction = new QAction(tr("Build Without Dependencies"), this); + cmd = am->registerAction(d->m_buildProjectOnlyAction, Constants::BUILDPROJECTONLY, globalcontext); // rebuild without dependencies action - m_rebuildProjectOnlyAction = new QAction(tr("Rebuild Without Dependencies"), this); - cmd = am->registerAction(m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext); + d->m_rebuildProjectOnlyAction = new QAction(tr("Rebuild Without Dependencies"), this); + cmd = am->registerAction(d->m_rebuildProjectOnlyAction, Constants::REBUILDPROJECTONLY, globalcontext); // clean without dependencies action - m_cleanProjectOnlyAction = new QAction(tr("Clean Without Dependencies"), this); - cmd = am->registerAction(m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY, globalcontext); + d->m_cleanProjectOnlyAction = new QAction(tr("Clean Without Dependencies"), this); + cmd = am->registerAction(d->m_cleanProjectOnlyAction, Constants::CLEANPROJECTONLY, globalcontext); // Add Set Build Configuration to menu mbuild->addMenu(mbc, Constants::G_BUILD_OTHER); @@ -551,74 +613,74 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er // run action QIcon runIcon(Constants::ICON_RUN); runIcon.addFile(Constants::ICON_RUN_SMALL); - m_runAction = new QAction(runIcon, tr("Run"), this); - cmd = am->registerAction(m_runAction, Constants::RUN, globalcontext); + d->m_runAction = new QAction(runIcon, tr("Run"), this); + cmd = am->registerAction(d->m_runAction, Constants::RUN, globalcontext); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+R"))); mbuild->addAction(cmd, Constants::G_BUILD_RUN); Core::ActionContainer *mrc = am->createMenu(Constants::RUNCONFIGURATIONMENU); - m_runConfigurationMenu = mrc->menu(); - m_runConfigurationMenu->setTitle(tr("Set Run Configuration")); + d->m_runConfigurationMenu = mrc->menu(); + d->m_runConfigurationMenu->setTitle(tr("Set Run Configuration")); mbuild->addMenu(mrc, Constants::G_BUILD_RUN); mproject->addMenu(mrc, Constants::G_PROJECT_CONFIG); // TODO this recreates the menu twice if shown in the Build or context menu - connect(m_runConfigurationMenu, SIGNAL(aboutToShow()), this, SLOT(populateRunConfigurationMenu())); + connect(d->m_runConfigurationMenu, SIGNAL(aboutToShow()), this, SLOT(populateRunConfigurationMenu())); connect(mproject->menu(), SIGNAL(aboutToShow()), this, SLOT(populateRunConfigurationMenu())); connect(mbuild->menu(), SIGNAL(aboutToShow()), this, SLOT(populateRunConfigurationMenu())); - connect(m_runConfigurationMenu, SIGNAL(triggered(QAction *)), this, SLOT(runConfigurationMenuTriggered(QAction *))); + connect(d->m_runConfigurationMenu, SIGNAL(triggered(QAction *)), this, SLOT(runConfigurationMenuTriggered(QAction *))); - modeManager->addAction(cmd, Constants::P_ACTION_RUN, m_runConfigurationMenu); + modeManager->addAction(cmd, Constants::P_ACTION_RUN, d->m_runConfigurationMenu); - m_runActionContextMenu = new QAction(runIcon, tr("Run"), this); - cmd = am->registerAction(m_runActionContextMenu, Constants::RUNCONTEXTMENU, globalcontext); + d->m_runActionContextMenu = new QAction(runIcon, tr("Run"), this); + cmd = am->registerAction(d->m_runActionContextMenu, Constants::RUNCONTEXTMENU, globalcontext); mproject->addAction(cmd, Constants::G_PROJECT_RUN); // cancel build action - m_cancelBuildAction = new QAction(tr("Cancel Build"), this); - cmd = am->registerAction(m_cancelBuildAction, Constants::CANCELBUILD, globalcontext); + d->m_cancelBuildAction = new QAction(tr("Cancel Build"), this); + cmd = am->registerAction(d->m_cancelBuildAction, Constants::CANCELBUILD, globalcontext); mbuild->addAction(cmd, Constants::G_BUILD_CANCEL); // debug action QIcon debuggerIcon(":/projectexplorer/images/debugger_start_small.png"); debuggerIcon.addFile(":/projectexplorer/images/debugger_start.png"); - m_debugAction = new QAction(debuggerIcon, tr("Start Debugging"), this); - cmd = am->registerAction(m_debugAction, Constants::DEBUG, globalcontext); + d->m_debugAction = new QAction(debuggerIcon, tr("Start Debugging"), this); + cmd = am->registerAction(d->m_debugAction, Constants::DEBUG, globalcontext); cmd->setAttribute(Core::Command::CA_UpdateText); cmd->setAttribute(Core::Command::CA_UpdateIcon); cmd->setDefaultText(tr("Start Debugging")); cmd->setDefaultKeySequence(QKeySequence(tr("F5"))); mstartdebugging->addAction(cmd, Core::Constants::G_DEFAULT_ONE); - modeManager->addAction(cmd, Constants::P_ACTION_DEBUG, m_runConfigurationMenu); + modeManager->addAction(cmd, Constants::P_ACTION_DEBUG, d->m_runConfigurationMenu); // add new file action - m_addNewFileAction = new QAction(tr("Add New..."), this); - cmd = am->registerAction(m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE, + d->m_addNewFileAction = new QAction(tr("Add New..."), this); + cmd = am->registerAction(d->m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE, globalcontext); mproject->addAction(cmd, Constants::G_PROJECT_FILES); msubProject->addAction(cmd, Constants::G_PROJECT_FILES); mfolder->addAction(cmd, Constants::G_FOLDER_FILES); // add existing file action - m_addExistingFilesAction = new QAction(tr("Add Existing Files..."), this); - cmd = am->registerAction(m_addExistingFilesAction, ProjectExplorer::Constants::ADDEXISTINGFILES, + d->m_addExistingFilesAction = new QAction(tr("Add Existing Files..."), this); + cmd = am->registerAction(d->m_addExistingFilesAction, ProjectExplorer::Constants::ADDEXISTINGFILES, globalcontext); mproject->addAction(cmd, Constants::G_PROJECT_FILES); msubProject->addAction(cmd, Constants::G_PROJECT_FILES); mfolder->addAction(cmd, Constants::G_FOLDER_FILES); // remove file action - m_removeFileAction = new QAction(tr("Remove File..."), this); - cmd = am->registerAction(m_removeFileAction, ProjectExplorer::Constants::REMOVEFILE, + d->m_removeFileAction = new QAction(tr("Remove File..."), this); + cmd = am->registerAction(d->m_removeFileAction, ProjectExplorer::Constants::REMOVEFILE, globalcontext); mfilec->addAction(cmd, Constants::G_FILE_OTHER); // renamefile action (TODO: Not supported yet) - m_renameFileAction = new QAction(tr("Rename"), this); - cmd = am->registerAction(m_renameFileAction, ProjectExplorer::Constants::RENAMEFILE, + d->m_renameFileAction = new QAction(tr("Rename"), this); + cmd = am->registerAction(d->m_renameFileAction, ProjectExplorer::Constants::RENAMEFILE, globalcontext); mfilec->addAction(cmd, Constants::G_FILE_OTHER); - m_renameFileAction->setEnabled(false); - m_renameFileAction->setVisible(false); + d->m_renameFileAction->setEnabled(false); + d->m_renameFileAction->setVisible(false); connect(core, SIGNAL(saveSettingsRequested()), this, SLOT(savePersistentSettings())); @@ -639,7 +701,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er } foreach(const QString &s, oldRecentProjects) { - m_recentProjects.append(qMakePair(s, QFileInfo(s).fileName())); + d->m_recentProjects.append(qMakePair(s, QFileInfo(s).fileName())); } // < -- Creator 1.0 compatibility code @@ -649,44 +711,44 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er if (fileNames.size() == displayNames.size()) { for (int i = 0; i < fileNames.size(); ++i) { if (QFileInfo(fileNames.at(i)).isFile()) - m_recentProjects.append(qMakePair(fileNames.at(i), displayNames.at(i))); + d->m_recentProjects.append(qMakePair(fileNames.at(i), displayNames.at(i))); } } } if (QSettings *s = core->settings()) { - m_projectExplorerSettings.buildBeforeRun = s->value("ProjectExplorer/Settings/BuildBeforeRun", true).toBool(); - m_projectExplorerSettings.saveBeforeBuild = s->value("ProjectExplorer/Settings/SaveBeforeBuild", false).toBool(); - m_projectExplorerSettings.showCompilerOutput = s->value("ProjectExplorer/Settings/ShowCompilerOutput", false).toBool(); - m_projectExplorerSettings.useJom = s->value("ProjectExplorer/Settings/UseJom", true).toBool(); + d->m_projectExplorerSettings.buildBeforeRun = s->value("ProjectExplorer/Settings/BuildBeforeRun", true).toBool(); + d->m_projectExplorerSettings.saveBeforeBuild = s->value("ProjectExplorer/Settings/SaveBeforeBuild", false).toBool(); + d->m_projectExplorerSettings.showCompilerOutput = s->value("ProjectExplorer/Settings/ShowCompilerOutput", false).toBool(); + d->m_projectExplorerSettings.useJom = s->value("ProjectExplorer/Settings/UseJom", true).toBool(); } - connect(m_sessionManagerAction, SIGNAL(triggered()), this, SLOT(showSessionManager())); - connect(m_newAction, SIGNAL(triggered()), this, SLOT(newProject())); + connect(d->m_sessionManagerAction, SIGNAL(triggered()), this, SLOT(showSessionManager())); + connect(d->m_newAction, SIGNAL(triggered()), this, SLOT(newProject())); #if 0 - connect(m_loadAction, SIGNAL(triggered()), this, SLOT(loadAction())); + connect(d->m_loadAction, SIGNAL(triggered()), this, SLOT(loadAction())); #endif - connect(m_buildProjectOnlyAction, SIGNAL(triggered()), this, SLOT(buildProjectOnly())); - connect(m_buildAction, SIGNAL(triggered()), this, SLOT(buildProject())); - connect(m_buildSessionAction, SIGNAL(triggered()), this, SLOT(buildSession())); - connect(m_rebuildProjectOnlyAction, SIGNAL(triggered()), this, SLOT(rebuildProjectOnly())); - connect(m_rebuildAction, SIGNAL(triggered()), this, SLOT(rebuildProject())); - connect(m_rebuildSessionAction, SIGNAL(triggered()), this, SLOT(rebuildSession())); - connect(m_cleanProjectOnlyAction, SIGNAL(triggered()), this, SLOT(cleanProjectOnly())); - connect(m_cleanAction, SIGNAL(triggered()), this, SLOT(cleanProject())); - connect(m_cleanSessionAction, SIGNAL(triggered()), this, SLOT(cleanSession())); - connect(m_runAction, SIGNAL(triggered()), this, SLOT(runProject())); - connect(m_runActionContextMenu, SIGNAL(triggered()), this, SLOT(runProjectContextMenu())); - connect(m_cancelBuildAction, SIGNAL(triggered()), this, SLOT(cancelBuild())); - connect(m_debugAction, SIGNAL(triggered()), this, SLOT(debugProject())); - connect(m_unloadAction, SIGNAL(triggered()), this, SLOT(unloadProject())); - connect(m_clearSession, SIGNAL(triggered()), this, SLOT(clearSession())); - connect(m_addNewFileAction, SIGNAL(triggered()), this, SLOT(addNewFile())); - connect(m_addExistingFilesAction, SIGNAL(triggered()), this, SLOT(addExistingFiles())); - connect(m_openFileAction, SIGNAL(triggered()), this, SLOT(openFile())); - connect(m_showInGraphicalShell, SIGNAL(triggered()), this, SLOT(showInGraphicalShell())); - connect(m_removeFileAction, SIGNAL(triggered()), this, SLOT(removeFile())); - connect(m_renameFileAction, SIGNAL(triggered()), this, SLOT(renameFile())); + connect(d->m_buildProjectOnlyAction, SIGNAL(triggered()), this, SLOT(buildProjectOnly())); + connect(d->m_buildAction, SIGNAL(triggered()), this, SLOT(buildProject())); + connect(d->m_buildSessionAction, SIGNAL(triggered()), this, SLOT(buildSession())); + connect(d->m_rebuildProjectOnlyAction, SIGNAL(triggered()), this, SLOT(rebuildProjectOnly())); + connect(d->m_rebuildAction, SIGNAL(triggered()), this, SLOT(rebuildProject())); + connect(d->m_rebuildSessionAction, SIGNAL(triggered()), this, SLOT(rebuildSession())); + connect(d->m_cleanProjectOnlyAction, SIGNAL(triggered()), this, SLOT(cleanProjectOnly())); + connect(d->m_cleanAction, SIGNAL(triggered()), this, SLOT(cleanProject())); + connect(d->m_cleanSessionAction, SIGNAL(triggered()), this, SLOT(cleanSession())); + connect(d->m_runAction, SIGNAL(triggered()), this, SLOT(runProject())); + connect(d->m_runActionContextMenu, SIGNAL(triggered()), this, SLOT(runProjectContextMenu())); + connect(d->m_cancelBuildAction, SIGNAL(triggered()), this, SLOT(cancelBuild())); + connect(d->m_debugAction, SIGNAL(triggered()), this, SLOT(debugProject())); + connect(d->m_unloadAction, SIGNAL(triggered()), this, SLOT(unloadProject())); + connect(d->m_clearSession, SIGNAL(triggered()), this, SLOT(clearSession())); + connect(d->m_addNewFileAction, SIGNAL(triggered()), this, SLOT(addNewFile())); + connect(d->m_addExistingFilesAction, SIGNAL(triggered()), this, SLOT(addExistingFiles())); + connect(d->m_openFileAction, SIGNAL(triggered()), this, SLOT(openFile())); + connect(d->m_showInGraphicalShell, SIGNAL(triggered()), this, SLOT(showInGraphicalShell())); + connect(d->m_removeFileAction, SIGNAL(triggered()), this, SLOT(removeFile())); + connect(d->m_renameFileAction, SIGNAL(triggered()), this, SLOT(renameFile())); updateActions(); @@ -715,7 +777,7 @@ ProjectFileFactory * ProjectExplorerPlugin::findProjectFileFactory(const QString { // Find factory if (const Core::MimeType mt = Core::ICore::instance()->mimeDatabase()->findByFile(QFileInfo(filename))) - if (ProjectFileFactory *pf = findFactory<ProjectFileFactory>(mt.type(), m_fileFactories.constBegin(), m_fileFactories.constEnd())) + if (ProjectFileFactory *pf = findFactory<ProjectFileFactory>(mt.type(), d->m_fileFactories.constBegin(), d->m_fileFactories.constEnd())) return pf; qWarning("Unable to find project file factory for '%s'", filename.toUtf8().constData()); return 0; @@ -727,21 +789,21 @@ void ProjectExplorerPlugin::loadAction() qDebug() << "ProjectExplorerPlugin::loadAction"; - QString dir = m_lastOpenDirectory; + QString dir = d->m_lastOpenDirectory; // for your special convenience, we preselect a pro file if it is // the current file if (Core::IEditor *editor = Core::EditorManager::instance()->currentEditor()) { if (const Core::IFile *file = editor->file()) { const QString fn = file->fileName(); - const bool isProject = m_profileMimeTypes.contains(file->mimeType()); + const bool isProject = d->m_profileMimeTypes.contains(file->mimeType()); dir = isProject ? fn : QFileInfo(fn).absolutePath(); } } QString filename = QFileDialog::getOpenFileName(0, tr("Load Project"), dir, - m_projectFilterString); + d->m_projectFilterString); if (filename.isEmpty()) return; if (ProjectFileFactory *pf = findProjectFileFactory(filename)) @@ -754,7 +816,7 @@ void ProjectExplorerPlugin::unloadProject() if (debug) qDebug() << "ProjectExplorerPlugin::unloadProject"; - Core::IFile *fi = m_currentProject->file(); + Core::IFile *fi = d->m_currentProject->file(); if (!fi || fi->fileName().isEmpty()) //nothing to save? return; @@ -779,8 +841,8 @@ void ProjectExplorerPlugin::unloadProject() if (!success) return; - addToRecentProjects(fi->fileName(), m_currentProject->name()); - m_session->removeProject(m_currentProject); + addToRecentProjects(fi->fileName(), d->m_currentProject->name()); + d->m_session->removeProject(d->m_currentProject); updateActions(); } @@ -789,24 +851,24 @@ void ProjectExplorerPlugin::clearSession() if (debug) qDebug() << "ProjectExplorerPlugin::clearSession"; - if (!m_session->clear()) + if (!d->m_session->clear()) return; // Action has been cancelled updateActions(); } void ProjectExplorerPlugin::extensionsInitialized() { - m_fileFactories = ProjectFileFactory::createFactories(&m_projectFilterString); - foreach (ProjectFileFactory *pf, m_fileFactories) { - m_profileMimeTypes += pf->mimeTypes(); + d->m_fileFactories = ProjectFileFactory::createFactories(&d->m_projectFilterString); + foreach (ProjectFileFactory *pf, d->m_fileFactories) { + d->m_profileMimeTypes += pf->mimeTypes(); addAutoReleasedObject(pf); } } void ProjectExplorerPlugin::shutdown() { - m_session->clear(); -// m_proWindow->saveConfigChanges(); + d->m_session->clear(); +// d->m_proWindow->saveConfigChanges(); } void ProjectExplorerPlugin::newProject() @@ -833,12 +895,12 @@ void ProjectExplorerPlugin::showSessionManager() if (debug) qDebug() << "ProjectExplorerPlugin::showSessionManager"; - if (m_session->isDefaultVirgin()) { + if (d->m_session->isDefaultVirgin()) { // do not save new virgin default sessions } else { - m_session->save(); + d->m_session->save(); } - SessionDialog sessionDialog(m_session, m_session->activeSession(), false); + SessionDialog sessionDialog(d->m_session, d->m_session->activeSession(), false); sessionDialog.exec(); updateActions(); @@ -855,10 +917,10 @@ void ProjectExplorerPlugin::setStartupProject(Project *project) qDebug() << "ProjectExplorerPlugin::setStartupProject"; if (!project) - project = m_currentProject; + project = d->m_currentProject; if (!project) return; - m_session->setStartupProject(project); + d->m_session->setStartupProject(project); // NPE: Visually mark startup project updateActions(); } @@ -868,25 +930,25 @@ void ProjectExplorerPlugin::savePersistentSettings() if (debug) qDebug()<<"ProjectExplorerPlugin::savePersistentSettings()"; - foreach (Project *pro, m_session->projects()) + foreach (Project *pro, d->m_session->projects()) pro->saveSettings(); - if (m_session->isDefaultVirgin()) { + if (d->m_session->isDefaultVirgin()) { // do not save new virgin default sessions } else { - m_session->save(); + d->m_session->save(); } QSettings *s = Core::ICore::instance()->settings(); if (s) { - s->setValue("ProjectExplorer/StartupSession", m_session->file()->fileName()); + s->setValue("ProjectExplorer/StartupSession", d->m_session->file()->fileName()); s->remove("ProjectExplorer/RecentProjects/Files"); QStringList fileNames; QStringList displayNames; QList<QPair<QString, QString> >::const_iterator it, end; - end = m_recentProjects.constEnd(); - for (it = m_recentProjects.constBegin(); it != end; ++it) { + end = d->m_recentProjects.constEnd(); + for (it = d->m_recentProjects.constBegin(); it != end; ++it) { fileNames << (*it).first; displayNames << (*it).second; } @@ -894,10 +956,10 @@ void ProjectExplorerPlugin::savePersistentSettings() s->setValue("ProjectExplorer/RecentProjects/FileNames", fileNames); s->setValue("ProjectExplorer/RecentProjects/DisplayNames", displayNames); - s->setValue("ProjectExplorer/Settings/BuildBeforeRun", m_projectExplorerSettings.buildBeforeRun); - s->setValue("ProjectExplorer/Settings/SaveBeforeBuild", m_projectExplorerSettings.saveBeforeBuild); - s->setValue("ProjectExplorer/Settings/ShowCompilerOutput", m_projectExplorerSettings.showCompilerOutput); - s->setValue("ProjectExplorer/Settings/UseJom", m_projectExplorerSettings.useJom); + s->setValue("ProjectExplorer/Settings/BuildBeforeRun", d->m_projectExplorerSettings.buildBeforeRun); + s->setValue("ProjectExplorer/Settings/SaveBeforeBuild", d->m_projectExplorerSettings.saveBeforeBuild); + s->setValue("ProjectExplorer/Settings/ShowCompilerOutput", d->m_projectExplorerSettings.showCompilerOutput); + s->setValue("ProjectExplorer/Settings/UseJom", d->m_projectExplorerSettings.useJom); } } @@ -931,7 +993,7 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName if (manager->mimeType() == mt.type()) { if (Project *pro = manager->openProject(fileName)) openedPro += pro; - m_session->reportProjectLoadingProgress(); + d->m_session->reportProjectLoadingProgress(); break; } } @@ -959,10 +1021,10 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName } } - m_session->addProjects(openedPro); + d->m_session->addProjects(openedPro); // Make sure we always have a current project / node - if (!m_currentProject && !openedPro.isEmpty()) + if (!d->m_currentProject && !openedPro.isEmpty()) setCurrentNode(openedPro.first()->rootProjectNode()); updateActions(); @@ -976,17 +1038,17 @@ QList<Project *> ProjectExplorerPlugin::openProjects(const QStringList &fileName Project *ProjectExplorerPlugin::currentProject() const { if (debug) { - if (m_currentProject) - qDebug() << "ProjectExplorerPlugin::currentProject returns " << m_currentProject->name(); + if (d->m_currentProject) + qDebug() << "ProjectExplorerPlugin::currentProject returns " << d->m_currentProject->name(); else qDebug() << "ProjectExplorerPlugin::currentProject returns 0"; } - return m_currentProject; + return d->m_currentProject; } Node *ProjectExplorerPlugin::currentNode() const { - return m_currentNode; + return d->m_currentNode; } void ProjectExplorerPlugin::setCurrentFile(Project *project, const QString &filePath) @@ -996,23 +1058,23 @@ void ProjectExplorerPlugin::setCurrentFile(Project *project, const QString &file void ProjectExplorerPlugin::setCurrentFile(const QString &filePath) { - Project *project = m_session->projectForFile(filePath); + Project *project = d->m_session->projectForFile(filePath); // If the file is not in any project, stay with the current project // e.g. on opening a git diff buffer, git log buffer, we don't change the project // I'm not 100% sure this is correct if (!project) - project = m_currentProject; + project = d->m_currentProject; setCurrent(project, filePath, 0); } void ProjectExplorerPlugin::setCurrentNode(Node *node) { - setCurrent(m_session->projectForNode(node), QString(), node); + setCurrent(d->m_session->projectForNode(node), QString(), node); } SessionManager *ProjectExplorerPlugin::session() const { - return m_session; + return d->m_session; } Project *ProjectExplorerPlugin::startupProject() const @@ -1020,10 +1082,10 @@ Project *ProjectExplorerPlugin::startupProject() const if (debug) qDebug() << "ProjectExplorerPlugin::startupProject"; - Project *pro = m_session->startupProject(); + Project *pro = d->m_session->startupProject(); if (!pro) - pro = m_currentProject; + pro = d->m_currentProject; return pro; } @@ -1032,11 +1094,11 @@ Project *ProjectExplorerPlugin::startupProject() const void ProjectExplorerPlugin::updateWelcomePage() { ProjectWelcomePageWidget::WelcomePageData welcomePageData; - welcomePageData.sessionList = m_session->sessions(); - welcomePageData.activeSession = m_session->activeSession(); - welcomePageData.previousSession = m_session->lastSession(); - welcomePageData.projectList = m_recentProjects; - m_welcomePage->updateWelcomePage(welcomePageData); + welcomePageData.sessionList = d->m_session->sessions(); + welcomePageData.activeSession = d->m_session->activeSession(); + welcomePageData.previousSession = d->m_session->lastSession(); + welcomePageData.projectList = d->m_recentProjects; + d->m_welcomePage->updateWelcomePage(welcomePageData); } void ProjectExplorerPlugin::currentModeChanged(Core::IMode *) @@ -1046,19 +1108,19 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *) void ProjectExplorerPlugin::determineSessionToRestoreAtStartup() { - QStringList sessions = m_session->sessions(); + QStringList sessions = d->m_session->sessions(); // We have command line arguments, try to find a session in them QStringList arguments = ExtensionSystem::PluginManager::instance()->arguments(); // Default to no session loading - m_sessionToRestoreAtStartup = QString::null; + d->m_sessionToRestoreAtStartup = QString::null; foreach (const QString &arg, arguments) { if (sessions.contains(arg)) { // Session argument - m_sessionToRestoreAtStartup = arg; + d->m_sessionToRestoreAtStartup = arg; break; } } - if (!m_sessionToRestoreAtStartup.isNull()) + if (!d->m_sessionToRestoreAtStartup.isNull()) Core::ICore::instance()->modeManager()->activateMode(Core::Constants::MODE_EDIT); } @@ -1077,20 +1139,20 @@ void ProjectExplorerPlugin::restoreSession() // We have command line arguments, try to find a session in them QStringList arguments = ExtensionSystem::PluginManager::instance()->arguments(); - arguments.removeOne(m_sessionToRestoreAtStartup); + arguments.removeOne(d->m_sessionToRestoreAtStartup); // Restore latest session or what was passed on the command line - if (m_sessionToRestoreAtStartup == QString::null) { - m_session->createAndLoadNewDefaultSession(); + if (d->m_sessionToRestoreAtStartup == QString::null) { + d->m_session->createAndLoadNewDefaultSession(); } else { - m_session->loadSession(m_sessionToRestoreAtStartup); + d->m_session->loadSession(d->m_sessionToRestoreAtStartup); } // update welcome page Core::ModeManager *modeManager = Core::ModeManager::instance(); connect(modeManager, SIGNAL(currentModeChanged(Core::IMode*)), this, SLOT(currentModeChanged(Core::IMode*))); - connect(m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString))); - connect(m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(loadProject(QString))); + connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString))); + connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(loadProject(QString))); Core::ICore::instance()->openFiles(arguments); updateActions(); @@ -1101,7 +1163,7 @@ void ProjectExplorerPlugin::loadSession(const QString &session) { if (debug) qDebug() << "ProjectExplorerPlugin::loadSession" << session; - m_session->loadSession(session); + d->m_session->loadSession(session); } @@ -1110,25 +1172,25 @@ void ProjectExplorerPlugin::showContextMenu(const QPoint &globalPos, Node *node) QMenu *contextMenu = 0; if (!node) - node = m_session->sessionNode(); + node = d->m_session->sessionNode(); if (node->nodeType() != SessionNodeType) { - Project *project = m_session->projectForNode(node); + Project *project = d->m_session->projectForNode(node); setCurrentNode(node); emit aboutToShowContextMenu(project, node); switch (node->nodeType()) { case ProjectNodeType: - if (node->parentFolderNode() == m_session->sessionNode()) - contextMenu = m_projectMenu; + if (node->parentFolderNode() == d->m_session->sessionNode()) + contextMenu = d->m_projectMenu; else - contextMenu = m_subProjectMenu; + contextMenu = d->m_subProjectMenu; break; case FolderNodeType: - contextMenu = m_folderMenu; + contextMenu = d->m_folderMenu; break; case FileNodeType: - contextMenu = m_fileMenu; + contextMenu = d->m_fileMenu; break; default: qWarning("ProjectExplorerPlugin::showContextMenu - Missing handler for node type"); @@ -1136,7 +1198,7 @@ void ProjectExplorerPlugin::showContextMenu(const QPoint &globalPos, Node *node) } else { // session item emit aboutToShowContextMenu(0, node); - contextMenu = m_sessionContextMenu; + contextMenu = d->m_sessionContextMenu; } updateContextMenuActions(); @@ -1147,30 +1209,29 @@ void ProjectExplorerPlugin::showContextMenu(const QPoint &globalPos, Node *node) BuildManager *ProjectExplorerPlugin::buildManager() const { - return m_buildManager; + return d->m_buildManager; } void ProjectExplorerPlugin::buildStateChanged(Project * pro) { if (debug) { qDebug() << "buildStateChanged"; - qDebug() << pro->file()->fileName() << "isBuilding()" << m_buildManager->isBuilding(pro); + qDebug() << pro->file()->fileName() << "isBuilding()" << d->m_buildManager->isBuilding(pro); } Q_UNUSED(pro) updateActions(); } -void ProjectExplorerPlugin::executeRunConfiguration(QSharedPointer<RunConfiguration> runConfiguration, const QString &runMode) +void ProjectExplorerPlugin::executeRunConfiguration(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &runMode) { - IRunConfigurationRunner *runner = findRunner(runConfiguration, runMode); - if (runner) { + if (IRunControlFactory *runControlFactory = findRunControlFactory(runConfiguration, runMode)) { emit aboutToExecuteProject(runConfiguration->project()); - RunControl *control = runner->run(runConfiguration, runMode); - m_outputPane->createNewOutputWindow(control); + RunControl *control = runControlFactory->create(runConfiguration, runMode); + d->m_outputPane->createNewOutputWindow(control); if (runMode == ProjectExplorer::Constants::RUNMODE) - m_outputPane->popup(false); - m_outputPane->showTabFor(control); + d->m_outputPane->popup(false); + d->m_outputPane->showTabFor(control); connect(control, SIGNAL(addToOutputWindow(RunControl *, const QString &)), this, SLOT(addToApplicationOutputWindow(RunControl *, const QString &))); @@ -1182,7 +1243,7 @@ void ProjectExplorerPlugin::executeRunConfiguration(QSharedPointer<RunConfigurat this, SLOT(runControlFinished())); if (runMode == ProjectExplorer::Constants::DEBUGMODE) - m_debuggingRunControl = control; + d->m_debuggingRunControl = control; control->start(); updateRunAction(); @@ -1197,14 +1258,14 @@ void ProjectExplorerPlugin::buildQueueFinished(bool success) updateActions(); - if (success && m_delayedRunConfiguration) { - executeRunConfiguration(m_delayedRunConfiguration, m_runMode); + if (success && d->m_delayedRunConfiguration) { + executeRunConfiguration(d->m_delayedRunConfiguration, d->m_runMode); } else { - if (m_buildManager->tasksAvailable()) - m_buildManager->showTaskWindow(); + if (d->m_buildManager->tasksAvailable()) + d->m_buildManager->showTaskWindow(); } - m_delayedRunConfiguration = QSharedPointer<RunConfiguration>(0); - m_runMode = QString::null; + d->m_delayedRunConfiguration = QSharedPointer<RunConfiguration>(0); + d->m_runMode = QString::null; } void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node *node) @@ -1216,19 +1277,19 @@ void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node if (node) filePath = node->path(); else - node = m_session->nodeForFile(filePath, project); + node = d->m_session->nodeForFile(filePath, project); Core::ICore *core = Core::ICore::instance(); bool projectChanged = false; - if (m_currentProject != project) { + if (d->m_currentProject != project) { int oldContext = -1; int newContext = -1; int oldLanguageID = -1; int newLanguageID = -1; - if (m_currentProject) { - oldContext = m_currentProject->projectManager()->projectContext(); - oldLanguageID = m_currentProject->projectManager()->projectLanguage(); + if (d->m_currentProject) { + oldContext = d->m_currentProject->projectManager()->projectContext(); + oldLanguageID = d->m_currentProject->projectManager()->projectLanguage(); } if (project) { newContext = project->projectManager()->projectContext(); @@ -1240,16 +1301,16 @@ void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node core->addAdditionalContext(newLanguageID); core->updateContext(); - m_currentProject = project; + d->m_currentProject = project; projectChanged = true; } - if (projectChanged || m_currentNode != node) { - m_currentNode = node; + if (projectChanged || d->m_currentNode != node) { + d->m_currentNode = node; if (debug) qDebug() << "ProjectExplorer - currentNodeChanged(" << (node ? node->path() : "0") << ", " << (project ? project->name() : "0") << ")"; - emit currentNodeChanged(m_currentNode, project); + emit currentNodeChanged(d->m_currentNode, project); } if (projectChanged) { if (debug) @@ -1273,29 +1334,29 @@ void ProjectExplorerPlugin::updateActions() if (debug) qDebug() << "ProjectExplorerPlugin::updateActions"; - bool enableBuildActions = m_currentProject && ! (m_buildManager->isBuilding(m_currentProject)); - bool hasProjects = !m_session->projects().isEmpty(); - bool building = m_buildManager->isBuilding(); - QString projectName = m_currentProject ? m_currentProject->name() : QString(); + bool enableBuildActions = d->m_currentProject && ! (d->m_buildManager->isBuilding(d->m_currentProject)); + bool hasProjects = !d->m_session->projects().isEmpty(); + bool building = d->m_buildManager->isBuilding(); + QString projectName = d->m_currentProject ? d->m_currentProject->name() : QString(); if (debug) qDebug() << "BuildManager::isBuilding()" << building; - m_unloadAction->setParameter(projectName); + d->m_unloadAction->setParameter(projectName); - m_buildAction->setParameter(projectName); - m_rebuildAction->setParameter(projectName); - m_cleanAction->setParameter(projectName); + d->m_buildAction->setParameter(projectName); + d->m_rebuildAction->setParameter(projectName); + d->m_cleanAction->setParameter(projectName); - m_buildProjectOnlyAction->setEnabled(enableBuildActions); - m_rebuildProjectOnlyAction->setEnabled(enableBuildActions); - m_cleanProjectOnlyAction->setEnabled(enableBuildActions); + d->m_buildProjectOnlyAction->setEnabled(enableBuildActions); + d->m_rebuildProjectOnlyAction->setEnabled(enableBuildActions); + d->m_cleanProjectOnlyAction->setEnabled(enableBuildActions); - m_clearSession->setEnabled(hasProjects && !building); - m_buildSessionAction->setEnabled(hasProjects && !building); - m_rebuildSessionAction->setEnabled(hasProjects && !building); - m_cleanSessionAction->setEnabled(hasProjects && !building); - m_cancelBuildAction->setEnabled(building); + d->m_clearSession->setEnabled(hasProjects && !building); + d->m_buildSessionAction->setEnabled(hasProjects && !building); + d->m_rebuildSessionAction->setEnabled(hasProjects && !building); + d->m_cleanSessionAction->setEnabled(hasProjects && !building); + d->m_cancelBuildAction->setEnabled(building); updateRunAction(); } @@ -1308,7 +1369,7 @@ QStringList ProjectExplorerPlugin::allFilesWithDependencies(Project *pro) qDebug() << "ProjectExplorerPlugin::allFilesWithDependencies(" << pro->file()->fileName() << ")"; QStringList filesToSave; - foreach (Project *p, m_session->projectOrder(pro)) { + foreach (Project *p, d->m_session->projectOrder(pro)) { FindAllFilesVisitor filesVisitor; p->rootProjectNode()->accept(&filesVisitor); filesToSave << filesVisitor.filePaths(); @@ -1324,7 +1385,7 @@ bool ProjectExplorerPlugin::saveModifiedFiles() QList<Core::IFile *> filesToSave = Core::ICore::instance()->fileManager()->modifiedFiles(); if (!filesToSave.isEmpty()) { - if (m_projectExplorerSettings.saveBeforeBuild) { + if (d->m_projectExplorerSettings.saveBeforeBuild) { Core::ICore::instance()->fileManager()->saveModifiedFilesSilently(filesToSave); } else { bool cancelled = false; @@ -1337,7 +1398,7 @@ bool ProjectExplorerPlugin::saveModifiedFiles() if (cancelled) return false; if (alwaysSave) - m_projectExplorerSettings.saveBeforeBuild = true; + d->m_projectExplorerSettings.saveBeforeBuild = true; } } return true; @@ -1352,7 +1413,7 @@ void ProjectExplorerPlugin::buildProjectOnly() qDebug() << "ProjectExplorerPlugin::buildProjectOnly"; if (saveModifiedFiles()) - buildManager()->buildProject(m_currentProject, m_currentProject->activeBuildConfiguration()); + buildManager()->buildProject(d->m_currentProject, d->m_currentProject->activeBuildConfiguration()); } static QStringList configurations(const QList<Project *> &projects) @@ -1369,8 +1430,8 @@ void ProjectExplorerPlugin::buildProject() qDebug() << "ProjectExplorerPlugin::buildProject"; if (saveModifiedFiles()) { - const QList<Project *> & projects = m_session->projectOrder(m_currentProject); - m_buildManager->buildProjects(projects, configurations(projects)); + const QList<Project *> & projects = d->m_session->projectOrder(d->m_currentProject); + d->m_buildManager->buildProjects(projects, configurations(projects)); } } @@ -1380,8 +1441,8 @@ void ProjectExplorerPlugin::buildSession() qDebug() << "ProjectExplorerPlugin::buildSession"; if (saveModifiedFiles()) { - const QList<Project *> & projects = m_session->projectOrder(); - m_buildManager->buildProjects(projects, configurations(projects)); + const QList<Project *> & projects = d->m_session->projectOrder(); + d->m_buildManager->buildProjects(projects, configurations(projects)); } } @@ -1391,8 +1452,8 @@ void ProjectExplorerPlugin::rebuildProjectOnly() qDebug() << "ProjectExplorerPlugin::rebuildProjectOnly"; if (saveModifiedFiles()) { - m_buildManager->cleanProject(m_currentProject, m_currentProject->activeBuildConfiguration()); - m_buildManager->buildProject(m_currentProject, m_currentProject->activeBuildConfiguration()); + d->m_buildManager->cleanProject(d->m_currentProject, d->m_currentProject->activeBuildConfiguration()); + d->m_buildManager->buildProject(d->m_currentProject, d->m_currentProject->activeBuildConfiguration()); } } @@ -1402,11 +1463,11 @@ void ProjectExplorerPlugin::rebuildProject() qDebug() << "ProjectExplorerPlugin::rebuildProject"; if (saveModifiedFiles()) { - const QList<Project *> & projects = m_session->projectOrder(m_currentProject); + const QList<Project *> & projects = d->m_session->projectOrder(d->m_currentProject); const QStringList configs = configurations(projects); - m_buildManager->cleanProjects(projects, configs); - m_buildManager->buildProjects(projects, configs); + d->m_buildManager->cleanProjects(projects, configs); + d->m_buildManager->buildProjects(projects, configs); } } @@ -1416,11 +1477,11 @@ void ProjectExplorerPlugin::rebuildSession() qDebug() << "ProjectExplorerPlugin::rebuildSession"; if (saveModifiedFiles()) { - const QList<Project *> & projects = m_session->projectOrder(); + const QList<Project *> & projects = d->m_session->projectOrder(); const QStringList configs = configurations(projects); - m_buildManager->cleanProjects(projects, configs); - m_buildManager->buildProjects(projects, configs); + d->m_buildManager->cleanProjects(projects, configs); + d->m_buildManager->buildProjects(projects, configs); } } @@ -1430,7 +1491,7 @@ void ProjectExplorerPlugin::cleanProjectOnly() qDebug() << "ProjectExplorerPlugin::cleanProjectOnly"; if (saveModifiedFiles()) - m_buildManager->cleanProject(m_currentProject, m_currentProject->activeBuildConfiguration()); + d->m_buildManager->cleanProject(d->m_currentProject, d->m_currentProject->activeBuildConfiguration()); } void ProjectExplorerPlugin::cleanProject() @@ -1439,8 +1500,8 @@ void ProjectExplorerPlugin::cleanProject() qDebug() << "ProjectExplorerPlugin::cleanProject"; if (saveModifiedFiles()) { - const QList<Project *> & projects = m_session->projectOrder(m_currentProject); - m_buildManager->cleanProjects(projects, configurations(projects)); + const QList<Project *> & projects = d->m_session->projectOrder(d->m_currentProject); + d->m_buildManager->cleanProjects(projects, configurations(projects)); } } @@ -1450,8 +1511,8 @@ void ProjectExplorerPlugin::cleanSession() qDebug() << "ProjectExplorerPlugin::cleanSession"; if (saveModifiedFiles()) { - const QList<Project *> & projects = m_session->projectOrder(); - m_buildManager->cleanProjects(projects, configurations(projects)); + const QList<Project *> & projects = d->m_session->projectOrder(); + d->m_buildManager->cleanProjects(projects, configurations(projects)); } } @@ -1462,7 +1523,7 @@ void ProjectExplorerPlugin::runProject() void ProjectExplorerPlugin::runProjectContextMenu() { - runProjectImpl(m_currentProject); + runProjectImpl(d->m_currentProject); } void ProjectExplorerPlugin::runProjectImpl(Project *pro) @@ -1470,13 +1531,13 @@ void ProjectExplorerPlugin::runProjectImpl(Project *pro) if (!pro) return; - if (m_projectExplorerSettings.buildBeforeRun) { + if (d->m_projectExplorerSettings.buildBeforeRun) { if (saveModifiedFiles()) { - m_runMode = ProjectExplorer::Constants::RUNMODE; - m_delayedRunConfiguration = pro->activeRunConfiguration(); + d->m_runMode = ProjectExplorer::Constants::RUNMODE; + d->m_delayedRunConfiguration = pro->activeRunConfiguration(); - const QList<Project *> & projects = m_session->projectOrder(pro); - m_buildManager->buildProjects(projects, configurations(projects)); + const QList<Project *> & projects = d->m_session->projectOrder(pro); + d->m_buildManager->buildProjects(projects, configurations(projects)); } } else { executeRunConfiguration(pro->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE); @@ -1486,16 +1547,16 @@ void ProjectExplorerPlugin::runProjectImpl(Project *pro) void ProjectExplorerPlugin::debugProject() { Project *pro = startupProject(); - if (!pro || m_debuggingRunControl ) + if (!pro || d->m_debuggingRunControl ) return; - if (m_projectExplorerSettings.buildBeforeRun) { + if (d->m_projectExplorerSettings.buildBeforeRun) { if (saveModifiedFiles()) { - m_runMode = ProjectExplorer::Constants::DEBUGMODE; - m_delayedRunConfiguration = pro->activeRunConfiguration(); + d->m_runMode = ProjectExplorer::Constants::DEBUGMODE; + d->m_delayedRunConfiguration = pro->activeRunConfiguration(); - const QList<Project *> & projects = m_session->projectOrder(pro); - m_buildManager->buildProjects(projects, configurations(projects)); + const QList<Project *> & projects = d->m_session->projectOrder(pro); + d->m_buildManager->buildProjects(projects, configurations(projects)); updateRunAction(); } @@ -1506,23 +1567,23 @@ void ProjectExplorerPlugin::debugProject() void ProjectExplorerPlugin::addToApplicationOutputWindow(RunControl *rc, const QString &line) { - m_outputPane->appendOutput(rc, line); + d->m_outputPane->appendOutput(rc, line); } void ProjectExplorerPlugin::addToApplicationOutputWindowInline(RunControl *rc, const QString &line) { - m_outputPane->appendOutputInline(rc, line); + d->m_outputPane->appendOutputInline(rc, line); } void ProjectExplorerPlugin::addErrorToApplicationOutputWindow(RunControl *rc, const QString &error) { - m_outputPane->appendOutput(rc, error); + d->m_outputPane->appendOutput(rc, error); } void ProjectExplorerPlugin::runControlFinished() { - if (sender() == m_debuggingRunControl) - m_debuggingRunControl = 0; + if (sender() == d->m_debuggingRunControl) + d->m_debuggingRunControl = 0; updateRunAction(); } @@ -1550,28 +1611,28 @@ void ProjectExplorerPlugin::startupProjectChanged() } // NBS TODO implement more than one runner -IRunConfigurationRunner *ProjectExplorerPlugin::findRunner(QSharedPointer<RunConfiguration> config, const QString &mode) +IRunControlFactory *ProjectExplorerPlugin::findRunControlFactory(const QSharedPointer<RunConfiguration> &config, const QString &mode) { ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - const QList<IRunConfigurationRunner *> runners = pm->getObjects<IRunConfigurationRunner>(); - foreach (IRunConfigurationRunner *runner, runners) - if (runner->canRun(config, mode)) - return runner; + const QList<IRunControlFactory *> factories = pm->getObjects<IRunControlFactory>(); + foreach (IRunControlFactory *f, factories) + if (f->canRun(config, mode)) + return f; return 0; } void ProjectExplorerPlugin::updateRunAction() { const Project *project = startupProject(); - bool canRun = project && findRunner(project->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE); - const bool canDebug = project && !m_debuggingRunControl && findRunner(project->activeRunConfiguration(), ProjectExplorer::Constants::DEBUGMODE); - const bool building = m_buildManager->isBuilding(); - m_runAction->setEnabled(canRun && !building); + bool canRun = project && findRunControlFactory(project->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE); + const bool canDebug = project && !d->m_debuggingRunControl && findRunControlFactory(project->activeRunConfiguration(), ProjectExplorer::Constants::DEBUGMODE); + const bool building = d->m_buildManager->isBuilding(); + d->m_runAction->setEnabled(canRun && !building); - canRun = m_currentProject && findRunner(m_currentProject->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE); - m_runActionContextMenu->setEnabled(canRun && !building); + canRun = d->m_currentProject && findRunControlFactory(d->m_currentProject->activeRunConfiguration(), ProjectExplorer::Constants::RUNMODE); + d->m_runActionContextMenu->setEnabled(canRun && !building); - m_debugAction->setEnabled(canDebug && !building); + d->m_debugAction->setEnabled(canDebug && !building); } void ProjectExplorerPlugin::cancelBuild() @@ -1579,8 +1640,8 @@ void ProjectExplorerPlugin::cancelBuild() if (debug) qDebug() << "ProjectExplorerPlugin::cancelBuild"; - if (m_buildManager->isBuilding()) - m_buildManager->cancel(); + if (d->m_buildManager->isBuilding()) + d->m_buildManager->cancel(); } void ProjectExplorerPlugin::addToRecentProjects(const QString &fileName, const QString &displayName) @@ -1593,17 +1654,17 @@ void ProjectExplorerPlugin::addToRecentProjects(const QString &fileName, const Q QString prettyFileName(QDir::toNativeSeparators(fileName)); QList<QPair<QString, QString> >::iterator it; - for(it = m_recentProjects.begin(); it != m_recentProjects.end();) + for(it = d->m_recentProjects.begin(); it != d->m_recentProjects.end();) if ((*it).first == prettyFileName) - it = m_recentProjects.erase(it); + it = d->m_recentProjects.erase(it); else ++it; - if (m_recentProjects.count() > m_maxRecentProjects) - m_recentProjects.removeLast(); - m_recentProjects.prepend(qMakePair(prettyFileName, displayName)); + if (d->m_recentProjects.count() > d->m_maxRecentProjects) + d->m_recentProjects.removeLast(); + d->m_recentProjects.prepend(qMakePair(prettyFileName, displayName)); QFileInfo fi(prettyFileName); - m_lastOpenDirectory = fi.absolutePath(); + d->m_lastOpenDirectory = fi.absolutePath(); } void ProjectExplorerPlugin::updateRecentProjectMenu() @@ -1616,13 +1677,13 @@ void ProjectExplorerPlugin::updateRecentProjectMenu() QMenu *menu = aci->menu(); menu->clear(); - menu->setEnabled(!m_recentProjects.isEmpty()); + menu->setEnabled(!d->m_recentProjects.isEmpty()); //projects (ignore sessions, they used to be in this list) QList<QPair<QString, QString> >::const_iterator it, end; - end = m_recentProjects.constEnd(); - for (it = m_recentProjects.constBegin(); it != end; ++it) { + end = d->m_recentProjects.constEnd(); + for (it = d->m_recentProjects.constBegin(); it != end; ++it) { const QPair<QString, QString> &s = *it; if (s.first.endsWith(".qws")) continue; @@ -1649,7 +1710,7 @@ void ProjectExplorerPlugin::invalidateProject(Project *project) { if (debug) qDebug() << "ProjectExplorerPlugin::invalidateProject" << project->name(); - if (m_currentProject == project) { + if (d->m_currentProject == project) { // // Workaround for a bug in QItemSelectionModel // - currentChanged etc are not emitted if the @@ -1663,25 +1724,25 @@ void ProjectExplorerPlugin::invalidateProject(Project *project) void ProjectExplorerPlugin::goToTaskWindow() { - m_buildManager->gotoTaskWindow(); + d->m_buildManager->gotoTaskWindow(); } void ProjectExplorerPlugin::updateContextMenuActions() { - if (ProjectNode *projectNode = qobject_cast<ProjectNode*>(m_currentNode)) { + if (ProjectNode *projectNode = qobject_cast<ProjectNode*>(d->m_currentNode)) { const bool addFilesEnabled = projectNode->supportedActions().contains(ProjectNode::AddFile); - m_addExistingFilesAction->setEnabled(addFilesEnabled); - m_addNewFileAction->setEnabled(addFilesEnabled); - } else if (FileNode *fileNode = qobject_cast<FileNode*>(m_currentNode)) { + d->m_addExistingFilesAction->setEnabled(addFilesEnabled); + d->m_addNewFileAction->setEnabled(addFilesEnabled); + } else if (FileNode *fileNode = qobject_cast<FileNode*>(d->m_currentNode)) { const bool removeFileEnabled = fileNode->projectNode()->supportedActions().contains(ProjectNode::RemoveFile); - m_removeFileAction->setEnabled(removeFileEnabled); + d->m_removeFileAction->setEnabled(removeFileEnabled); } } void ProjectExplorerPlugin::addNewFile() { - QTC_ASSERT(m_currentNode, return) - QFileInfo fi(m_currentNode->path()); + QTC_ASSERT(d->m_currentNode, return) + QFileInfo fi(d->m_currentNode->path()); const QString location = (fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath()); Core::ICore::instance()->showNewItemDialog(tr("New File", "Title of dialog"), Core::IWizard::wizardsOfKind(Core::IWizard::FileWizard) @@ -1691,11 +1752,11 @@ void ProjectExplorerPlugin::addNewFile() void ProjectExplorerPlugin::addExistingFiles() { - QTC_ASSERT(m_currentNode, return) + QTC_ASSERT(d->m_currentNode, return) - ProjectNode *projectNode = qobject_cast<ProjectNode*>(m_currentNode->projectNode()); + ProjectNode *projectNode = qobject_cast<ProjectNode*>(d->m_currentNode->projectNode()); Core::ICore *core = Core::ICore::instance(); - QFileInfo fi(m_currentNode->path()); + QFileInfo fi(d->m_currentNode->path()); const QString dir = (fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath()); QStringList fileNames = QFileDialog::getOpenFileNames(core->mainWindow(), tr("Add Existing Files"), dir); if (fileNames.isEmpty()) @@ -1746,15 +1807,15 @@ void ProjectExplorerPlugin::addExistingFiles() void ProjectExplorerPlugin::openFile() { - QTC_ASSERT(m_currentNode, return) + QTC_ASSERT(d->m_currentNode, return) Core::EditorManager *em = Core::EditorManager::instance(); - em->openEditor(m_currentNode->path()); + em->openEditor(d->m_currentNode->path()); em->ensureEditorManagerVisible(); } void ProjectExplorerPlugin::showInGraphicalShell() { - QTC_ASSERT(m_currentNode, return) + QTC_ASSERT(d->m_currentNode, return) #if defined(Q_OS_WIN) QString explorer = Environment::systemEnvironment().searchInPath("explorer.exe"); if (explorer.isEmpty()) { @@ -1765,18 +1826,18 @@ void ProjectExplorerPlugin::showInGraphicalShell() } QProcess::execute(explorer, QStringList() << QString("/select,%1") - .arg(QDir::toNativeSeparators(m_currentNode->path()))); + .arg(QDir::toNativeSeparators(d->m_currentNode->path()))); #elif defined(Q_OS_MAC) QProcess::execute("/usr/bin/osascript", QStringList() << "-e" << QString("tell application \"Finder\" to reveal POSIX file \"%1\"") - .arg(m_currentNode->path())); + .arg(d->m_currentNode->path())); QProcess::execute("/usr/bin/osascript", QStringList() << "-e" << "tell application \"Finder\" to activate"); #else // we cannot select a file here, because no file browser really supports it... - QFileInfo fileInfo(m_currentNode->path()); + QFileInfo fileInfo(d->m_currentNode->path()); QString xdgopen = Environment::systemEnvironment().searchInPath("xdg-open"); if (xdgopen.isEmpty()) { QMessageBox::warning(Core::ICore::instance()->mainWindow(), @@ -1790,12 +1851,12 @@ void ProjectExplorerPlugin::showInGraphicalShell() void ProjectExplorerPlugin::removeFile() { - QTC_ASSERT(m_currentNode && m_currentNode->nodeType() == FileNodeType, return) + QTC_ASSERT(d->m_currentNode && d->m_currentNode->nodeType() == FileNodeType, return) - FileNode *fileNode = qobject_cast<FileNode*>(m_currentNode); + FileNode *fileNode = qobject_cast<FileNode*>(d->m_currentNode); Core::ICore *core = Core::ICore::instance(); - const QString filePath = m_currentNode->path(); + const QString filePath = d->m_currentNode->path(); const QString fileDir = QFileInfo(filePath).dir().absolutePath(); RemoveFileDialog removeFileDialog(filePath, core->mainWindow()); @@ -1848,24 +1909,24 @@ void ProjectExplorerPlugin::populateBuildConfigurationMenu() qDebug() << "ProjectExplorerPlugin::populateBuildConfigurationMenu"; // delete the old actiongroup and all actions that are children of it - delete m_buildConfigurationActionGroup; - m_buildConfigurationActionGroup = new QActionGroup(m_buildConfigurationMenu); - m_buildConfigurationMenu->clear(); - if (Project *pro = m_currentProject) { + delete d->m_buildConfigurationActionGroup; + d->m_buildConfigurationActionGroup = new QActionGroup(d->m_buildConfigurationMenu); + d->m_buildConfigurationMenu->clear(); + if (Project *pro = d->m_currentProject) { const QString &activeBuildConfiguration = pro->activeBuildConfiguration(); foreach (const QString &buildConfiguration, pro->buildConfigurations()) { QString displayName = pro->displayNameFor(buildConfiguration); - QAction *act = new QAction(displayName, m_buildConfigurationActionGroup); + QAction *act = new QAction(displayName, d->m_buildConfigurationActionGroup); if (debug) qDebug() << "BuildConfiguration " << buildConfiguration << "active: " << activeBuildConfiguration; act->setCheckable(true); act->setChecked(buildConfiguration == activeBuildConfiguration); act->setData(buildConfiguration); - m_buildConfigurationMenu->addAction(act); + d->m_buildConfigurationMenu->addAction(act); } - m_buildConfigurationMenu->setEnabled(true); + d->m_buildConfigurationMenu->setEnabled(true); } else { - m_buildConfigurationMenu->setEnabled(false); + d->m_buildConfigurationMenu->setEnabled(false); } } @@ -1874,7 +1935,7 @@ void ProjectExplorerPlugin::buildConfigurationMenuTriggered(QAction *action) if (debug) qDebug() << "ProjectExplorerPlugin::buildConfigurationMenuTriggered"; - m_currentProject->setActiveBuildConfiguration(action->data().toString()); + d->m_currentProject->setActiveBuildConfiguration(action->data().toString()); } void ProjectExplorerPlugin::populateRunConfigurationMenu() @@ -1882,23 +1943,23 @@ void ProjectExplorerPlugin::populateRunConfigurationMenu() if (debug) qDebug() << "ProjectExplorerPlugin::populateRunConfigurationMenu"; - delete m_runConfigurationActionGroup; - m_runConfigurationActionGroup = new QActionGroup(m_runConfigurationMenu); - m_runConfigurationMenu->clear(); + delete d->m_runConfigurationActionGroup; + d->m_runConfigurationActionGroup = new QActionGroup(d->m_runConfigurationMenu); + d->m_runConfigurationMenu->clear(); - const Project *startupProject = m_session->startupProject(); + const Project *startupProject = d->m_session->startupProject(); QSharedPointer<RunConfiguration> activeRunConfiguration = (startupProject) ? startupProject->activeRunConfiguration() : QSharedPointer<RunConfiguration>(0); - foreach (const Project *pro, m_session->projects()) { + foreach (const Project *pro, d->m_session->projects()) { foreach (QSharedPointer<RunConfiguration> runConfiguration, pro->runConfigurations()) { if (runConfiguration->isEnabled()) { const QString title = QString("%1 (%2)").arg(pro->name(), runConfiguration->name()); - QAction *act = new QAction(title, m_runConfigurationActionGroup); + QAction *act = new QAction(title, d->m_runConfigurationActionGroup); act->setCheckable(true); act->setData(qVariantFromValue(runConfiguration)); act->setChecked(runConfiguration == activeRunConfiguration); - m_runConfigurationMenu->addAction(act); + d->m_runConfigurationMenu->addAction(act); if (debug) qDebug() << "RunConfiguration" << runConfiguration << "project:" << pro->name() << "active:" << (runConfiguration == activeRunConfiguration); @@ -1906,7 +1967,7 @@ void ProjectExplorerPlugin::populateRunConfigurationMenu() } } - m_runConfigurationMenu->setDisabled(m_runConfigurationMenu->actions().isEmpty()); + d->m_runConfigurationMenu->setDisabled(d->m_runConfigurationMenu->actions().isEmpty()); } void ProjectExplorerPlugin::runConfigurationMenuTriggered(QAction *action) @@ -1924,7 +1985,7 @@ void ProjectExplorerPlugin::populateOpenWithMenu() typedef QList<Core::IEditorFactory*> EditorFactoryList; typedef QList<Core::IExternalEditor*> ExternalEditorList; - m_openWithMenu->clear(); + d->m_openWithMenu->clear(); bool anyMatches = false; const QString fileName = currentNode()->path(); @@ -1940,7 +2001,7 @@ void ProjectExplorerPlugin::populateOpenWithMenu() foreach (Core::IEditorFactory *editorFactory, factories) { // Add action to open with this very editor factory QString const actionTitle = qApp->translate("OpenWith::Editors", editorFactory->kind().toAscii()); - QAction * const action = m_openWithMenu->addAction(actionTitle); + QAction * const action = d->m_openWithMenu->addAction(actionTitle); action->setData(qVariantFromValue(editorFactory)); // File already open in an editor -> only enable that entry since // we currently do not support opening a file in two editors at once @@ -1956,12 +2017,12 @@ void ProjectExplorerPlugin::populateOpenWithMenu() } // for editor factories // Add all suitable external editors foreach (Core::IExternalEditor *externalEditor, externalEditors) { - QAction * const action = m_openWithMenu->addAction(qApp->translate("OpenWith::Editors", externalEditor->kind().toAscii())); + QAction * const action = d->m_openWithMenu->addAction(qApp->translate("OpenWith::Editors", externalEditor->kind().toAscii())); action->setData(qVariantFromValue(externalEditor)); } } // matches } - m_openWithMenu->setEnabled(anyMatches); + d->m_openWithMenu->setEnabled(anyMatches); } void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action) @@ -1986,42 +2047,42 @@ void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action) void ProjectExplorerPlugin::updateSessionMenu() { - m_sessionMenu->clear(); - QActionGroup *ag = new QActionGroup(m_sessionMenu); + d->m_sessionMenu->clear(); + QActionGroup *ag = new QActionGroup(d->m_sessionMenu); connect(ag, SIGNAL(triggered(QAction *)), this, SLOT(setSession(QAction *))); - const QString &activeSession = m_session->activeSession(); - foreach (const QString &session, m_session->sessions()) { + const QString &activeSession = d->m_session->activeSession(); + foreach (const QString &session, d->m_session->sessions()) { QAction *act = ag->addAction(session); act->setCheckable(true); if (session == activeSession) act->setChecked(true); } - m_sessionMenu->addActions(ag->actions()); - m_sessionMenu->addSeparator(); - m_sessionMenu->addAction(m_sessionManagerAction); + d->m_sessionMenu->addActions(ag->actions()); + d->m_sessionMenu->addSeparator(); + d->m_sessionMenu->addAction(d->m_sessionManagerAction); - m_sessionMenu->setEnabled(true); + d->m_sessionMenu->setEnabled(true); } void ProjectExplorerPlugin::setSession(QAction *action) { QString session = action->text(); - if (session != m_session->activeSession()) - m_session->loadSession(session); + if (session != d->m_session->activeSession()) + d->m_session->loadSession(session); } void ProjectExplorerPlugin::setProjectExplorerSettings(const Internal::ProjectExplorerSettings &pes) { - if (m_projectExplorerSettings == pes) + if (d->m_projectExplorerSettings == pes) return; - m_projectExplorerSettings = pes; + d->m_projectExplorerSettings = pes; emit settingsChanged(); } Internal::ProjectExplorerSettings ProjectExplorerPlugin::projectExplorerSettings() const { - return m_projectExplorerSettings; + return d->m_projectExplorerSettings; } Q_EXPORT_PLUGIN(ProjectExplorerPlugin) diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 636b47b0971f366865e6360f238e7b4ae67c7e77..4fe3b3d6f50ea253adf555e05f89e338905770a3 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -30,21 +30,16 @@ #ifndef PROJECTEXPLORER_H #define PROJECTEXPLORER_H -#include "project.h" -#include "session.h" #include "projectexplorer_export.h" #include <extensionsystem/iplugin.h> -#include <coreplugin/icorelistener.h> -#include <QtCore/QObject> #include <QtCore/QSharedPointer> -#include <QtCore/QList> -#include <QtCore/QQueue> -#include <QtCore/QModelIndex> -#include <QtGui/QMenu> -#include <QtGui/QTreeWidget> -#include <QtGui/QTreeWidgetItem> + +QT_BEGIN_NAMESPACE +class QPoint; +class QAction; +QT_END_NAMESPACE namespace Core { class IContext; @@ -55,42 +50,22 @@ class IFileFactory; } } -namespace Welcome { - class WelcomeMode; -} - namespace ProjectExplorer { class BuildManager; -class PersistentSettings; -class RunConfiguration; class RunControl; class SessionManager; -class IRunConfigurationRunner; +class RunConfiguration; +class IRunControlFactory; +class Project; +class Node; namespace Internal { -class ApplicationOutput; -class OutputPane; -class ProjectWindow; class ProjectFileFactory; -class ProjectWelcomePage; -class ProjectWelcomePageWidget; - -struct ProjectExplorerSettings -{ - bool buildBeforeRun; - bool saveBeforeBuild; - bool showCompilerOutput; - bool useJom; - bool operator==(const ProjectExplorerSettings &other) { - return this->buildBeforeRun == other.buildBeforeRun - && this->saveBeforeBuild == other.saveBeforeBuild - && this->showCompilerOutput == other.showCompilerOutput - && this->useJom == other.useJom; - } -}; - +struct ProjectExplorerSettings; } // namespace Internal +struct ProjectExplorerPluginPrivate; + class PROJECTEXPLORER_EXPORT ProjectExplorerPlugin : public ExtensionSystem::IPlugin { @@ -210,11 +185,11 @@ private slots: private: void runProjectImpl(Project *pro); - void executeRunConfiguration(QSharedPointer<RunConfiguration>, const QString &mode); + void executeRunConfiguration(const QSharedPointer<RunConfiguration> &, const QString &mode); void setCurrent(Project *project, QString filePath, Node *node); QStringList allFilesWithDependencies(Project *pro); - IRunConfigurationRunner *findRunner(QSharedPointer<RunConfiguration> config, const QString &mode); + IRunControlFactory *findRunControlFactory(const QSharedPointer<RunConfiguration> &config, const QString &mode); void updateActions(); void addToRecentProjects(const QString &fileName, const QString &displayName); @@ -222,90 +197,9 @@ private: Internal::ProjectFileFactory *findProjectFileFactory(const QString &filename) const; static ProjectExplorerPlugin *m_instance; - - QMenu *m_sessionContextMenu; - QMenu *m_sessionMenu; - QMenu *m_projectMenu; - QMenu *m_subProjectMenu; - QMenu *m_folderMenu; - QMenu *m_fileMenu; - QMenu *m_openWithMenu; - - QMultiMap<int, QObject*> m_actionMap; - QAction *m_sessionManagerAction; - QAction *m_newAction; -#if 0 - QAction *m_loadAction; -#endif - Core::Utils::ParameterAction *m_unloadAction; - QAction *m_clearSession; - QAction *m_buildProjectOnlyAction; - Core::Utils::ParameterAction *m_buildAction; - QAction *m_buildSessionAction; - QAction *m_rebuildProjectOnlyAction; - Core::Utils::ParameterAction *m_rebuildAction; - QAction *m_rebuildSessionAction; - QAction *m_cleanProjectOnlyAction; - Core::Utils::ParameterAction *m_cleanAction; - QAction *m_cleanSessionAction; - QAction *m_runAction; - QAction *m_runActionContextMenu; - QAction *m_cancelBuildAction; - QAction *m_debugAction; - QAction *m_addNewFileAction; - QAction *m_addExistingFilesAction; - QAction *m_openFileAction; - QAction *m_showInGraphicalShell; - QAction *m_removeFileAction; - QAction *m_renameFileAction; - - QMenu *m_buildConfigurationMenu; - QActionGroup *m_buildConfigurationActionGroup; - QMenu *m_runConfigurationMenu; - QActionGroup *m_runConfigurationActionGroup; - - Internal::ProjectWindow *m_proWindow; - SessionManager *m_session; - QString m_sessionToRestoreAtStartup; - - Project *m_currentProject; - Node *m_currentNode; - - BuildManager *m_buildManager; - - QList<Internal::ProjectFileFactory*> m_fileFactories; - QStringList m_profileMimeTypes; - Internal::OutputPane *m_outputPane; - - QList<QPair<QString, QString> > m_recentProjects; // pair of filename, displayname - static const int m_maxRecentProjects = 7; - - QString m_lastOpenDirectory; - QSharedPointer<RunConfiguration> m_delayedRunConfiguration; - RunControl *m_debuggingRunControl; - QString m_runMode; - QString m_projectFilterString; - Internal::ProjectExplorerSettings m_projectExplorerSettings; - Internal::ProjectWelcomePage *m_welcomePlugin; - Internal::ProjectWelcomePageWidget *m_welcomePage; + ProjectExplorerPluginPrivate *d; }; -namespace Internal { - -class CoreListenerCheckingForRunningBuild : public Core::ICoreListener -{ - Q_OBJECT -public: - CoreListenerCheckingForRunningBuild(BuildManager *manager); - - bool coreAboutToClose(); - -private: - BuildManager *m_manager; -}; - -} // namespace Internal - } // namespace ProjectExplorer #endif // PROJECTEXPLORER_H diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index 0eb977404e3fc86d83fedb45b32b02d8959820f8..28b3cefeeacb29c81dceaeaddec9e400a0d4bcea 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -21,6 +21,8 @@ HEADERS += projectexplorer.h \ allprojectsfilter.h \ buildparserinterface.h \ projectexplorerconstants.h \ + projectexplorersettings.h \ + corelistenercheckingforrunningbuild.h \ project.h \ pluginfilefactory.h \ iprojectmanager.h \ @@ -115,7 +117,9 @@ SOURCES += projectexplorer.cpp \ abstractmakestep.cpp \ projectexplorersettingspage.cpp \ projectwelcomepage.cpp \ - projectwelcomepagewidget.cpp + projectwelcomepagewidget.cpp \ + corelistenercheckingforrunningbuild.cpp + FORMS += processstep.ui \ editorsettingspropertiespage.ui \ runsettingspropertiespage.ui \ diff --git a/src/plugins/projectexplorer/projectexplorersettings.h b/src/plugins/projectexplorer/projectexplorersettings.h new file mode 100644 index 0000000000000000000000000000000000000000..995b4dface32a187bd5ff4baa3da56c32aa6ecdd --- /dev/null +++ b/src/plugins/projectexplorer/projectexplorersettings.h @@ -0,0 +1,53 @@ +/************************************************************************** +** +** This file is part of Qt Creator +** +** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +** +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** Commercial Usage +** +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** +**************************************************************************/ + +#ifndef PROJECTEXPLORERSETTINGS_H +#define PROJECTEXPLORERSETTINGS_H + +namespace ProjectExplorer { +namespace Internal { + +struct ProjectExplorerSettings +{ + bool buildBeforeRun; + bool saveBeforeBuild; + bool showCompilerOutput; + bool useJom; + bool operator==(const ProjectExplorerSettings &other) const { + return this->buildBeforeRun == other.buildBeforeRun + && this->saveBeforeBuild == other.saveBeforeBuild + && this->showCompilerOutput == other.showCompilerOutput + && this->useJom == other.useJom; + } +}; + +} // namespace ProjectExplorer +} // namespace Internal + +#endif // PROJECTEXPLORERSETTINGS_H diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp index 2998090303ce1e968f2910b03133748c21deeeed..a3ce68b585f338d8d503a335863bbb6bdb6745c9 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp +++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp @@ -28,6 +28,7 @@ **************************************************************************/ #include "projectexplorersettingspage.h" +#include "projectexplorersettings.h" #include "projectexplorerconstants.h" #include "projectexplorer.h" diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp index 175b32c520b3283a57fa927e730ee773af516d9e..ac5e65f2077e9d8f5940e30da74b78f800ca58bd 100644 --- a/src/plugins/projectexplorer/projectfilewizardextension.cpp +++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp @@ -29,6 +29,7 @@ #include "projectfilewizardextension.h" #include "projectexplorer.h" +#include "session.h" #include "projectnodes.h" #include "nodesvisitor.h" #include "projectwizardpage.h" diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 5ed4f4b4f1eaa05fdf7211ec0a9883de8249ff78..dc22cc1f5da429b1576cf071f6f70e8525fa7ceb 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -30,6 +30,8 @@ #include "projecttreewidget.h" #include "projectexplorer.h" +#include "project.h" +#include "session.h" #include "projectexplorerconstants.h" #include "projectmodels.h" @@ -44,6 +46,7 @@ #include <QtGui/QVBoxLayout> #include <QtGui/QToolButton> #include <QtGui/QFocusEvent> +#include <QtGui/QAction> #include <QtGui/QPalette> using namespace ProjectExplorer; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index a55e36307e87b52fa0daa1650e59dfabef5976b6..52c9ac5de669095295398dfaa248ae12c07a2d4f 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -88,21 +88,21 @@ IRunConfigurationFactory::~IRunConfigurationFactory() { } -IRunConfigurationRunner::IRunConfigurationRunner(QObject *parent) +IRunControlFactory::IRunControlFactory(QObject *parent) : QObject(parent) { } -IRunConfigurationRunner::~IRunConfigurationRunner() +IRunControlFactory::~IRunControlFactory() { } -RunControl::RunControl(QSharedPointer<RunConfiguration> runConfiguration) +RunControl::RunControl(const QSharedPointer<RunConfiguration> &runConfiguration) : m_runConfiguration(runConfiguration) { } -QSharedPointer<RunConfiguration> RunControl::runConfiguration() +QSharedPointer<RunConfiguration> RunControl::runConfiguration() const { return m_runConfiguration; } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index c72d671631df1e9158332c59d86d8e5c9ca7bf5c..07f1ad795614f7da69763d1edc0f20c21da8ee33 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -65,11 +65,11 @@ class PROJECTEXPLORER_EXPORT RunConfiguration : public QObject { Q_OBJECT public: - RunConfiguration(Project *project); + explicit RunConfiguration(Project *project); virtual ~RunConfiguration(); Project *project() const; - // The type of this RunConfiguration, e.g. "ProjectExplorer.ApplicationRunConfiguration" + // The type of this RunConfiguration, e.g. "ProjectExplorer.LocalApplicationRunConfiguration" virtual QString type() const = 0; // Name shown to the user QString name() const; @@ -102,7 +102,7 @@ class PROJECTEXPLORER_EXPORT IRunConfigurationFactory : public QObject { Q_OBJECT public: - IRunConfigurationFactory(QObject *parent = 0); + explicit IRunConfigurationFactory(QObject *parent = 0); virtual ~IRunConfigurationFactory(); // used to recreate the runConfigurations when restoring settings virtual bool canRestore(const QString &type) const = 0; @@ -114,19 +114,20 @@ public: virtual QSharedPointer<RunConfiguration> create(Project *project, const QString &type) = 0; }; -class PROJECTEXPLORER_EXPORT IRunConfigurationRunner : public QObject +class PROJECTEXPLORER_EXPORT IRunControlFactory : public QObject { Q_OBJECT public: - IRunConfigurationRunner(QObject *parent = 0); - virtual ~IRunConfigurationRunner(); - virtual bool canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) = 0; - virtual RunControl* run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) = 0; + explicit IRunControlFactory(QObject *parent = 0); + virtual ~IRunControlFactory(); + + virtual bool canRun(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) const = 0; + virtual RunControl* create(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) = 0; virtual QString displayName() const = 0; // Returns the widget used to configure this runner. Ownership is transferred to the caller - virtual QWidget *configurationWidget(QSharedPointer<RunConfiguration> runConfiguration) = 0; + virtual QWidget *configurationWidget(const QSharedPointer<RunConfiguration> &runConfiguration) = 0; }; /* Each instance of this class represents one item that is run. @@ -134,12 +135,12 @@ public: class PROJECTEXPLORER_EXPORT RunControl : public QObject { Q_OBJECT public: - RunControl(QSharedPointer<RunConfiguration> runConfiguration); + explicit RunControl(const QSharedPointer<RunConfiguration> &runConfiguration); virtual ~RunControl(); virtual void start() = 0; virtual void stop() = 0; virtual bool isRunning() const = 0; - QSharedPointer<RunConfiguration> runConfiguration(); + QSharedPointer<RunConfiguration> runConfiguration() const; signals: void addToOutputWindow(RunControl *, const QString &line); void addToOutputWindowInline(RunControl *, const QString &line); @@ -152,7 +153,7 @@ private slots: void bringApplicationToForegroundInternal(); private: - QSharedPointer<RunConfiguration> m_runConfiguration; + const QSharedPointer<RunConfiguration> m_runConfiguration; #ifdef Q_OS_MAC //these two are used to bring apps in the foreground on Mac diff --git a/src/plugins/projectexplorer/runsettingspropertiespage.cpp b/src/plugins/projectexplorer/runsettingspropertiespage.cpp index ef4390de5e8abf7b2e4de5b60813d0beae4a9329..e31e8ef3110411ef8a195076dfddd5fa5fdd9c78 100644 --- a/src/plugins/projectexplorer/runsettingspropertiespage.cpp +++ b/src/plugins/projectexplorer/runsettingspropertiespage.cpp @@ -206,8 +206,8 @@ RunSettingsWidget::RunSettingsWidget(Project *project) // TODO: Add support for custom runner configuration widgets once we have some /* - QList<IRunConfigurationRunner *> runners = PluginManager::instance()->getObjects<IRunConfigurationRunner>(); - foreach (IRunConfigurationRunner * runner, runners) { + QList<IRunControlFactory *> runners = PluginManager::instance()->getObjects<IRunControlFactory>(); + foreach (IRunControlFactory * runner, runners) { if (runner->canRun(activeRunConfiguration)) m_ui->layout->addWidget(runner->configurationWidget(activeRunConfiguration)); } diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index b256b5e3ed147df3cbef0828f355440183d95a2e..dac5ad20a2ed6d75972f297639d886a7b3cc3087 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -29,6 +29,7 @@ #include "toolchain.h" #include "cesdkhandler.h" +#include "projectexplorersettings.h" #include <QtCore/QFileInfo> #include <QtCore/QProcess> diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 99fe21c147f91fe6e605dd5d41906509941257b7..9d7bcde602f46ba946e03e9ba77ca984e86c1186 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -325,7 +325,7 @@ void QmlProjectFile::modified(ReloadBehavior *) } QmlRunConfiguration::QmlRunConfiguration(QmlProject *pro) - : ProjectExplorer::ApplicationRunConfiguration(pro), + : ProjectExplorer::LocalApplicationRunConfiguration(pro), m_project(pro), m_type(Constants::QMLRUNCONFIGURATION) { @@ -455,7 +455,7 @@ void QmlRunConfiguration::onQmlViewerChanged() void QmlRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writer) const { - ProjectExplorer::ApplicationRunConfiguration::save(writer); + ProjectExplorer::LocalApplicationRunConfiguration::save(writer); writer.saveValue(QLatin1String("qmlviewer"), m_qmlViewer); writer.saveValue(QLatin1String("mainscript"), m_scriptFile); @@ -463,7 +463,7 @@ void QmlRunConfiguration::save(ProjectExplorer::PersistentSettingsWriter &writer void QmlRunConfiguration::restore(const ProjectExplorer::PersistentSettingsReader &reader) { - ProjectExplorer::ApplicationRunConfiguration::restore(reader); + ProjectExplorer::LocalApplicationRunConfiguration::restore(reader); m_qmlViewer = reader.restoreValue(QLatin1String("qmlviewer")).toString(); m_scriptFile = reader.restoreValue(QLatin1String("mainscript")).toString(); diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index df24dbfb3821000cca821be2f0c4adc815b385df..90ee0c99f7b4a2ba918080819a8d81cb3656fa5c 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -141,7 +141,7 @@ private: QString m_fileName; }; -class QmlRunConfiguration : public ProjectExplorer::ApplicationRunConfiguration +class QmlRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration { Q_OBJECT public: diff --git a/src/plugins/qmlprojectmanager/qmlprojectconstants.h b/src/plugins/qmlprojectmanager/qmlprojectconstants.h index c19034b8400f488fed5b6d19ab9c1118aa85274c..77c2290e6edad108bf6707fb7cf9572288bc6fb1 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectconstants.h +++ b/src/plugins/qmlprojectmanager/qmlprojectconstants.h @@ -37,7 +37,7 @@ const char *const PROJECTCONTEXT = "QmlProject.ProjectContext"; const char *const LANG_QML = "QML"; const char *const QMLMIMETYPE = "text/x-qml-project"; // ### FIXME -const char *const QMLRUNCONFIGURATION = "QmlProject.QmlApplicationRunConfiguration"; +const char *const QMLRUNCONFIGURATION = "QmlProject.QmlLocalApplicationRunConfiguration"; const char *const MAKESTEP = "QmlProject.QmlMakeStep"; // contexts diff --git a/src/plugins/qt4projectmanager/deployhelper.cpp b/src/plugins/qt4projectmanager/deployhelper.cpp index 9f4c10297ddf243a384f22b22daea8deab7092a6..1d635ce7ce3f8ae3b5ee43f8146cc0d6b77ce0ef 100644 --- a/src/plugins/qt4projectmanager/deployhelper.cpp +++ b/src/plugins/qt4projectmanager/deployhelper.cpp @@ -166,7 +166,7 @@ void DeployHelperRunStep::cleanup() void DeployHelperRunStep::readyRead() { - // TODO Unbreak the application output (this whole thing should be moved to a IRunConfigurationRunner) + // TODO Unbreak the application output (this whole thing should be moved to a IRunControlFactory) QProcess * proc = qobject_cast<QProcess *>(sender()); while (proc->canReadLine()) { QString line = proc->readLine().trimmed(); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index ac2cb33273101be9f9259043f6c27271fbc9bb43..fc1000f38e101e7b2896d4b1938c3f277f178985 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -481,42 +481,39 @@ QSharedPointer<RunConfiguration> S60DeviceRunConfigurationFactory::create(Projec return rc; } -// ======== S60DeviceRunConfigurationRunner +// ======== S60DeviceRunControlFactory -S60DeviceRunConfigurationRunner::S60DeviceRunConfigurationRunner(QObject *parent) - : IRunConfigurationRunner(parent) +S60DeviceRunControlFactory::S60DeviceRunControlFactory(QObject *parent) + : IRunControlFactory(parent) { } -bool S60DeviceRunConfigurationRunner::canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) +bool S60DeviceRunControlFactory::canRun(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) const { return (mode == ProjectExplorer::Constants::RUNMODE) && (!runConfiguration.objectCast<S60DeviceRunConfiguration>().isNull()); } -RunControl* S60DeviceRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) +RunControl* S60DeviceRunControlFactory::create(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) { QSharedPointer<S60DeviceRunConfiguration> rc = runConfiguration.objectCast<S60DeviceRunConfiguration>(); - Q_ASSERT(!rc.isNull()); - Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE); - - S60DeviceRunControl *runControl = new S60DeviceRunControl(rc); - return runControl; + QTC_ASSERT(!rc.isNull() && mode == ProjectExplorer::Constants::RUNMODE, return 0); + return new S60DeviceRunControl(rc); } -QString S60DeviceRunConfigurationRunner::displayName() const +QString S60DeviceRunControlFactory::displayName() const { return tr("Run on Device"); } -QWidget *S60DeviceRunConfigurationRunner::configurationWidget(QSharedPointer<ProjectExplorer::RunConfiguration> /* runConfiguration */) +QWidget *S60DeviceRunControlFactory::configurationWidget(const QSharedPointer<ProjectExplorer::RunConfiguration> & /* runConfiguration */) { return 0; } // ======== S60DeviceRunControl -S60DeviceRunControl::S60DeviceRunControl(QSharedPointer<RunConfiguration> runConfiguration) +S60DeviceRunControl::S60DeviceRunControl(const QSharedPointer<RunConfiguration> &runConfiguration) : RunControl(runConfiguration), m_launcher(0) { m_makesis = new QProcess(this); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h index 6afa85d22993e79d278cfeff3e97cb37609547ff..626b9625148a0f2b64617759416866a364a55853 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h @@ -52,7 +52,7 @@ public: SignCustom }; - S60DeviceRunConfiguration(ProjectExplorer::Project *project, const QString &proFilePath); + explicit S60DeviceRunConfiguration(ProjectExplorer::Project *project, const QString &proFilePath); ~S60DeviceRunConfiguration(); QString type() const; @@ -98,7 +98,7 @@ class S60DeviceRunConfigurationWidget : public QWidget { Q_OBJECT public: - S60DeviceRunConfigurationWidget(S60DeviceRunConfiguration *runConfiguration, + explicit S60DeviceRunConfigurationWidget(S60DeviceRunConfiguration *runConfiguration, QWidget *parent = 0); private slots: @@ -122,7 +122,7 @@ class S60DeviceRunConfigurationFactory : public ProjectExplorer::IRunConfigurati { Q_OBJECT public: - S60DeviceRunConfigurationFactory(QObject *parent); + explicit S60DeviceRunConfigurationFactory(QObject *parent); ~S60DeviceRunConfigurationFactory(); bool canRestore(const QString &type) const; QStringList availableCreationTypes(ProjectExplorer::Project *pro) const; @@ -131,22 +131,22 @@ public: QSharedPointer<ProjectExplorer::RunConfiguration> create(ProjectExplorer::Project *project, const QString &type); }; -class S60DeviceRunConfigurationRunner : public ProjectExplorer::IRunConfigurationRunner +class S60DeviceRunControlFactory : public ProjectExplorer::IRunControlFactory { Q_OBJECT public: - S60DeviceRunConfigurationRunner(QObject *parent = 0); - bool canRun(QSharedPointer<ProjectExplorer::RunConfiguration> runConfiguration, const QString &mode); - ProjectExplorer::RunControl* run(QSharedPointer<ProjectExplorer::RunConfiguration> runConfiguration, const QString &mode); + explicit S60DeviceRunControlFactory(QObject *parent = 0); + bool canRun(const QSharedPointer<ProjectExplorer::RunConfiguration> &runConfiguration, const QString &mode) const; + ProjectExplorer::RunControl* create(const QSharedPointer<ProjectExplorer::RunConfiguration> &runConfiguration, const QString &mode); QString displayName() const; - QWidget *configurationWidget(QSharedPointer<ProjectExplorer::RunConfiguration> runConfiguration); + QWidget *configurationWidget(const QSharedPointer<ProjectExplorer::RunConfiguration> &runConfiguration); }; class S60DeviceRunControl : public ProjectExplorer::RunControl { Q_OBJECT public: - S60DeviceRunControl(QSharedPointer<ProjectExplorer::RunConfiguration> runConfiguration); + explicit S60DeviceRunControl(const QSharedPointer<ProjectExplorer::RunConfiguration> &runConfiguration); ~S60DeviceRunControl() {} void start(); void stop(); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp index b6894eda92f61a617a2a044010d4663df89d9d95..bd53d834dc6195670756f3ffc8c9d4411f08989f 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp @@ -254,42 +254,39 @@ QSharedPointer<RunConfiguration> S60EmulatorRunConfigurationFactory::create(Proj return rc; } -// ======== S60EmulatorRunConfigurationRunner +// ======== S60EmulatorRunControlFactory -S60EmulatorRunConfigurationRunner::S60EmulatorRunConfigurationRunner(QObject *parent) - : IRunConfigurationRunner(parent) +S60EmulatorRunControlFactory::S60EmulatorRunControlFactory(QObject *parent) + : IRunControlFactory(parent) { } -bool S60EmulatorRunConfigurationRunner::canRun(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) +bool S60EmulatorRunControlFactory::canRun(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) const { return (mode == ProjectExplorer::Constants::RUNMODE) && (!runConfiguration.objectCast<S60EmulatorRunConfiguration>().isNull()); } -RunControl* S60EmulatorRunConfigurationRunner::run(QSharedPointer<RunConfiguration> runConfiguration, const QString &mode) +RunControl* S60EmulatorRunControlFactory::create(const QSharedPointer<RunConfiguration> &runConfiguration, const QString &mode) { QSharedPointer<S60EmulatorRunConfiguration> rc = runConfiguration.objectCast<S60EmulatorRunConfiguration>(); - Q_ASSERT(!rc.isNull()); - Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE); - - S60EmulatorRunControl *runControl = new S60EmulatorRunControl(rc); - return runControl; + QTC_ASSERT(!rc.isNull() && mode == ProjectExplorer::Constants::RUNMODE, return 0); + return new S60EmulatorRunControl(rc); } -QString S60EmulatorRunConfigurationRunner::displayName() const +QString S60EmulatorRunControlFactory::displayName() const { return tr("Run in Emulator"); } -QWidget *S60EmulatorRunConfigurationRunner::configurationWidget(QSharedPointer<ProjectExplorer::RunConfiguration> /* runConfiguration */) +QWidget *S60EmulatorRunControlFactory::configurationWidget(const QSharedPointer<ProjectExplorer::RunConfiguration> & /* runConfiguration */) { return 0; } // ======== S60EmulatorRunControl -S60EmulatorRunControl::S60EmulatorRunControl(QSharedPointer<RunConfiguration> runConfiguration) +S60EmulatorRunControl::S60EmulatorRunControl(const QSharedPointer<RunConfiguration> &runConfiguration) : RunControl(runConfiguration) { connect(&m_applicationLauncher, SIGNAL(applicationError(QString)), diff --git a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h index eca4482b16274ad1a0e93cd7fcb8f016b7b48306..30b7d31303e7f0658aba38b351d64f3cd70be349 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h @@ -90,7 +90,7 @@ class S60EmulatorRunConfigurationFactory : public ProjectExplorer::IRunConfigura { Q_OBJECT public: - S60EmulatorRunConfigurationFactory(QObject *parent); + explicit S60EmulatorRunConfigurationFactory(QObject *parent); ~S60EmulatorRunConfigurationFactory(); bool canRestore(const QString &type) const; QStringList availableCreationTypes(ProjectExplorer::Project *pro) const; @@ -99,22 +99,22 @@ public: QSharedPointer<ProjectExplorer::RunConfiguration> create(ProjectExplorer::Project *project, const QString &type); }; -class S60EmulatorRunConfigurationRunner : public ProjectExplorer::IRunConfigurationRunner +class S60EmulatorRunControlFactory : public ProjectExplorer::IRunControlFactory { Q_OBJECT public: - S60EmulatorRunConfigurationRunner(QObject *parent = 0); - bool canRun(QSharedPointer<ProjectExplorer::RunConfiguration> runConfiguration, const QString &mode); - ProjectExplorer::RunControl* run(QSharedPointer<ProjectExplorer::RunConfiguration> runConfiguration, const QString &mode); + explicit S60EmulatorRunControlFactory(QObject *parent = 0); + bool canRun(const QSharedPointer<ProjectExplorer::RunConfiguration> &runConfiguration, const QString &mode) const; + ProjectExplorer::RunControl* create(const QSharedPointer<ProjectExplorer::RunConfiguration> &runConfiguration, const QString &mode); QString displayName() const; - QWidget *configurationWidget(QSharedPointer<ProjectExplorer::RunConfiguration> runConfiguration); + QWidget *configurationWidget(const QSharedPointer<ProjectExplorer::RunConfiguration> &runConfiguration); }; class S60EmulatorRunControl : public ProjectExplorer::RunControl { Q_OBJECT public: - S60EmulatorRunControl(QSharedPointer<ProjectExplorer::RunConfiguration> runConfiguration); + explicit S60EmulatorRunControl(const QSharedPointer<ProjectExplorer::RunConfiguration> &runConfiguration); ~S60EmulatorRunControl() {} void start(); void stop(); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp index bd14470ee4d5c68fcbfeaa2d1c96f16a20c1fad5..06198963bd02c3f637f6806da71a715c06062350 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp @@ -57,9 +57,9 @@ S60Manager::S60Manager(QObject *parent) m_devices(new S60Devices(this)), m_devicesPreferencePane(new S60DevicesPreferencePane(m_devices, this)), m_s60EmulatorRunConfigurationFactory(new S60EmulatorRunConfigurationFactory(this)), - m_s60EmulatorRunConfigurationRunner(new S60EmulatorRunConfigurationRunner(this)), + m_s60EmulatorRunConfigurationRunner(new S60EmulatorRunControlFactory(this)), m_s60DeviceRunConfigurationFactory(new S60DeviceRunConfigurationFactory(this)), - m_s60DeviceRunConfigurationRunner(new S60DeviceRunConfigurationRunner(this)), + m_s60DeviceRunConfigurationRunner(new S60DeviceRunControlFactory(this)), m_serialDeviceLister(new SerialDeviceLister(this)) { m_instance = this; diff --git a/src/plugins/qt4projectmanager/qt-s60/s60manager.h b/src/plugins/qt4projectmanager/qt-s60/s60manager.h index 963e18777c242cda9799ea07748c997a94661af6..3853a5cdf6211645a3fd2b650846f47156f8f5c8 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60manager.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60manager.h @@ -44,9 +44,9 @@ namespace Internal { class S60DevicesPreferencePane; class S60EmulatorRunConfigurationFactory; -class S60EmulatorRunConfigurationRunner; +class S60EmulatorRunControlFactory; class S60DeviceRunConfigurationFactory; -class S60DeviceRunConfigurationRunner; +class S60DeviceRunControlFactory; class S60Manager : public QObject { @@ -75,9 +75,9 @@ private: S60Devices *m_devices; S60DevicesPreferencePane *m_devicesPreferencePane; S60EmulatorRunConfigurationFactory *m_s60EmulatorRunConfigurationFactory; - S60EmulatorRunConfigurationRunner *m_s60EmulatorRunConfigurationRunner; + S60EmulatorRunControlFactory *m_s60EmulatorRunConfigurationRunner; S60DeviceRunConfigurationFactory *m_s60DeviceRunConfigurationFactory; - S60DeviceRunConfigurationRunner *m_s60DeviceRunConfigurationRunner; + S60DeviceRunControlFactory *m_s60DeviceRunConfigurationRunner; SerialDeviceLister *m_serialDeviceLister; }; diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index 51a8397674ddfaf28661ead3501ed7c06adcccb6..f0e9c56a0b6269227720917a5d1ab77402e8c323 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -44,6 +44,7 @@ #include <coreplugin/iversioncontrol.h> #include <coreplugin/vcsmanager.h> #include <projectexplorer/buildmanager.h> +#include <projectexplorer/session.h> #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <utils/listutils.h> diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index 35c4d1f8893cb35bb180dab0a79f8a7c68cf2508..468e9a260a2b7f035020d8d5b6b3a936e094f176 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -55,6 +55,7 @@ #include <extensionsystem/pluginmanager.h> #include <projectexplorer/buildmanager.h> #include <projectexplorer/project.h> +#include <projectexplorer/session.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectnodes.h> diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp index 76e25d0a79445019ab8b27ddee19c7f0218d62ef..99930d066dc942597ddc95669af9f547adadaf79 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp @@ -52,12 +52,12 @@ using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager; -using ProjectExplorer::ApplicationRunConfiguration; +using ProjectExplorer::LocalApplicationRunConfiguration; using ProjectExplorer::PersistentSettingsReader; using ProjectExplorer::PersistentSettingsWriter; Qt4RunConfiguration::Qt4RunConfiguration(Qt4Project *pro, const QString &proFilePath) - : ApplicationRunConfiguration(pro), + : LocalApplicationRunConfiguration(pro), m_proFilePath(proFilePath), m_runMode(Gui), m_userSetName(false), @@ -152,7 +152,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run toplayout->addRow(argumentsLabel, m_argumentsLineEdit); m_useTerminalCheck = new QCheckBox(tr("Run in Terminal")); - m_useTerminalCheck->setChecked(m_qt4RunConfiguration->runMode() == ProjectExplorer::ApplicationRunConfiguration::Console); + m_useTerminalCheck->setChecked(m_qt4RunConfiguration->runMode() == ProjectExplorer::LocalApplicationRunConfiguration::Console); toplayout->addRow(QString(), m_useTerminalCheck); #ifdef Q_OS_MAC @@ -237,8 +237,8 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run this, SLOT(commandLineArgumentsChanged(QString))); connect(qt4RunConfiguration, SIGNAL(nameChanged(QString)), this, SLOT(nameChanged(QString))); - connect(qt4RunConfiguration, SIGNAL(runModeChanged(ProjectExplorer::ApplicationRunConfiguration::RunMode)), - this, SLOT(runModeChanged(ProjectExplorer::ApplicationRunConfiguration::RunMode))); + connect(qt4RunConfiguration, SIGNAL(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode)), + this, SLOT(runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode))); connect(qt4RunConfiguration, SIGNAL(usingDyldImageSuffixChanged(bool)), this, SLOT(usingDyldImageSuffixChanged(bool))); connect(qt4RunConfiguration, SIGNAL(effectiveTargetInformationChanged()), @@ -263,7 +263,7 @@ void Qt4RunConfigurationWidget::updateSummary() QString text = tr("Running executable: <b>%1</b> %2 %3").arg( filename, arguments, - m_qt4RunConfiguration->runMode() == ApplicationRunConfiguration::Console ? tr("(in terminal)") : ""); + m_qt4RunConfiguration->runMode() == LocalApplicationRunConfiguration::Console ? tr("(in terminal)") : ""); m_summaryLabel->setText(text); } @@ -332,8 +332,8 @@ void Qt4RunConfigurationWidget::nameEdited(const QString &name) void Qt4RunConfigurationWidget::termToggled(bool on) { m_ignoreChange = true; - m_qt4RunConfiguration->setRunMode(on ? ApplicationRunConfiguration::Console - : ApplicationRunConfiguration::Gui); + m_qt4RunConfiguration->setRunMode(on ? LocalApplicationRunConfiguration::Console + : LocalApplicationRunConfiguration::Gui); m_ignoreChange = false; } @@ -364,11 +364,11 @@ void Qt4RunConfigurationWidget::nameChanged(const QString &name) m_nameLineEdit->setText(name); } -void Qt4RunConfigurationWidget::runModeChanged(ApplicationRunConfiguration::RunMode runMode) +void Qt4RunConfigurationWidget::runModeChanged(LocalApplicationRunConfiguration::RunMode runMode) { updateSummary(); if (!m_ignoreChange) - m_useTerminalCheck->setChecked(runMode == ApplicationRunConfiguration::Console); + m_useTerminalCheck->setChecked(runMode == LocalApplicationRunConfiguration::Console); } void Qt4RunConfigurationWidget::usingDyldImageSuffixChanged(bool state) @@ -419,12 +419,12 @@ void Qt4RunConfiguration::save(PersistentSettingsWriter &writer) const writer.saveValue("BaseEnvironmentBase", m_baseEnvironmentBase); writer.saveValue("UserSetWorkingDirectory", m_userSetWokingDirectory); writer.saveValue("UserWorkingDirectory", m_userWorkingDirectory); - ApplicationRunConfiguration::save(writer); + LocalApplicationRunConfiguration::save(writer); } void Qt4RunConfiguration::restore(const PersistentSettingsReader &reader) { - ApplicationRunConfiguration::restore(reader); + LocalApplicationRunConfiguration::restore(reader); const QDir projectDir = QFileInfo(project()->file()->fileName()).absoluteDir(); m_commandLineArguments = reader.restoreValue("CommandLineArguments").toStringList(); m_proFilePath = projectDir.filePath(reader.restoreValue("ProFile").toString()); @@ -450,7 +450,7 @@ QString Qt4RunConfiguration::executable() const return m_executable; } -ApplicationRunConfiguration::RunMode Qt4RunConfiguration::runMode() const +LocalApplicationRunConfiguration::RunMode Qt4RunConfiguration::runMode() const { return m_runMode; } diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.h b/src/plugins/qt4projectmanager/qt4runconfiguration.h index 24f764147d24588c5ff422ad88b36419047f5a96..63853a17ae0e4615c75d6361284d981bee2e4099 100644 --- a/src/plugins/qt4projectmanager/qt4runconfiguration.h +++ b/src/plugins/qt4projectmanager/qt4runconfiguration.h @@ -55,7 +55,7 @@ namespace Internal { class Qt4PriFileNode; -class Qt4RunConfiguration : public ProjectExplorer::ApplicationRunConfiguration +class Qt4RunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration { Q_OBJECT // to change the name and arguments and set the userenvironmentchanges @@ -97,7 +97,7 @@ signals: void nameChanged(const QString&); void commandLineArgumentsChanged(const QString&); void workingDirectoryChanged(const QString&); - void runModeChanged(ProjectExplorer::ApplicationRunConfiguration::RunMode runMode); + void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode); void usingDyldImageSuffixChanged(bool); void baseEnvironmentChanged(); void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff); @@ -130,7 +130,7 @@ private: QStringList m_targets; QString m_executable; QString m_workingDir; - ProjectExplorer::ApplicationRunConfiguration::RunMode m_runMode; + ProjectExplorer::LocalApplicationRunConfiguration::RunMode m_runMode; bool m_userSetName; bool m_cachedTargetInformationValid; bool m_isUsingDyldImageSuffix; @@ -158,7 +158,7 @@ private slots: void workingDirectoryChanged(const QString &workingDirectory); void commandLineArgumentsChanged(const QString &args); void nameChanged(const QString &name); - void runModeChanged(ProjectExplorer::ApplicationRunConfiguration::RunMode runMode); + void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode); void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &userChanges); void baseEnvironmentChanged(); diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index 374ced568e9108895b20e3a5c7479c0a1f497fa7..23ffd205ad8704dff77054a58207bd0e25b9faae 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -53,6 +53,8 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/editormanager/editormanager.h> #include <projectexplorer/projectexplorer.h> +#include <projectexplorer/session.h> +#include <projectexplorer/project.h> #include <utils/qtcassert.h> #include <QtCore/QDebug> diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index e973792ca1f7db9156a76c41b79e8a606a027bec..dc0f3cad0fa3a3fb2f21f559bd2c0d47a4002a13 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -39,6 +39,7 @@ #include <extensionsystem/pluginmanager.h> #include <projectexplorer/editorconfiguration.h> #include <projectexplorer/projectexplorer.h> +#include <projectexplorer/project.h> #include <projectexplorer/session.h> #include <texteditor/fontsettings.h> #include <texteditor/texteditorconstants.h> diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 0fd80b28b157aca5ec4636629ac14d8ed5df5437..2951ba1d589559709e82838059f91cbed7001056 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -48,6 +48,7 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/session.h> +#include <projectexplorer/project.h> #include <QtCore/QDebug> #include <QtCore/QDir>