From 6683b40844dcecc3250ae1c8aa7374531d60109b Mon Sep 17 00:00:00 2001 From: dt Date: Fri, 12 Nov 2010 20:18:29 +0100 Subject: [PATCH] ProjectExplorer + Debugger: Move Debug Action to the Debugger plugin Since all the debuggers are implemented in the debuggerplugin, that's a natural place to put the action. --- src/plugins/debugger/debuggerconstants.h | 9 +++ src/plugins/debugger/debuggerplugin.cpp | 59 ++++++++++++--- src/plugins/debugger/debuggerrunner.cpp | 6 +- src/plugins/projectexplorer/outputwindow.cpp | 9 +-- src/plugins/projectexplorer/outputwindow.h | 1 - .../projectexplorer/projectexplorer.cpp | 74 +++++-------------- src/plugins/projectexplorer/projectexplorer.h | 6 +- .../projectexplorerconstants.h | 9 --- .../qmlprojectruncontrol.cpp | 2 +- .../qt-maemo/maemorunfactories.cpp | 5 +- .../qt4projectmanager/qt-s60/s60manager.cpp | 2 +- 11 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 30688ba0cd..e6680279b9 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -84,6 +84,15 @@ namespace Internal { const char * const OPENED_BY_DEBUGGER = "OpenedByDebugger"; const char * const OPENED_WITH_DISASSEMBLY = "DisassemblerView"; +const char * const DEBUGMODE = "Debugger.DebugMode"; +const char * const DEBUG = "Debugger.Debug"; +const int P_ACTION_DEBUG = 90; //priority for the modemanager +#ifdef Q_OS_MAC +const char * const DEBUG_KEY = "Ctrl+Y"; +#else +const char * const DEBUG_KEY = "F5"; +#endif + } // namespace Constants diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index cb601850f8..3fd5d8693d 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -958,6 +958,7 @@ public slots: void onModeChanged(Core::IMode *mode); void showSettingsDialog(); + void debugProject(); void startExternalApplication(); void startRemoteApplication(); void attachExternalApplication(); @@ -1032,6 +1033,7 @@ public slots: void coreShutdown(); public slots: + void updateDebugActions(); void handleExecDetach() { currentEngine()->detachDebugger(); } void handleExecContinue() { currentEngine()->continueInferior(); } void handleExecInterrupt() { currentEngine()->requestInterruptInferior(); } @@ -1225,6 +1227,7 @@ public: Context m_anyContext; AttachRemoteParameters m_attachRemoteParameters; + QAction *m_debugAction; QAction *m_startExternalAction; QAction *m_startRemoteAction; QAction *m_attachExternalAction; @@ -1611,6 +1614,14 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, m_reverseToolButton = 0; + // debug action + act = m_debugAction = new QAction(this); + QIcon debuggerIcon(":/projectexplorer/images/debugger_start_small.png"); + debuggerIcon.addFile(":/projectexplorer/images/debugger_start.png"); + act->setIcon(debuggerIcon); + act->setText(tr("Start Debugging")); + connect(act, SIGNAL(triggered()), this, SLOT(debugProject())); + // Handling of external applications. act = m_startExternalAction = new QAction(this); act->setText(tr("Start and Debug External Application...")); @@ -1644,8 +1655,16 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, Core::ActionContainer *mstart = am->actionContainer(PE::M_DEBUG_STARTDEBUGGING); + cmd = am->registerAction(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(Constants::DEBUG_KEY)); + mstart->addAction(cmd, Core::Constants::G_DEFAULT_ONE); + Core::ICore::instance()->modeManager()->addAction(cmd, Constants::P_ACTION_DEBUG); + cmd = am->registerAction(m_actions.continueAction, - PE::DEBUG, m_continuableContext); + Constants::DEBUG, m_continuableContext); mstart->addAction(cmd, CC::G_DEFAULT_ONE); cmd = am->registerAction(m_startExternalAction, @@ -1685,11 +1704,11 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, m_uiSwitcher->addMenuAction(cmd, AnyLanguage, CC::G_DEFAULT_ONE); cmd = am->registerAction(m_actions.interruptAction, - PE::DEBUG, m_interruptibleContext); + Constants::DEBUG, m_interruptibleContext); cmd->setDefaultText(tr("Interrupt Debugger")); cmd = am->registerAction(m_actions.undisturbableAction, - PE::DEBUG, m_undisturbableContext); + Constants::DEBUG, m_undisturbableContext); cmd->setDefaultText(tr("Debugger is Busy")); cmd = am->registerAction(m_actions.resetAction, @@ -1856,6 +1875,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, SLOT(aboutToSaveSession())); connect(sessionManager(), SIGNAL(aboutToUnloadSession()), SLOT(aboutToUnloadSession())); + connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(updateRunActions()), + this, SLOT(updateDebugActions())); // EditorManager QObject *editorManager = core->editorManager(); @@ -1874,7 +1895,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QHBoxLayout *hbox = new QHBoxLayout(toolbarContainer); hbox->setMargin(0); hbox->setSpacing(0); - hbox->addWidget(toolButton(am->command(PE::DEBUG)->action())); + hbox->addWidget(toolButton(am->command(Constants::DEBUG)->action())); hbox->addWidget(toolButton(am->command(STOP)->action())); hbox->addWidget(toolButton(am->command(NEXT)->action())); hbox->addWidget(toolButton(am->command(STEP)->action())); @@ -1972,6 +1993,15 @@ void DebuggerPluginPrivate::languagesChanged(const DebuggerLanguages &languages) m_detachAction->setVisible(debuggerIsCPP); } +void DebuggerPluginPrivate::debugProject() +{ + Project *pro = ProjectExplorer::ProjectExplorerPlugin::instance()->startupProject(); + if (!pro) + return; + + ProjectExplorer::ProjectExplorerPlugin::instance()->runProject(pro, Constants::DEBUGMODE); + } + void DebuggerPluginPrivate::startExternalApplication() { DebuggerStartParameters sp; @@ -2373,7 +2403,7 @@ void DebuggerPluginPrivate::displayDebugger(DebuggerEngine *engine, bool updateE void DebuggerPluginPrivate::startDebugger(RunControl *rc) { QTC_ASSERT(rc, return); - ProjectExplorerPlugin::instance()->startRunControl(rc, PE::DEBUGMODE); + ProjectExplorerPlugin::instance()->startRunControl(rc, Constants::DEBUGMODE); } @@ -2631,7 +2661,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_actions.continueAction->setEnabled(false); m_actions.exitAction->setEnabled(false); am->command(Constants::STOP)->setKeySequence(QKeySequence()); - am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); + am->command(Constants::DEBUG)->setKeySequence(QKeySequence(DEBUG_KEY)); core->updateAdditionalContexts(m_anyContext, Context()); } else if (m_state == InferiorStopOk) { // F5 continues, Shift-F5 kills. It is "continuable". @@ -2639,7 +2669,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_actions.continueAction->setEnabled(true); m_actions.exitAction->setEnabled(true); am->command(Constants::STOP)->setKeySequence(QKeySequence(STOP_KEY)); - am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); + am->command(Constants::DEBUG)->setKeySequence(QKeySequence(DEBUG_KEY)); core->updateAdditionalContexts(m_anyContext, m_continuableContext); } else if (m_state == InferiorRunOk) { // Shift-F5 interrupts. It is also "interruptible". @@ -2647,7 +2677,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_actions.continueAction->setEnabled(false); m_actions.exitAction->setEnabled(false); am->command(Constants::STOP)->setKeySequence(QKeySequence()); - am->command(PE::DEBUG)->setKeySequence(QKeySequence(STOP_KEY)); + am->command(Constants::DEBUG)->setKeySequence(QKeySequence(STOP_KEY)); core->updateAdditionalContexts(m_anyContext, m_interruptibleContext); } else if (m_state == DebuggerFinished) { // We don't want to do anything anymore. @@ -2655,7 +2685,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_actions.continueAction->setEnabled(false); m_actions.exitAction->setEnabled(false); am->command(Constants::STOP)->setKeySequence(QKeySequence()); - am->command(PE::DEBUG)->setKeySequence(QKeySequence(PE::DEBUG_KEY)); + am->command(Constants::DEBUG)->setKeySequence(QKeySequence(DEBUG_KEY)); //core->updateAdditionalContexts(m_anyContext, m_finishedContext); m_codeModelSnapshot = CPlusPlus::Snapshot(); core->updateAdditionalContexts(m_anyContext, Context()); @@ -2667,7 +2697,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_actions.continueAction->setEnabled(false); m_actions.exitAction->setEnabled(true); am->command(Constants::STOP)->setKeySequence(QKeySequence(STOP_KEY)); - am->command(PE::DEBUG)->setKeySequence(QKeySequence(STOP_KEY)); + am->command(Constants::DEBUG)->setKeySequence(QKeySequence(STOP_KEY)); core->updateAdditionalContexts(m_anyContext, m_finishedContext); } else { // Everything else is "undisturbable". @@ -2675,7 +2705,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_actions.continueAction->setEnabled(false); m_actions.exitAction->setEnabled(false); am->command(Constants::STOP)->setKeySequence(QKeySequence()); - am->command(PE::DEBUG)->setKeySequence(QKeySequence()); + am->command(Constants::DEBUG)->setKeySequence(QKeySequence()); core->updateAdditionalContexts(m_anyContext, m_undisturbableContext); } @@ -2738,6 +2768,13 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_scriptConsoleWindow->setEnabled(stopped); } +void DebuggerPluginPrivate::updateDebugActions() +{ + ProjectExplorer::ProjectExplorerPlugin *peplugin = ProjectExplorer::ProjectExplorerPlugin::instance(); + Project *project = peplugin->startupProject(); + m_debugAction->setEnabled(peplugin->canRun(project, Constants::DEBUGMODE)); +} + void DebuggerPluginPrivate::gotoLocation(const QString &file, int line, bool setMarker) { // CDB might hit on breakpoints while shutting down. diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 7077286c49..ee9fde6279 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -122,7 +122,7 @@ DebuggerRunControlFactory::DebuggerRunControlFactory(QObject *parent, bool DebuggerRunControlFactory::canRun(RunConfiguration *runConfiguration, const QString &mode) const { // return mode == ProjectExplorer::Constants::DEBUGMODE; - return mode == ProjectExplorer::Constants::DEBUGMODE + return mode == Constants::DEBUGMODE && qobject_cast(runConfiguration); } @@ -208,7 +208,7 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu RunControl *DebuggerRunControlFactory::create (RunConfiguration *runConfiguration, const QString &mode) { - QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0); + QTC_ASSERT(mode == Constants::DEBUGMODE, return 0); DebuggerStartParameters sp = localStartParameters(runConfiguration); return create(sp, runConfiguration); } @@ -277,7 +277,7 @@ DebuggerRunnerPrivate::DebuggerRunnerPrivate(RunConfiguration *runConfiguration, DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfiguration, unsigned enabledEngines, const DebuggerStartParameters &sp) - : RunControl(runConfiguration, ProjectExplorer::Constants::DEBUGMODE), + : RunControl(runConfiguration, Constants::DEBUGMODE), d(new DebuggerRunnerPrivate(runConfiguration, enabledEngines)) { connect(this, SIGNAL(finished()), this, SLOT(handleFinished())); diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp index 98c3c13bee..8a65e8968b 100644 --- a/src/plugins/projectexplorer/outputwindow.cpp +++ b/src/plugins/projectexplorer/outputwindow.cpp @@ -87,9 +87,6 @@ OutputPane::OutputPane() : m_runIcon.addFile(Constants::ICON_RUN); m_runIcon.addFile(Constants::ICON_RUN_SMALL); - m_debugIcon.addFile(Constants::ICON_DEBUG); - m_debugIcon.addFile(Constants::ICON_DEBUG_SMALL); - // Rerun m_reRunButton->setIcon(m_runIcon); m_reRunButton->setToolTip(tr("Re-run this run-configuration")); @@ -394,7 +391,7 @@ void OutputPane::tabChanged(int i) RunControl *rc = m_runControlTabs.at(index).runControl; m_stopAction->setEnabled(rc->isRunning()); m_reRunButton->setEnabled(!rc->isRunning()); - m_reRunButton->setIcon(rc->runMode() == Constants::DEBUGMODE ? m_debugIcon : m_runIcon); + m_reRunButton->setIcon(m_runIcon); } } @@ -404,7 +401,7 @@ void OutputPane::runControlStarted() if (current && current == sender()) { m_reRunButton->setEnabled(false); m_stopAction->setEnabled(true); - m_reRunButton->setIcon(current->runMode() == Constants::DEBUGMODE ? m_debugIcon : m_runIcon); + m_reRunButton->setIcon(m_runIcon); } } @@ -425,7 +422,7 @@ void OutputPane::runControlFinished() if (current && current == sender()) { m_reRunButton->setEnabled(true); m_stopAction->setEnabled(false); - m_reRunButton->setIcon(current->runMode() == Constants::DEBUGMODE ? m_debugIcon : m_runIcon); + m_reRunButton->setIcon(m_runIcon); } // Check for asynchronous close. Close the tab. if (m_runControlTabs.at(senderIndex).asyncClosing) diff --git a/src/plugins/projectexplorer/outputwindow.h b/src/plugins/projectexplorer/outputwindow.h index 6e7dfd4132..920223467a 100644 --- a/src/plugins/projectexplorer/outputwindow.h +++ b/src/plugins/projectexplorer/outputwindow.h @@ -139,7 +139,6 @@ private: QToolButton *m_reRunButton; QToolButton *m_stopButton; QIcon m_runIcon; - QIcon m_debugIcon; }; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index be1d9c5d26..77d1822f81 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -160,7 +160,6 @@ struct ProjectExplorerPluginPrivate { QAction *m_runAction; QAction *m_runActionContextMenu; QAction *m_cancelBuildAction; - QAction *m_debugAction; QAction *m_addNewFileAction; QAction *m_addExistingFilesAction; QAction *m_addNewSubprojectAction; @@ -689,18 +688,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er 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"); - 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(Constants::DEBUG_KEY)); - mstartdebugging->addAction(cmd, Core::Constants::G_DEFAULT_ONE); - modeManager->addAction(cmd, Constants::P_ACTION_DEBUG); - // add new file action d->m_addNewFileAction = new QAction(tr("Add New..."), this); cmd = am->registerAction(d->m_addNewFileAction, ProjectExplorer::Constants::ADDNEWFILE, @@ -841,7 +828,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er 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())); @@ -856,6 +842,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er connect(d->m_renameFileAction, SIGNAL(triggered()), this, SLOT(renameFile())); connect(d->m_setStartupProjectAction, SIGNAL(triggered()), this, SLOT(setStartupProject())); + connect(this, SIGNAL(updateRunActions()), this, SLOT(slotUpdateRunActions())); + updateActions(); connect(Core::ICore::instance(), SIGNAL(coreAboutToOpen()), @@ -1368,7 +1356,7 @@ void ProjectExplorerPlugin::startRunControl(RunControl *runControl, const QStrin this, SLOT(runControlFinished())); runControl->start(); - updateRunActions(); + emit updateRunActions(); } void ProjectExplorerPlugin::buildQueueFinished(bool success) @@ -1755,16 +1743,7 @@ void ProjectExplorerPlugin::runProject(Project *pro, QString mode) } else { executeRunConfiguration(pro->activeTarget()->activeRunConfiguration(), mode); } - updateRunActions(); -} - -void ProjectExplorerPlugin::debugProject() -{ - Project *pro = startupProject(); - if (!pro) - return; - - runProject(pro, ProjectExplorer::Constants::DEBUGMODE); + emit updateRunActions(); } bool ProjectExplorerPlugin::showBuildConfigDialog() @@ -1794,7 +1773,7 @@ bool ProjectExplorerPlugin::showBuildConfigDialog() void ProjectExplorerPlugin::runControlFinished() { - updateRunActions(); + emit updateRunActions(); } void ProjectExplorerPlugin::startupProjectChanged() @@ -1821,7 +1800,7 @@ void ProjectExplorerPlugin::startupProjectChanged() activeTargetChanged(); - updateRunActions(); + emit updateRunActions(); } void ProjectExplorerPlugin::activeTargetChanged() @@ -1857,14 +1836,14 @@ void ProjectExplorerPlugin::activeRunConfigurationChanged() return; if (previousRunConfiguration) { disconnect(previousRunConfiguration, SIGNAL(isEnabledChanged(bool)), - this, SLOT(updateRunActions())); + this, SIGNAL(updateRunActions())); } previousRunConfiguration = rc; if (rc) { connect(rc, SIGNAL(isEnabledChanged(bool)), - this, SLOT(updateRunActions())); + this, SIGNAL(updateRunActions())); } - updateRunActions(); + emit updateRunActions(); } // NBS TODO implement more than one runner @@ -1904,43 +1883,28 @@ void ProjectExplorerPlugin::updateDeployActions() d->m_deploySessionAction->setEnabled(hasProjects && !building); - updateRunActions(); + emit updateRunActions(); } -void ProjectExplorerPlugin::updateRunActions() +bool ProjectExplorerPlugin::canRun(Project *project, const QString &runMode) { - const Project *project = startupProject(); - if (!project || !project->activeTarget() || !project->activeTarget()->activeRunConfiguration()) { - - d->m_runAction->setToolTip(tr("Cannot run without a project.")); - d->m_debugAction->setToolTip(tr("Cannot debug without a project.")); - - d->m_runAction->setEnabled(false); - d->m_debugAction->setEnabled(false); - return; + return false; } - d->m_runAction->setToolTip(QString()); - d->m_debugAction->setToolTip(QString()); - RunConfiguration *activeRC = project->activeTarget()->activeRunConfiguration(); - bool canRun = findRunControlFactory(activeRC, ProjectExplorer::Constants::RUNMODE) + bool canRun = findRunControlFactory(activeRC, runMode) && activeRC->isEnabled(); - const bool canDebug = findRunControlFactory(activeRC, ProjectExplorer::Constants::DEBUGMODE) - && activeRC->isEnabled(); const bool building = d->m_buildManager->isBuilding(); + return (canRun && !building); +} - d->m_runAction->setEnabled(canRun && !building); - - canRun = session()->startupProject() && findRunControlFactory(activeRC, ProjectExplorer::Constants::RUNMODE); - - d->m_runActionContextMenu->setEnabled(canRun && !building); - - d->m_debugAction->setEnabled(canDebug && !building); - +void ProjectExplorerPlugin::slotUpdateRunActions() +{ + Project *project = startupProject(); + d->m_runAction->setEnabled(canRun(project, ProjectExplorer::Constants::RUNMODE)); } void ProjectExplorerPlugin::cancelBuild() diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index c3c5ea669a..3fa0a6038d 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -112,6 +112,7 @@ public: static QStringList projectFilePatterns(); bool coreAboutToClose(); + bool canRun(Project *pro, const QString &runMode); void runProject(Project *pro, QString mode); signals: @@ -128,6 +129,8 @@ signals: void settingsChanged(); + void updateRunActions(); + public slots: void openOpenProjectDialog(); @@ -151,7 +154,6 @@ private slots: void cleanProjectContextMenu(); void cleanSession(); void cancelBuild(); - void debugProject(); void loadAction(); void unloadProject(); void clearSession(); @@ -197,7 +199,7 @@ private slots: void activeRunConfigurationChanged(); void updateDeployActions(); - void updateRunActions(); + void slotUpdateRunActions(); void loadProject(const QString &project) { openProject(project); } void currentModeChanged(Core::IMode *mode, Core::IMode *oldMode); diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 2c7f29dca3..f081a65ca2 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -68,7 +68,6 @@ const char * const RUNCONFIGURATIONMENU = "ProjectExplorer.RunConfigurationMenu" const char * const RUN = "ProjectExplorer.Run"; const char * const RUNCONTEXTMENU = "ProjectExplorer.RunContextMenu"; const char * const STOP = "ProjectExplorer.Stop"; -const char * const DEBUG = "ProjectExplorer.Debug"; const char * const DEPENDENCIES = "ProjectExplorer.Dependencies"; const char * const FINDINALLPROJECTS = "ProjectExplorer.FindInAllProjects"; const char * const SHOWPROPERTIES = "ProjectExplorer.ShowProperties"; @@ -90,14 +89,12 @@ const char * const SHOW_TASK_OUTPUT = "ProjectExplorer.ShowTaskOutput"; // Run modes const char * const RUNMODE = "ProjectExplorer.RunMode"; -const char * const DEBUGMODE = "ProjectExplorer.DebugMode"; const char * const SELECTTARGET = "ProjectExplorer.SelectTarget"; // action priorities const int P_ACTION_RUN = 100; -const int P_ACTION_DEBUG = 90; const int P_ACTION_BUILDSESSION = 80; // context @@ -229,12 +226,6 @@ const char * const DEFAULT_DEPLOYCONFIGURATION_ID = "ProjectExplorer.DefaultDepl // Run Configuration defaults: const int QML_DEFAULT_DEBUG_SERVER_PORT = 3768; -#ifdef Q_OS_MAC -const char * const DEBUG_KEY = "Ctrl+Y"; -#else -const char * const DEBUG_KEY = "F5"; -#endif - } // namespace Constants } // namespace ProjectExplorer diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index 3e5b1b22ae..861c58537c 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -175,7 +175,7 @@ RunControl *QmlRunControlFactory::create(RunConfiguration *runConfiguration, RunControl *runControl = 0; if (mode == ProjectExplorer::Constants::RUNMODE) { runControl = new QmlRunControl(config, mode); - } else if (mode == ProjectExplorer::Constants::DEBUGMODE) { + } else if (mode == Debugger::Constants::DEBUGMODE) { runControl = createDebugRunControl(config); } return runControl; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp index 3a313dc1f8..e5f67c5eaf 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp @@ -42,6 +42,7 @@ #include "maemotoolchain.h" #include +#include #include #include @@ -174,7 +175,7 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration, = maemoRunConfig->toolchain()->allowsRemoteMounts() ? maemoRunConfig->remoteMounts()->validMountSpecificationCount() : 0; - if (mode == ProjectExplorer::Constants::DEBUGMODE) + if (mode == Debugger::Constants::DEBUGMODE) return freePortCount >= mountDirCount + maemoRunConfig->portsUsedByDebuggers(); if (mode == ProjectExplorer::Constants::RUNMODE) return freePortCount >= mountDirCount; @@ -185,7 +186,7 @@ RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, const QString &mode) { Q_ASSERT(mode == ProjectExplorer::Constants::RUNMODE - || mode == ProjectExplorer::Constants::DEBUGMODE); + || mode == Debugger::Constants::DEBUGMODE); Q_ASSERT(canRun(runConfig, mode)); MaemoRunConfiguration *rc = qobject_cast(runConfig); Q_ASSERT(rc); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp index 7f963d8d33..128f105c75 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp @@ -123,7 +123,7 @@ S60Manager::S60Manager(QObject *parent) addAutoReleasedObject(new RunControlFactory - (QLatin1String(ProjectExplorer::Constants::DEBUGMODE), + (QLatin1String(Debugger::Constants::DEBUGMODE), tr("Debug on Device"), parent)); updateQtVersions(); connect(m_devices, SIGNAL(qtVersionsChanged()), -- GitLab