CODA: Debug output added to CODA 4.0.23

Change-Id: Idd2ea3d11a5ee193205c642cc6176ec70c6ef41a
Reviewed-on: http://codereview.qt-project.org/4418
Reviewed-by: Paweł Polański <jaggernod@gmail.com>
This commit is contained in:
Pawel Polanski
2011-09-08 11:34:09 +02:00
committed by Paweł Polański
parent c4fb17bef9
commit eb206dfed7
2 changed files with 11 additions and 30 deletions

View File

@@ -70,7 +70,6 @@ CodaRunControl::CodaRunControl(RunConfiguration *runConfiguration, const QString
S60RunControlBase(runConfiguration, mode), S60RunControlBase(runConfiguration, mode),
m_port(0), m_port(0),
m_state(StateUninit), m_state(StateUninit),
m_codaFlags(0),
m_stopAfterConnect(false) m_stopAfterConnect(false)
{ {
const S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration); const S60DeviceRunConfiguration *s60runConfig = qobject_cast<S60DeviceRunConfiguration *>(runConfiguration);
@@ -226,10 +225,7 @@ void CodaRunControl::slotCodaEvent(const CodaEvent &event)
void CodaRunControl::initCommunication() void CodaRunControl::initCommunication()
{ {
if (m_codaFlags & OptionsUseDebugSession)
m_codaDevice->sendDebugSessionControlSessionStartCommand(CodaCallback(this, &CodaRunControl::handleDebugSessionStarted)); m_codaDevice->sendDebugSessionControlSessionStartCommand(CodaCallback(this, &CodaRunControl::handleDebugSessionStarted));
else
m_codaDevice->sendLoggingAddListenerCommand(CodaCallback(this, &CodaRunControl::handleAddListener));
} }
void CodaRunControl::handleConnected(const CodaEvent &event) void CodaRunControl::handleConnected(const CodaEvent &event)
@@ -241,8 +237,6 @@ void CodaRunControl::handleConnected(const CodaEvent &event)
setProgress(maxProgress()*0.80); setProgress(maxProgress()*0.80);
m_codaServices = static_cast<const CodaLocatorHelloEvent &>(event).services(); m_codaServices = static_cast<const CodaLocatorHelloEvent &>(event).services();
if (m_codaServices.contains(QLatin1String("DebugSessionControl")))
m_codaFlags |= OptionsUseDebugSession;
emit connected(); emit connected();
if (!m_stopAfterConnect) if (!m_stopAfterConnect)
@@ -255,11 +249,7 @@ void CodaRunControl::handleContextRemoved(const CodaEvent &event)
= static_cast<const CodaRunControlContextRemovedEvent &>(event).ids(); = static_cast<const CodaRunControlContextRemovedEvent &>(event).ids();
if (!m_runningProcessId.isEmpty() if (!m_runningProcessId.isEmpty()
&& removedItems.contains(m_runningProcessId.toAscii())) { && removedItems.contains(m_runningProcessId.toAscii())) {
appendMessage(tr("Process has finished.\n"), Utils::NormalMessageFormat);
if (m_codaFlags & OptionsUseDebugSession)
m_codaDevice->sendDebugSessionControlSessionEndCommand(CodaCallback(this, &CodaRunControl::handleDebugSessionEnded)); m_codaDevice->sendDebugSessionControlSessionEndCommand(CodaCallback(this, &CodaRunControl::handleDebugSessionEnded));
else
finishRunControl();
} }
} }
@@ -355,7 +345,7 @@ void CodaRunControl::handleFindProcesses(const CodaCommandResult &result)
executableUid(), executableUid(),
commandLineArguments().split(' '), commandLineArguments().split(' '),
QString(), QString(),
!(m_codaFlags & OptionsUseDebugSession)); true);
appendMessage(tr("Launching: %1\n").arg(executableName()), Utils::NormalMessageFormat); appendMessage(tr("Launching: %1\n").arg(executableName()), Utils::NormalMessageFormat);
} }
} }
@@ -365,7 +355,6 @@ void CodaRunControl::handleCreateProcess(const CodaCommandResult &result)
const bool ok = result.type == CodaCommandResult::SuccessReply; const bool ok = result.type == CodaCommandResult::SuccessReply;
bool processCreated = false; bool processCreated = false;
if (ok) { if (ok) {
if (m_codaFlags & OptionsUseDebugSession) {
if (result.values.size()) { if (result.values.size()) {
JsonValue id = result.values.at(0).findChild("ID"); JsonValue id = result.values.at(0).findChild("ID");
if (id.isValid()) { if (id.isValid()) {
@@ -374,8 +363,6 @@ void CodaRunControl::handleCreateProcess(const CodaCommandResult &result)
processCreated = true; processCreated = true;
} }
} }
} else // If no DebugSession is present the process will already be created by now
processCreated = true;
} }
if (processCreated) { if (processCreated) {
setProgress(maxProgress()); setProgress(maxProgress());

View File

@@ -116,11 +116,6 @@ private:
StateDebugSessionEnded StateDebugSessionEnded
}; };
enum Options {
OptionsNone = 0,
OptionsUseDebugSession = 1
};
QSharedPointer<Coda::CodaDevice> m_codaDevice; QSharedPointer<Coda::CodaDevice> m_codaDevice;
QString m_address; QString m_address;
@@ -130,7 +125,6 @@ private:
QStringList m_codaServices; QStringList m_codaServices;
State m_state; State m_state;
quint32 m_codaFlags;
bool m_stopAfterConnect; bool m_stopAfterConnect;
}; };