diff --git a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp b/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp index cc8af55573d..ac5977d0d40 100644 --- a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp @@ -186,6 +186,7 @@ void CodaRunControl::slotSerialPong(const QString &message) { if (debug > 1) qDebug() << "CODA serial pong:" << message; + handleConnected(); } void CodaRunControl::slotCodaEvent(const CodaEvent &event) @@ -194,13 +195,9 @@ void CodaRunControl::slotCodaEvent(const CodaEvent &event) qDebug() << "CODA event:" << "Type:" << event.type() << "Message:" << event.toString(); switch (event.type()) { - case CodaEvent::LocatorHello: { // Commands accepted now - m_state = StateConnected; - appendMessage(tr("Connected."), NormalMessageFormat); - setProgress(maxProgress()*0.80); - initCommunication(); - } - break; + case CodaEvent::LocatorHello: + handleConnected(); + break; case CodaEvent::RunControlContextRemoved: handleContextRemoved(event); break; @@ -230,6 +227,16 @@ void CodaRunControl::initCommunication() m_codaDevice->sendLoggingAddListenerCommand(CodaCallback(this, &CodaRunControl::handleAddListener)); } +void CodaRunControl::handleConnected() +{ + if (m_state >= StateConnected) + return; + m_state = StateConnected; + appendMessage(tr("Connected."), NormalMessageFormat); + setProgress(maxProgress()*0.80); + initCommunication(); +} + void CodaRunControl::handleContextRemoved(const CodaEvent &event) { const QVector removedItems diff --git a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.h b/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.h index f1266ae1b62..72a667062e4 100644 --- a/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.h +++ b/src/plugins/qt4projectmanager/qt-s60/codaruncontrol.h @@ -86,6 +86,7 @@ private slots: private: void initCommunication(); + void handleConnected(); void handleModuleLoadSuspended(const Coda::CodaEvent &event); void handleContextSuspended(const Coda::CodaEvent &event); void handleContextAdded(const Coda::CodaEvent &event); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp index 68a1cb689ec..53af8104d31 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp @@ -200,9 +200,6 @@ bool S60DeployStep::init() return true; } - if (debug) - m_launcher->setVerbose(debug); - // Prompt the user to start up the Bluetooth connection const trk::PromptStartCommunicationResult src = S60RunConfigBluetoothStarter::startCommunication(m_launcher->trkDevice(), @@ -466,6 +463,7 @@ void S60DeployStep::slotSerialPong(const QString &message) { if (debug) qDebug() << "CODA serial pong:" << message; + handleConnected(); } void S60DeployStep::slotCodaEvent(const Coda::CodaEvent &event) @@ -474,12 +472,9 @@ void S60DeployStep::slotCodaEvent(const Coda::CodaEvent &event) qDebug() << "CODA event:" << "Type:" << event.type() << "Message:" << event.toString(); switch (event.type()) { - case Coda::CodaEvent::LocatorHello: {// Commands accepted now - m_state = StateConnected; - emit codaConnected(); - startTransferring(); + case Coda::CodaEvent::LocatorHello: + handleConnected(); break; - } default: if (debug) qDebug() << "Unhandled event:" << "Type:" << event.type() << "Message:" << event.toString(); @@ -487,6 +482,15 @@ void S60DeployStep::slotCodaEvent(const Coda::CodaEvent &event) } } +void S60DeployStep::handleConnected() +{ + if (m_state >= StateConnected) + return; + m_state = StateConnected; + emit codaConnected(); + startTransferring(); +} + void S60DeployStep::initFileSending() { QTC_ASSERT(m_currentFileIndex < m_signedPackages.count(), return); @@ -639,7 +643,6 @@ void S60DeployStep::checkForTimeout() { if (m_state != StateConnecting) return; - QMessageBox *mb = CodaRunControl::createCodaWaitingMessageBox(Core::ICore::instance()->mainWindow()); connect(this, SIGNAL(codaConnected()), mb, SLOT(close())); connect(this, SIGNAL(finished()), mb, SLOT(close())); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h index 1c3e85176db..855164a9ac6 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60deploystep.h @@ -167,6 +167,7 @@ private: void appendMessage(const QString &error, bool isError); void reportError(const QString &error); + void handleConnected(); void handleSymbianInstall(const Coda::CodaCommandResult &result); void handleFileSystemOpen(const Coda::CodaCommandResult &result); void handleFileSystemWrite(const Coda::CodaCommandResult &result);