summaryrefslogtreecommitdiff
path: root/src/plugins/qmlinspector
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-06-14 08:57:15 +0200
committerhjk <qtc-committer@nokia.com>2010-06-14 10:45:11 +0200
commit97edcb7977ecea95613bf0c0e6030083549ca5f4 (patch)
treede0c5c1c3ec2e5bc6e39b5a741c59f556a71c570 /src/plugins/qmlinspector
parenta89643a83374400451674815202b73dba6a505b5 (diff)
downloadqt-creator-97edcb7977ecea95613bf0c0e6030083549ca5f4.tar.gz
debugger: start 'runcontrol-ification' of the debugger plugin.
This replaces most uses of DebuggerStartParameters by DebuggerRunControl which is a simple RunControl with a DebuggerStartParameters member. Plan is to move all global state to the run controls, and possibly introduce specialized ones for core debugging etc.
Diffstat (limited to 'src/plugins/qmlinspector')
-rw-r--r--src/plugins/qmlinspector/qmlinspector.cpp35
-rw-r--r--src/plugins/qmlinspector/qmlinspector.h13
2 files changed, 24 insertions, 24 deletions
diff --git a/src/plugins/qmlinspector/qmlinspector.cpp b/src/plugins/qmlinspector/qmlinspector.cpp
index 2d2aba6a48..0b98b7e90f 100644
--- a/src/plugins/qmlinspector/qmlinspector.cpp
+++ b/src/plugins/qmlinspector/qmlinspector.cpp
@@ -38,8 +38,9 @@
#include "components/expressionquerywidget.h"
#include "components/objectpropertiesview.h"
-#include <debugger/debuggerrunner.h>
+#include <debugger/debuggermanager.h>
#include <debugger/debuggermainwindow.h>
+#include <debugger/debuggerrunner.h>
#include <debugger/debuggeruiswitcher.h>
#include <debugger/debuggerconstants.h>
@@ -539,8 +540,8 @@ QString QmlInspector::attachToQmlViewerAsExternalApp(ProjectExplorer::Project *p
ProjectExplorer::Environment customEnv = ProjectExplorer::Environment::systemEnvironment(); // empty env by default
customEnv.set(QmlProjectManager::Constants::E_QML_DEBUG_SERVER_PORT, QString::number(m_settings.externalPort()));
- Debugger::Internal::DebuggerRunControl *debuggableRunControl = createDebuggerRunControl(runConfig,
- dlg.qmlViewerPath(), dlg.qmlViewerArguments());
+ Debugger::DebuggerRunControl *debuggableRunControl =
+ createDebuggerRunControl(runConfig, dlg.qmlViewerPath(), dlg.qmlViewerArguments());
return executeDebuggerRunControl(debuggableRunControl, &customEnv);
}
@@ -575,11 +576,11 @@ QString QmlInspector::attachToExternalCppAppWithQml(ProjectExplorer::Project *pr
ProjectExplorer::Environment customEnv = runConfig->environment();
customEnv.set(QmlProjectManager::Constants::E_QML_DEBUG_SERVER_PORT, QString::number(m_settings.externalPort()));
- Debugger::Internal::DebuggerRunControl *debuggableRunControl = createDebuggerRunControl(runConfig);
+ Debugger::DebuggerRunControl *debuggableRunControl = createDebuggerRunControl(runConfig);
return executeDebuggerRunControl(debuggableRunControl, &customEnv);
}
-QString QmlInspector::executeDebuggerRunControl(Debugger::Internal::DebuggerRunControl *debuggableRunControl, ProjectExplorer::Environment *environment)
+QString QmlInspector::executeDebuggerRunControl(Debugger::DebuggerRunControl *debuggableRunControl, ProjectExplorer::Environment *environment)
{
ProjectExplorer::ProjectExplorerPlugin *pex = ProjectExplorer::ProjectExplorerPlugin::instance();
@@ -597,26 +598,26 @@ QString QmlInspector::executeDebuggerRunControl(Debugger::Internal::DebuggerRunC
return QString(tr("A valid run control was not registered in Qt Creator for this project run configuration."));;
}
-Debugger::Internal::DebuggerRunControl *QmlInspector::createDebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig,
- const QString &executableFile, const QString &executableArguments)
+Debugger::DebuggerRunControl *QmlInspector::createDebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig,
+ const QString &executableFile, const QString &executableArguments)
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
- const QList<Debugger::Internal::DebuggerRunControlFactory *> factories = pm->getObjects<Debugger::Internal::DebuggerRunControlFactory>();
+ const QList<Debugger::DebuggerRunControlFactory *> factories = pm->getObjects<Debugger::DebuggerRunControlFactory>();
ProjectExplorer::RunControl *runControl = 0;
- if (m_debugMode == QmlProjectWithCppPlugins) {
-
- const Debugger::DebuggerStartParametersPtr sp(new Debugger::DebuggerStartParameters);
- sp->startMode = Debugger::StartExternal;
- sp->executable = executableFile;
- sp->processArgs = executableArguments.split(QLatin1Char(' '));
+ if (m_debugMode == QmlProjectWithCppPlugins) {
+ Debugger::DebuggerStartParameters sp;
+ sp.startMode = Debugger::StartExternal;
+ sp.executable = executableFile;
+ sp.processArgs = executableArguments.split(QLatin1Char(' '));
runControl = factories.first()->create(sp);
- return qobject_cast<Debugger::Internal::DebuggerRunControl *>(runControl);
+ return qobject_cast<Debugger::DebuggerRunControl *>(runControl);
+ }
- } else if (m_debugMode == CppProjectWithQmlEngines) {
+ if (m_debugMode == CppProjectWithQmlEngines) {
if (factories.length() && factories.first()->canRun(runConfig, ProjectExplorer::Constants::DEBUGMODE)) {
runControl = factories.first()->create(runConfig, ProjectExplorer::Constants::DEBUGMODE);
- return qobject_cast<Debugger::Internal::DebuggerRunControl *>(runControl);
+ return qobject_cast<Debugger::DebuggerRunControl *>(runControl);
}
}
diff --git a/src/plugins/qmlinspector/qmlinspector.h b/src/plugins/qmlinspector/qmlinspector.h
index a0ebaa0a9f..5c59b2e7d2 100644
--- a/src/plugins/qmlinspector/qmlinspector.h
+++ b/src/plugins/qmlinspector/qmlinspector.h
@@ -62,11 +62,10 @@ namespace ProjectExplorer {
namespace Core {
class IContext;
}
+
namespace Debugger {
-namespace Internal {
class DebuggerRunControl;
-} // Internal
-} // Debugger
+}
namespace Qml {
@@ -136,10 +135,10 @@ private slots:
private:
void updateMenuActions();
- Debugger::Internal::DebuggerRunControl *createDebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig,
- const QString &executableFile = QString(),
- const QString &executableArguments = QString());
- QString executeDebuggerRunControl(Debugger::Internal::DebuggerRunControl *debuggableRunControl, ProjectExplorer::Environment *environment);
+ Debugger::DebuggerRunControl *createDebuggerRunControl(ProjectExplorer::RunConfiguration *runConfig,
+ const QString &executableFile = QString(),
+ const QString &executableArguments = QString());
+ QString executeDebuggerRunControl(Debugger::DebuggerRunControl *debuggableRunControl, ProjectExplorer::Environment *environment);
QString attachToQmlViewerAsExternalApp(ProjectExplorer::Project *project);
QString attachToExternalCppAppWithQml(ProjectExplorer::Project *project);