Debugger: Remove messaging indirection in DebuggerRunControl

The base functionality is good enough.

Change-Id: Ie39398828733245e0e74ca9a2941c069116014f0
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-10-17 13:06:37 +02:00
parent 7e5bad4905
commit 216b950124
6 changed files with 21 additions and 27 deletions

View File

@@ -166,7 +166,7 @@ AndroidDebugSupport::AndroidDebugSupport(AndroidRunConfiguration *runConfig,
connect(m_runner, &AndroidRunner::remoteProcessFinished, connect(m_runner, &AndroidRunner::remoteProcessFinished,
[this](const QString &errorMsg) { [this](const QString &errorMsg) {
QTC_ASSERT(m_runControl, return); QTC_ASSERT(m_runControl, return);
m_runControl->showMessage(errorMsg, AppStuff); m_runControl->appendMessage(errorMsg, Utils::DebugFormat);
}); });
connect(m_runner, &AndroidRunner::remoteErrorOutput, connect(m_runner, &AndroidRunner::remoteErrorOutput,

View File

@@ -315,7 +315,6 @@ public:
bool m_isStateDebugging; bool m_isStateDebugging;
Utils::FileInProjectFinder m_fileFinder; Utils::FileInProjectFinder m_fileFinder;
}; };
@@ -495,10 +494,21 @@ void DebuggerEngine::showMessage(const QString &msg, int channel, int timeout) c
consoleManager->printToConsolePane(QmlJS::ConsoleItem::UndefinedType, msg); consoleManager->printToConsolePane(QmlJS::ConsoleItem::UndefinedType, msg);
debuggerCore()->showMessage(msg, channel, timeout); debuggerCore()->showMessage(msg, channel, timeout);
if (d->m_runControl) if (d->m_runControl) {
d->m_runControl->showMessage(msg, channel); switch (channel) {
else case AppOutput:
d->m_runControl->appendMessage(msg, Utils::StdOutFormatSameLine);
break;
case AppError:
d->m_runControl->appendMessage(msg, Utils::StdErrFormatSameLine);
break;
case AppStuff:
d->m_runControl->appendMessage(msg, Utils::DebugFormat);
break;
}
} else {
qWarning("Warning: %s (no active run control)", qPrintable(msg)); qWarning("Warning: %s (no active run control)", qPrintable(msg));
}
} }
void DebuggerEngine::startDebugger(DebuggerRunControl *runControl) void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)

View File

@@ -31,6 +31,8 @@
#ifndef DEBUGGERRUNCONTROLFACTORY_H #ifndef DEBUGGERRUNCONTROLFACTORY_H
#define DEBUGGERRUNCONTROLFACTORY_H #define DEBUGGERRUNCONTROLFACTORY_H
#include "debuggerconstants.h"
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
namespace Debugger { namespace Debugger {

View File

@@ -192,21 +192,6 @@ void DebuggerRunControl::handleFinished()
debuggerCore()->runControlFinished(m_engine); debuggerCore()->runControlFinished(m_engine);
} }
void DebuggerRunControl::showMessage(const QString &msg, int channel)
{
switch (channel) {
case AppOutput:
appendMessage(msg, StdOutFormatSameLine);
break;
case AppError:
appendMessage(msg, StdErrFormatSameLine);
break;
case AppStuff:
appendMessage(msg, DebugFormat);
break;
}
}
bool DebuggerRunControl::promptToStop(bool *optionalPrompt) const bool DebuggerRunControl::promptToStop(bool *optionalPrompt) const
{ {
QTC_ASSERT(isRunning(), return true); QTC_ASSERT(isRunning(), return true);

View File

@@ -32,7 +32,6 @@
#define DEBUGGERRUNNER_H #define DEBUGGERRUNNER_H
#include "debugger_global.h" #include "debugger_global.h"
#include "debuggerconstants.h"
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
@@ -61,8 +60,6 @@ public:
void debuggingFinished(); void debuggingFinished();
DebuggerEngine *engine(); DebuggerEngine *engine();
void showMessage(const QString &msg, int channel);
signals: signals:
void engineRequestSetup(); void engineRequestSetup();

View File

@@ -230,9 +230,9 @@ void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
{ {
if (m_runControl) { if (m_runControl) {
if (!cleanEnd) if (!cleanEnd)
m_runControl->showMessage(tr("Run ended with error."), AppStuff); m_runControl->appendMessage(tr("Run ended with error."), Utils::DebugFormat);
else else
m_runControl->showMessage(tr("Run ended."), AppStuff); m_runControl->appendMessage(tr("Run ended."), Utils::DebugFormat);
m_runControl->engine()->abortDebugger(); m_runControl->engine()->abortDebugger();
} }
} }
@@ -243,7 +243,7 @@ void IosDebugSupport::handleRemoteOutput(const QString &output)
if (m_runControl->engine()) if (m_runControl->engine())
m_runControl->engine()->showMessage(output, AppOutput); m_runControl->engine()->showMessage(output, AppOutput);
else else
m_runControl->showMessage(output, AppOutput); m_runControl->appendMessage(output, Utils::StdOutFormatSameLine);
} }
} }
@@ -253,7 +253,7 @@ void IosDebugSupport::handleRemoteErrorOutput(const QString &output)
if (m_runControl->engine()) if (m_runControl->engine())
m_runControl->engine()->showMessage(output, AppError); m_runControl->engine()->showMessage(output, AppError);
else else
m_runControl->showMessage(output, AppError); m_runControl->appendMessage(output, Utils::StdErrFormatSameLine);
} }
} }