summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/debuggerrunner.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-09-13 11:27:15 +0200
committerDaniel Teske <daniel.teske@digia.com>2012-09-18 16:10:22 +0200
commitfe2dd584fc5ce998e50aa667044505193256f45f (patch)
tree177517b38887a1c052df12c0b52d21ae7d1154b7 /src/plugins/debugger/debuggerrunner.cpp
parent1035224774d43b9a4ad2098e8cfa0b8b9c36fd30 (diff)
downloadqt-creator-fe2dd584fc5ce998e50aa667044505193256f45f.tar.gz
Fix error handling for custom executables.
Prevent dialog showing "No executable" when canceling the prompt for the executable when pressing 'Run' / 'Debug' on a library project. Introduce new LocalApplicationRunControl::ensureConfigured() to ensure the configuration is complete and detect cancel via empty/non-null strings. Change-Id: I9bd4a296e7c995d26d6ad265519e7ebd3f98d6fe Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src/plugins/debugger/debuggerrunner.cpp')
-rw-r--r--src/plugins/debugger/debuggerrunner.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index e0ddc0122a..c9c3e7aa07 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -478,6 +478,8 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
LocalApplicationRunConfiguration *rc =
qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration);
QTC_ASSERT(rc, return sp);
+ if (!rc->ensureConfigured(errorMessage))
+ return sp;
Target *target = runConfiguration->target();
Kit *kit = target ? target->kit() : KitManager::instance()->defaultKit();
@@ -541,7 +543,6 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
RunControl *DebuggerRunControlFactory::create
(RunConfiguration *runConfiguration, RunMode mode, QString *errorMessage)
{
- Q_UNUSED(errorMessage)
QTC_ASSERT(mode == DebugRunMode || mode == DebugRunModeWithBreakOnMain, return 0);
DebuggerStartParameters sp = localStartParameters(runConfiguration, errorMessage);
if (sp.startMode == NoStartMode)
@@ -621,6 +622,9 @@ DebuggerRunControl *DebuggerRunControlFactory::createAndScheduleRun
(const DebuggerStartParameters &sp, RunConfiguration *runConfiguration)
{
QString errorMessage;
+ if (runConfiguration && !runConfiguration->ensureConfigured(&errorMessage))
+ ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage);
+
DebuggerRunControl *rc = doCreate(sp, runConfiguration, &errorMessage);
if (!rc) {
ProjectExplorer::ProjectExplorerPlugin::showRunErrorMessage(errorMessage);