diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index fc1000f38e1..88f2c344149 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -644,6 +644,7 @@ void S60DeviceRunControl::signsisProcessFinished() connect(m_launcher, SIGNAL(installingStarted()), this, SLOT(printInstallingNotice())); connect(m_launcher, SIGNAL(startingApplication()), this, SLOT(printStartingNotice())); connect(m_launcher, SIGNAL(applicationRunning(uint)), this, SLOT(printRunNotice(uint))); + connect(m_launcher, SIGNAL(canNotRun(QString)), this, SLOT(printRunFailNotice(QString))); connect(m_launcher, SIGNAL(applicationOutputReceived(QString)), this, SLOT(printApplicationOutput(QString))); connect(m_launcher, SIGNAL(copyProgress(int)), this, SLOT(printCopyProgress(int))); @@ -692,6 +693,10 @@ void S60DeviceRunControl::printRunNotice(uint pid) emit addToOutputWindow(this, tr("Application running with pid %1.").arg(pid)); } +void S60DeviceRunControl::printRunFailNotice(const QString &errorMessage) { + emit addToOutputWindow(this, tr("Could not start application: %1").arg(errorMessage)); +} + void S60DeviceRunControl::printApplicationOutput(const QString &output) { emit addToOutputWindowInline(this, output); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h index 626b9625148..5ac7e7be091 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h @@ -164,6 +164,7 @@ private slots: void printInstallingNotice(); void printStartingNotice(); void printRunNotice(uint pid); + void printRunFailNotice(const QString &errorMessage); void printApplicationOutput(const QString &output); void runFinished(); diff --git a/src/shared/trk/launcher.cpp b/src/shared/trk/launcher.cpp index 0ff118ec12c..7a9342740c7 100644 --- a/src/shared/trk/launcher.cpp +++ b/src/shared/trk/launcher.cpp @@ -368,6 +368,11 @@ void Launcher::handleCpuType(const TrkResult &result) void Launcher::handleCreateProcess(const TrkResult &result) { + if (result.errorCode()) { + emit canNotRun(errorMessage(result.errorCode())); + emit finished(); + return; + } // 40 00 00] //logMessage(" RESULT: " + result.toString()); // [80 08 00 00 00 01 B5 00 00 01 B6 78 67 40 00 00 40 00 00] diff --git a/src/shared/trk/launcher.h b/src/shared/trk/launcher.h index 7a2eccf1cb2..b24ed7d73d0 100644 --- a/src/shared/trk/launcher.h +++ b/src/shared/trk/launcher.h @@ -60,6 +60,7 @@ signals: void installingStarted(); void startingApplication(); void applicationRunning(uint pid); + void canNotRun(const QString &errorMessage); void finished(); void applicationOutputReceived(const QString &output); void copyProgress(int percent); @@ -71,8 +72,6 @@ private slots: void handleResult(const trk::TrkResult &data); private: - void tryTrkRead(); - // kill process and breakpoints void cleanUp(); @@ -89,7 +88,6 @@ private: void handleTrkVersion(const TrkResult &result); void waitForTrkFinished(const TrkResult &data); - void handleAndReportCreateProcess(const TrkResult &result); void copyFileToRemote(); void installRemotePackageSilently(const QString &filename); void installAndRun(); diff --git a/src/shared/trk/trkdevice.cpp b/src/shared/trk/trkdevice.cpp index 3e1fcda057b..775b7727960 100644 --- a/src/shared/trk/trkdevice.cpp +++ b/src/shared/trk/trkdevice.cpp @@ -621,8 +621,7 @@ int WinReaderThread::tryRead() void WinReaderThread::run() { m_handles[FileHandle] = m_context->readOverlapped.hEvent; - int readResult; - while ( (readResult = tryRead()) == 0) ; + while ( tryRead() == 0) ; } void WinReaderThread::terminate() @@ -736,9 +735,8 @@ int UnixReaderThread::tryRead() void UnixReaderThread::run() { - int readResult; // Read loop - while ( (readResult = tryRead()) == 0) ; + while ( tryRead() == 0) ; } void UnixReaderThread::terminate() diff --git a/src/shared/trk/trkdevice.h b/src/shared/trk/trkdevice.h index 7fac552ef12..579d32acf3b 100644 --- a/src/shared/trk/trkdevice.h +++ b/src/shared/trk/trkdevice.h @@ -95,8 +95,6 @@ public: // Send an Ack synchronously, bypassing the queue bool sendTrkAck(unsigned char token); - void tryTrkRead(); // TODO: Why public? - signals: void messageReceived(const trk::TrkResult &result); // Emitted with the contents of messages enclosed in 07e, not for log output