diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index 88f2c344149e44bfc2042c3a64788294ee7a4a18..9b2846fffaa0b9d16a2405560b5ad38022a261c1 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -641,6 +641,7 @@ void S60DeviceRunControl::signsisProcessFinished() m_launcher = new trk::Launcher; connect(m_launcher, SIGNAL(finished()), this, SLOT(runFinished())); connect(m_launcher, SIGNAL(copyingStarted()), this, SLOT(printCopyingNotice())); + connect(m_launcher, SIGNAL(canNotCreateFile(QString,QString)), this, SLOT(printCreateFileFailed(QString,QString))); 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))); @@ -673,6 +674,11 @@ void S60DeviceRunControl::printCopyingNotice() emit addToOutputWindow(this, tr("0% copied.")); } +void S60DeviceRunControl::printCreateFileFailed(const QString &filename, const QString &errorMessage) +{ + emit addToOutputWindow(this, tr("Could not create file %1 on device: %2").arg(filename, errorMessage)); +} + void S60DeviceRunControl::printCopyProgress(int progress) { emit addToOutputWindow(this, tr("%1% copied.").arg(progress)); diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h index 5ac7e7be091ae3f681ffdd21019be046cfb8b8df..48cafb8c7f1faaf9e86ecf67c7235094b7f39284 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h @@ -160,6 +160,7 @@ private slots: void signsisProcessFailed(); void signsisProcessFinished(); void printCopyingNotice(); + void printCreateFileFailed(const QString &filename, const QString &errorMessage); void printCopyProgress(int progress); void printInstallingNotice(); void printStartingNotice(); diff --git a/src/shared/trk/launcher.cpp b/src/shared/trk/launcher.cpp index 697498ece3d10b51f831b8e6fdd5d3cb4938047a..e74318ad93554aefb4279a2b15ac568a9918e555 100644 --- a/src/shared/trk/launcher.cpp +++ b/src/shared/trk/launcher.cpp @@ -129,10 +129,10 @@ bool Launcher::startServer(QString *errorMessage) d->m_device.sendTrkMessage(TrkVersions, TrkCallback(this, &Launcher::handleTrkVersion)); if (d->m_fileName.isEmpty()) return true; - if (!d->m_copyState.sourceFileName.isEmpty() && !d->m_copyState.destinationFileName.isEmpty()) - copyFileToRemote(); - else + if (d->m_copyState.sourceFileName.isEmpty() || d->m_copyState.destinationFileName.isEmpty()) installAndRun(); + else + copyFileToRemote(); return true; } @@ -301,7 +301,11 @@ void Launcher::handleTrkVersion(const TrkResult &result) void Launcher::handleFileCreation(const TrkResult &result) { - // we don't do any error handling yet, which is bad + if (result.errorCode() || result.data.size() < 6) { + emit canNotCreateFile(d->m_copyState.destinationFileName, errorMessage(result.errorCode())); + emit finished(); + return; + } const char *data = result.data.data(); d->m_copyState.copyFileHandle = extractInt(data + 2); QFile file(d->m_copyState.sourceFileName); diff --git a/src/shared/trk/launcher.h b/src/shared/trk/launcher.h index b24ed7d73d0ed3a590ee0483fdf5a949b8140bef..01c83ff7906dc4afe3b151ed68ae17bb955f96fa 100644 --- a/src/shared/trk/launcher.h +++ b/src/shared/trk/launcher.h @@ -57,6 +57,7 @@ public: signals: void copyingStarted(); + void canNotCreateFile(const QString &filename, const QString &errorMessage); void installingStarted(); void startingApplication(); void applicationRunning(uint pid);