diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index 5b1a314c7a6d7a79eda2b7dfe94ad4d4809ec46e..260e25cf4051e644b666eb9820fbc6dc03aa2e39 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -630,6 +630,7 @@ void S60DeviceRunControlBase::signsisProcessFinished() connect(m_launcher, SIGNAL(canNotCreateFile(QString,QString)), this, SLOT(printCreateFileFailed(QString,QString))); connect(m_launcher, SIGNAL(canNotWriteFile(QString,QString)), this, SLOT(printWriteFileFailed(QString,QString))); connect(m_launcher, SIGNAL(installingStarted()), this, SLOT(printInstallingNotice())); + connect(m_launcher, SIGNAL(canNotInstall(QString,QString)), this, SLOT(printInstallFailed(QString,QString))); connect(m_launcher, SIGNAL(copyProgress(int)), this, SLOT(printCopyProgress(int))); //TODO sisx destination and file path user definable @@ -676,6 +677,11 @@ void S60DeviceRunControlBase::printInstallingNotice() emit addToOutputWindow(this, tr("Installing application...")); } +void S60DeviceRunControlBase::printInstallFailed(const QString &filename, const QString &errorMessage) +{ + emit addToOutputWindow(this, tr("Could not install from package %1 on device: %2").arg(filename, errorMessage)); +} + void S60DeviceRunControlBase::launcherFinished() { m_launcher->deleteLater(); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h index fd67e5431cbd8ce686d7bbde78d3969a0dbe0de4..65f9d7f3eef9ac4fcbc4625685c66cf89eb442f6 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h @@ -175,6 +175,7 @@ private slots: void printWriteFileFailed(const QString &filename, const QString &errorMessage); void printCopyProgress(int progress); void printInstallingNotice(); + void printInstallFailed(const QString &filename, const QString &errorMessage); void launcherFinished(); private: diff --git a/src/shared/trk/launcher.cpp b/src/shared/trk/launcher.cpp index e6cf4d9a7aa3980d855fd15f1b79dbbce36ac3be..936d740f941ee1d5d7c0eac987af9a1c7f1850a1 100644 --- a/src/shared/trk/launcher.cpp +++ b/src/shared/trk/launcher.cpp @@ -155,7 +155,7 @@ bool Launcher::startServer(QString *errorMessage) if (d->m_startupActions & ActionCopy) copyFileToRemote(); else if (d->m_startupActions & ActionInstall) - installRemotePackageSilently(d->m_installFileName); + installRemotePackageSilently(); else if (d->m_startupActions & ActionRun) startInferiorIfNeeded(); return true; @@ -379,7 +379,7 @@ void Launcher::handleFileCopied(const TrkResult &result) { Q_UNUSED(result) if (d->m_startupActions & ActionInstall) - installRemotePackageSilently(d->m_installFileName); + installRemotePackageSilently(); else if (d->m_startupActions & ActionRun) startInferiorIfNeeded(); else @@ -518,21 +518,25 @@ void Launcher::copyFileToRemote() d->m_device.sendTrkMessage(TrkOpenFile, TrkCallback(this, &Launcher::handleFileCreation), ba); } -void Launcher::installRemotePackageSilently(const QString &fileName) +void Launcher::installRemotePackageSilently() { emit installingStarted(); QByteArray ba; appendByte(&ba, 'C'); - appendString(&ba, fileName.toLocal8Bit(), TargetByteOrder, false); + appendString(&ba, d->m_installFileName.toLocal8Bit(), TargetByteOrder, false); d->m_device.sendTrkMessage(TrkInstallFile, TrkCallback(this, &Launcher::handleInstallPackageFinished), ba); } -void Launcher::handleInstallPackageFinished(const TrkResult &) +void Launcher::handleInstallPackageFinished(const TrkResult &result) { - if (d->m_startupActions & ActionRun) + if (result.errorCode()) { + emit canNotInstall(d->m_installFileName, result.errorString()); + emit finished(); + } else if (d->m_startupActions & ActionRun) { startInferiorIfNeeded(); - else + } else { emit finished(); + } } void Launcher::startInferiorIfNeeded() diff --git a/src/shared/trk/launcher.h b/src/shared/trk/launcher.h index 0af92a81e80af4ce855ad7ea27561141f5b556c1..3c84e6f9d90d544524eb9d2589f0f5ed00f70e00 100644 --- a/src/shared/trk/launcher.h +++ b/src/shared/trk/launcher.h @@ -72,6 +72,7 @@ signals: void canNotCreateFile(const QString &filename, const QString &errorMessage); void canNotWriteFile(const QString &filename, const QString &errorMessage); void installingStarted(); + void canNotInstall(const QString &packageFilename, const QString &errorMessage); void startingApplication(); void applicationRunning(uint pid); void canNotRun(const QString &errorMessage); @@ -104,7 +105,7 @@ private: void waitForTrkFinished(const TrkResult &data); void copyFileToRemote(); - void installRemotePackageSilently(const QString &filename); + void installRemotePackageSilently(); void startInferiorIfNeeded(); void logMessage(const QString &msg);