aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDaniel Teske <[email protected]>2012-09-05 12:42:41 +0200
committerFriedemann Kleint <[email protected]>2012-09-05 14:38:51 +0200
commit7657dd3a47bb86dd66e88d43ec58e6f32a5f6029 (patch)
treecbe07090b9fbe531b743045680ae7321ad05b6b8 /src/plugins
parentc5097ed18389e357c1333ca7713f701d9751dce3 (diff)
Add error string to IRunControlFactory::createRunControl
And add a few helpful error messages Task-number: QTCREATORBUG-7826 Change-Id: Ia9f9fa476cecf2cff198bc460408bc062e119338 Reviewed-by: Friedemann Kleint <[email protected]>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/analyzerbase/analyzerruncontrolfactory.cpp7
-rw-r--r--src/plugins/analyzerbase/analyzerruncontrolfactory.h3
-rw-r--r--src/plugins/android/androiddebugsupport.cpp4
-rw-r--r--src/plugins/android/androiddebugsupport.h3
-rw-r--r--src/plugins/android/androidrunfactories.cpp4
-rw-r--r--src/plugins/android/androidrunfactories.h3
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp4
-rw-r--r--src/plugins/debugger/debuggerplugin.h3
-rw-r--r--src/plugins/debugger/debuggerruncontrolfactory.h5
-rw-r--r--src/plugins/debugger/debuggerrunner.cpp18
-rw-r--r--src/plugins/madde/maemorunfactories.cpp4
-rw-r--r--src/plugins/madde/maemorunfactories.h4
-rw-r--r--src/plugins/projectexplorer/localapplicationruncontrol.cpp7
-rw-r--r--src/plugins/projectexplorer/localapplicationruncontrol.h2
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp20
-rw-r--r--src/plugins/projectexplorer/projectexplorer.h1
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h2
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp9
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectruncontrol.h5
-rw-r--r--src/plugins/qnx/blackberryruncontrolfactory.cpp12
-rw-r--r--src/plugins/qnx/blackberryruncontrolfactory.h3
-rw-r--r--src/plugins/qnx/qnxruncontrolfactory.cpp4
-rw-r--r--src/plugins/qnx/qnxruncontrolfactory.h2
-rw-r--r--src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp4
-rw-r--r--src/plugins/remotelinux/remotelinuxruncontrolfactory.h2
25 files changed, 88 insertions, 47 deletions
diff --git a/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp b/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp
index 87392ae802f..30eaaee0b00 100644
--- a/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp
+++ b/src/plugins/analyzerbase/analyzerruncontrolfactory.cpp
@@ -68,11 +68,14 @@ bool AnalyzerRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMo
return false;
}
-RunControl *AnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode)
+RunControl *AnalyzerRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
{
IAnalyzerTool *tool = AnalyzerManager::toolFromRunMode(mode);
- if (!tool)
+ if (!tool) {
+ if (errorMessage)
+ *errorMessage = tr("No analyzer tool selected"); // never happens
return 0;
+ }
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
diff --git a/src/plugins/analyzerbase/analyzerruncontrolfactory.h b/src/plugins/analyzerbase/analyzerruncontrolfactory.h
index 49514b0144d..081b00443fd 100644
--- a/src/plugins/analyzerbase/analyzerruncontrolfactory.h
+++ b/src/plugins/analyzerbase/analyzerruncontrolfactory.h
@@ -51,7 +51,8 @@ public:
QString displayName() const;
bool canRun(RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
ProjectExplorer::RunControl *create(RunConfiguration *runConfiguration,
- ProjectExplorer::RunMode mode);
+ ProjectExplorer::RunMode mode,
+ QString *errorMessage);
ProjectExplorer::IRunConfigurationAspect *createRunConfigurationAspect();
ProjectExplorer::RunConfigWidget *createConfigurationWidget(RunConfiguration *runConfiguration);
diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp
index 72f71004655..9c9cf467f16 100644
--- a/src/plugins/android/androiddebugsupport.cpp
+++ b/src/plugins/android/androiddebugsupport.cpp
@@ -81,7 +81,7 @@ static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
return paths.toList();
}
-RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig)
+RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig, QString *errorMessage)
{
Target *target = runConfig->target();
Qt4Project *project = static_cast<Qt4Project *>(target->project());
@@ -119,7 +119,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
}
DebuggerRunControl * const debuggerRunControl
- = DebuggerPlugin::createDebugger(params, runConfig);
+ = DebuggerPlugin::createDebugger(params, runConfig, errorMessage);
new AndroidDebugSupport(runConfig, debuggerRunControl);
return debuggerRunControl;
}
diff --git a/src/plugins/android/androiddebugsupport.h b/src/plugins/android/androiddebugsupport.h
index 7278272f124..96354c96bf3 100644
--- a/src/plugins/android/androiddebugsupport.h
+++ b/src/plugins/android/androiddebugsupport.h
@@ -47,7 +47,8 @@ class AndroidDebugSupport : public QObject
Q_OBJECT
public:
- static ProjectExplorer::RunControl *createDebugRunControl(AndroidRunConfiguration *runConfig);
+ static ProjectExplorer::RunControl *createDebugRunControl(AndroidRunConfiguration *runConfig,
+ QString *errorMessage);
AndroidDebugSupport(AndroidRunConfiguration *runConfig,
Debugger::DebuggerRunControl *runControl);
diff --git a/src/plugins/android/androidrunfactories.cpp b/src/plugins/android/androidrunfactories.cpp
index 193354c8bbe..206e44d4aaf 100644
--- a/src/plugins/android/androidrunfactories.cpp
+++ b/src/plugins/android/androidrunfactories.cpp
@@ -171,7 +171,7 @@ bool AndroidRunControlFactory::canRun(RunConfiguration *runConfiguration,
}
RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
- ProjectExplorer::RunMode mode)
+ ProjectExplorer::RunMode mode, QString *errorMessage)
{
Q_ASSERT(canRun(runConfig, mode));
AndroidRunConfiguration *rc = qobject_cast<AndroidRunConfiguration *>(runConfig);
@@ -179,7 +179,7 @@ RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
if (mode == NormalRunMode)
return new AndroidRunControl(rc);
else
- return AndroidDebugSupport::createDebugRunControl(rc);
+ return AndroidDebugSupport::createDebugRunControl(rc, errorMessage);
}
QString AndroidRunControlFactory::displayName() const
diff --git a/src/plugins/android/androidrunfactories.h b/src/plugins/android/androidrunfactories.h
index 6c16456ad5d..bbf5048dbcc 100644
--- a/src/plugins/android/androidrunfactories.h
+++ b/src/plugins/android/androidrunfactories.h
@@ -80,7 +80,8 @@ public:
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode) const;
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
- ProjectExplorer::RunMode mode);
+ ProjectExplorer::RunMode mode,
+ QString *errorMessage);
};
} // namespace Internal
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 9ebe9948588..27ece76ae16 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -3387,9 +3387,9 @@ void DebuggerPlugin::remoteCommand(const QStringList &options,
}
DebuggerRunControl *DebuggerPlugin::createDebugger
- (const DebuggerStartParameters &sp, RunConfiguration *rc)
+ (const DebuggerStartParameters &sp, RunConfiguration *rc, QString *errorMessage)
{
- return DebuggerRunControlFactory::doCreate(sp, rc);
+ return DebuggerRunControlFactory::doCreate(sp, rc, errorMessage);
}
void DebuggerPlugin::extensionsInitialized()
diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h
index 6ef932add41..43710d25c42 100644
--- a/src/plugins/debugger/debuggerplugin.h
+++ b/src/plugins/debugger/debuggerplugin.h
@@ -66,7 +66,8 @@ public:
static QAction *visibleDebugAction();
static DebuggerRunControl *createDebugger(const DebuggerStartParameters &sp,
- ProjectExplorer::RunConfiguration *rc);
+ ProjectExplorer::RunConfiguration *rc,
+ QString *errorMessage);
private:
// IPlugin implementation.
diff --git a/src/plugins/debugger/debuggerruncontrolfactory.h b/src/plugins/debugger/debuggerruncontrolfactory.h
index 9f0b2c230ab..b6b167277d4 100644
--- a/src/plugins/debugger/debuggerruncontrolfactory.h
+++ b/src/plugins/debugger/debuggerruncontrolfactory.h
@@ -50,7 +50,8 @@ public:
// FIXME: Used by qmljsinspector.cpp:469
ProjectExplorer::RunControl *create(
ProjectExplorer::RunConfiguration *runConfiguration,
- ProjectExplorer::RunMode mode);
+ ProjectExplorer::RunMode mode,
+ QString *errorMessage);
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode) const;
@@ -64,7 +65,7 @@ public:
ProjectExplorer::RunConfiguration *runConfiguration = 0);
static DebuggerRunControl *doCreate(const DebuggerStartParameters &sp,
- ProjectExplorer::RunConfiguration *rc);
+ ProjectExplorer::RunConfiguration *rc, QString *errorMessage);
private:
QString displayName() const;
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index 85d96b9f50a..476d23e3acc 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -543,8 +543,9 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
}
RunControl *DebuggerRunControlFactory::create
- (RunConfiguration *runConfiguration, RunMode mode)
+ (RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
{
+ Q_UNUSED(errorMessage)
QTC_ASSERT(mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain, return 0);
DebuggerStartParameters sp = localStartParameters(runConfiguration);
if (sp.startMode == NoStartMode)
@@ -552,7 +553,7 @@ RunControl *DebuggerRunControlFactory::create
if (mode == DebugRunModeWithBreakOnMain)
sp.breakOnMain = true;
- return doCreate(sp, runConfiguration);
+ return doCreate(sp, runConfiguration, errorMessage);
}
static DebuggerEngineType guessUnixCppEngineType(const DebuggerStartParameters &sp)
@@ -644,8 +645,9 @@ static void fixupEngineTypes(DebuggerStartParameters &sp, RunConfiguration *rc)
}
DebuggerRunControl *DebuggerRunControlFactory::doCreate
- (const DebuggerStartParameters &sp0, RunConfiguration *rc)
+ (const DebuggerStartParameters &sp0, RunConfiguration *rc, QString *errorMessage)
{
+ Q_UNUSED(errorMessage);
DebuggerStartParameters sp = sp0;
if (!debuggerCore()->boolSetting(AutoEnrichParameters)) {
const QString sysroot = sp.sysRoot;
@@ -663,8 +665,9 @@ DebuggerRunControl *DebuggerRunControlFactory::doCreate
}
fixupEngineTypes(sp, rc);
- if (!sp.masterEngineType)
+ if (!sp.masterEngineType) {
return 0;
+ }
return new DebuggerRunControl(rc, sp);
}
@@ -672,9 +675,12 @@ DebuggerRunControl *DebuggerRunControlFactory::doCreate
DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun
(const DebuggerStartParameters &sp, RunConfiguration *runConfiguration)
{
- DebuggerRunControl *rc = doCreate(sp, runConfiguration);
- if (!rc)
+ QString errorMessage;
+ DebuggerRunControl *rc = doCreate(sp, runConfiguration, &errorMessage);
+ if (!rc) {
+ ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage);
return 0;
+ }
debuggerCore()->showMessage(sp.startMessage, 0);
ProjectExplorerPlugin::instance()->startRunControl(rc, DebugRunMode);
return rc;
diff --git a/src/plugins/madde/maemorunfactories.cpp b/src/plugins/madde/maemorunfactories.cpp
index da19923d871..2bb5e0f1243 100644
--- a/src/plugins/madde/maemorunfactories.cpp
+++ b/src/plugins/madde/maemorunfactories.cpp
@@ -202,7 +202,7 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode
return maemoRunConfig->hasEnoughFreePorts(mode);
}
-RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, RunMode mode)
+RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, QString *errorMessage)
{
Q_ASSERT(canRun(runConfig, mode));
@@ -216,7 +216,7 @@ RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig, RunMode
}
const DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
- DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc);
+ DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage);
if (!runControl)
return 0;
LinuxDeviceDebugSupport * const debugSupport
diff --git a/src/plugins/madde/maemorunfactories.h b/src/plugins/madde/maemorunfactories.h
index 8a54b6cd396..817cf39b9db 100644
--- a/src/plugins/madde/maemorunfactories.h
+++ b/src/plugins/madde/maemorunfactories.h
@@ -82,7 +82,9 @@ public:
QString displayName() const;
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
- RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode);
+ RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode,
+ QString *errorMessage);
};
} // namespace Internal
diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.cpp b/src/plugins/projectexplorer/localapplicationruncontrol.cpp
index 4742403e040..0f9ef7d1ebe 100644
--- a/src/plugins/projectexplorer/localapplicationruncontrol.cpp
+++ b/src/plugins/projectexplorer/localapplicationruncontrol.cpp
@@ -61,13 +61,16 @@ QString LocalApplicationRunControlFactory::displayName() const
return tr("Run");
}
-RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode)
+RunControl *LocalApplicationRunControlFactory::create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
{
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
LocalApplicationRunConfiguration *localRunConfiguration = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
// Force the dialog about executables at this point and fail if there is none
- if (localRunConfiguration->executable().isEmpty())
+ if (localRunConfiguration->executable().isEmpty()) {
+ if (errorMessage)
+ *errorMessage = tr("No executable");
return 0;
+ }
return new LocalApplicationRunControl(localRunConfiguration, mode);
}
diff --git a/src/plugins/projectexplorer/localapplicationruncontrol.h b/src/plugins/projectexplorer/localapplicationruncontrol.h
index 3e9cdd0c030..59e8dcc2302 100644
--- a/src/plugins/projectexplorer/localapplicationruncontrol.h
+++ b/src/plugins/projectexplorer/localapplicationruncontrol.h
@@ -48,7 +48,7 @@ public:
virtual ~LocalApplicationRunControlFactory();
virtual bool canRun(RunConfiguration *runConfiguration, RunMode mode) const;
virtual QString displayName() const;
- virtual RunControl* create(RunConfiguration *runConfiguration, RunMode mode);
+ virtual RunControl* create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage);
};
class LocalApplicationRunControl : public RunControl
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index bfffc7b536c..725f0bd8fc2 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -1576,13 +1576,29 @@ void ProjectExplorerPlugin::executeRunConfiguration(RunConfiguration *runConfigu
if (IRunControlFactory *runControlFactory = findRunControlFactory(runConfiguration, runMode)) {
emit aboutToExecuteProject(runConfiguration->target()->project(), runMode);
- RunControl *control = runControlFactory->create(runConfiguration, runMode);
- if (!control)
+ QString errorMessage;
+ RunControl *control = runControlFactory->create(runConfiguration, runMode, &errorMessage);
+ if (!control) {
+ showRunErrorMessage(errorMessage);
return;
+ }
startRunControl(control, runMode);
}
}
+void ProjectExplorerPlugin::showRunErrorMessage(const QString &errorMessage)
+{
+ if (errorMessage.isNull()) {
+ // a error occured, but message was not set
+ QMessageBox::critical(Core::ICore::mainWindow(), tr("Unknown error"), errorMessage);
+ } else if (errorMessage.isEmpty()) {
+ // a error, but the message was set to empty
+ // hack for qml observer warning, show nothing at all
+ } else {
+ QMessageBox::critical(Core::ICore::mainWindow(), tr("Could Not Run"), errorMessage);
+ }
+}
+
void ProjectExplorerPlugin::startRunControl(RunControl *runControl, RunMode runMode)
{
d->m_outputPane->createNewOutputWindow(runControl);
diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h
index 1ec882c1dab..5f247235524 100644
--- a/src/plugins/projectexplorer/projectexplorer.h
+++ b/src/plugins/projectexplorer/projectexplorer.h
@@ -109,6 +109,7 @@ public:
Internal::ProjectExplorerSettings projectExplorerSettings() const;
void startRunControl(RunControl *runControl, RunMode runMode);
+ static void showRunErrorMessage(const QString &errorMessage);
// internal public for FlatModel
void renameFile(Node *node, const QString &to);
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index 99817ba23fa..b476024668b 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -228,7 +228,7 @@ public:
virtual ~IRunControlFactory();
virtual bool canRun(RunConfiguration *runConfiguration, RunMode mode) const = 0;
- virtual RunControl *create(RunConfiguration *runConfiguration, RunMode mode) = 0;
+ virtual RunControl *create(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage) = 0;
virtual QString displayName() const = 0;
diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
index 5aa72661d81..2667e7dd5ff 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
+++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
@@ -167,7 +167,7 @@ bool QmlProjectRunControlFactory::canRun(RunConfiguration *runConfiguration,
}
RunControl *QmlProjectRunControlFactory::create(RunConfiguration *runConfiguration,
- RunMode mode)
+ RunMode mode, QString *errorMessage)
{
QTC_ASSERT(canRun(runConfiguration, mode), return 0);
QmlProjectRunConfiguration *config = qobject_cast<QmlProjectRunConfiguration *>(runConfiguration);
@@ -187,7 +187,7 @@ RunControl *QmlProjectRunControlFactory::create(RunConfiguration *runConfigurati
if (mode == NormalRunMode)
runControl = new QmlProjectRunControl(config, mode);
else if (mode == DebugRunMode)
- runControl = createDebugRunControl(config);
+ runControl = createDebugRunControl(config, errorMessage);
return runControl;
}
@@ -196,7 +196,7 @@ QString QmlProjectRunControlFactory::displayName() const
return tr("Run");
}
-RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConfiguration *runConfig)
+RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConfiguration *runConfig, QString *errorMessage)
{
Debugger::DebuggerStartParameters params;
params.startMode = Debugger::StartInternal;
@@ -224,10 +224,11 @@ RunControl *QmlProjectRunControlFactory::createDebugRunControl(QmlProjectRunConf
if (params.executable.isEmpty()) {
QmlProjectPlugin::showQmlObserverToolWarning();
+ *errorMessage = QString(""); // hack, we already showed a error message
return 0;
}
- return Debugger::DebuggerPlugin::createDebugger(params, runConfig);
+ return Debugger::DebuggerPlugin::createDebugger(params, runConfig, errorMessage);
}
} // namespace Internal
diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h
index 918213f3c68..554e1d247f3 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h
+++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h
@@ -77,11 +77,12 @@ public:
// IRunControlFactory
virtual bool canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const;
- virtual ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode);
+ virtual ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode, QString *errorMessage);
virtual QString displayName() const;
private:
- ProjectExplorer::RunControl *createDebugRunControl(QmlProjectRunConfiguration *runConfig);
+ ProjectExplorer::RunControl *createDebugRunControl(QmlProjectRunConfiguration *runConfig, QString *errorMessage);
};
} // namespace Internal
diff --git a/src/plugins/qnx/blackberryruncontrolfactory.cpp b/src/plugins/qnx/blackberryruncontrolfactory.cpp
index af31f90166b..bac096dbdbe 100644
--- a/src/plugins/qnx/blackberryruncontrolfactory.cpp
+++ b/src/plugins/qnx/blackberryruncontrolfactory.cpp
@@ -82,9 +82,8 @@ bool BlackBerryRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runC
return activeDeployConf != 0;
}
-ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(
- ProjectExplorer::RunConfiguration *runConfiguration,
- ProjectExplorer::RunMode mode)
+ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration,
+ ProjectExplorer::RunMode mode, QString *errorMessage)
{
BlackBerryRunConfiguration *rc = qobject_cast<BlackBerryRunConfiguration *>(runConfiguration);
if (!rc)
@@ -92,8 +91,11 @@ ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(
BlackBerryDeployConfiguration *activeDeployConf = qobject_cast<BlackBerryDeployConfiguration *>(
rc->target()->activeDeployConfiguration());
- if (!activeDeployConf)
+ if (!activeDeployConf) {
+ if (errorMessage)
+ *errorMessage = tr("No active deploy configuration");
return 0;
+ }
if (mode == ProjectExplorer::NormalRunMode) {
BlackBerryRunControl *runControl = new BlackBerryRunControl(rc);
@@ -102,7 +104,7 @@ ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(
}
Debugger::DebuggerRunControl * const runControl =
- Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration);
+ Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration, errorMessage);
if (!runControl)
return 0;
diff --git a/src/plugins/qnx/blackberryruncontrolfactory.h b/src/plugins/qnx/blackberryruncontrolfactory.h
index 78ad4729ce6..e6794e40d28 100644
--- a/src/plugins/qnx/blackberryruncontrolfactory.h
+++ b/src/plugins/qnx/blackberryruncontrolfactory.h
@@ -57,7 +57,8 @@ public:
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode) const;
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
- ProjectExplorer::RunMode mode);
+ ProjectExplorer::RunMode mode,
+ QString *errorMessage);
QString displayName() const;
diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp
index b9803bbb16d..90e8325ebfd 100644
--- a/src/plugins/qnx/qnxruncontrolfactory.cpp
+++ b/src/plugins/qnx/qnxruncontrolfactory.cpp
@@ -116,7 +116,7 @@ bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mo
return true;
}
-RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode)
+RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, QString *errorMessage)
{
Q_ASSERT(canRun(runConfig, mode));
@@ -126,7 +126,7 @@ RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mo
return new QnxRunControl(rc);
const DebuggerStartParameters params = createStartParameters(rc);
- DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc);
+ DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage);
if (!runControl)
return 0;
diff --git a/src/plugins/qnx/qnxruncontrolfactory.h b/src/plugins/qnx/qnxruncontrolfactory.h
index fcdd0706212..89b3d3646a9 100644
--- a/src/plugins/qnx/qnxruncontrolfactory.h
+++ b/src/plugins/qnx/qnxruncontrolfactory.h
@@ -52,7 +52,7 @@ public:
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode) const;
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
- ProjectExplorer::RunMode mode);
+ ProjectExplorer::RunMode mode, QString *errorMessage);
};
} // namespace Internal
diff --git a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
index 1132bf24e97..5741fb47011 100644
--- a/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
+++ b/src/plugins/remotelinux/remotelinuxruncontrolfactory.cpp
@@ -80,7 +80,7 @@ bool RemoteLinuxRunControlFactory::canRun(RunConfiguration *runConfiguration, Ru
return true;
}
-RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode)
+RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode, QString *errorMessage)
{
Q_ASSERT(canRun(runConfig, mode));
@@ -92,7 +92,7 @@ RunControl *RemoteLinuxRunControlFactory::create(RunConfiguration *runConfig, Ru
DebuggerStartParameters params = LinuxDeviceDebugSupport::startParameters(rc);
if (mode == ProjectExplorer::DebugRunModeWithBreakOnMain)
params.breakOnMain = true;
- DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc);
+ DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc, errorMessage);
if (!runControl)
return 0;
LinuxDeviceDebugSupport * const debugSupport =
diff --git a/src/plugins/remotelinux/remotelinuxruncontrolfactory.h b/src/plugins/remotelinux/remotelinuxruncontrolfactory.h
index c96053278d1..9f26125ca66 100644
--- a/src/plugins/remotelinux/remotelinuxruncontrolfactory.h
+++ b/src/plugins/remotelinux/remotelinuxruncontrolfactory.h
@@ -46,7 +46,7 @@ public:
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode) const;
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
- ProjectExplorer::RunMode mode);
+ ProjectExplorer::RunMode mode, QString *errorMessage);
};
} // namespace Internal