Commit 9f7794a3 authored by Robert Loehning's avatar Robert Loehning
Browse files

Trk: Checking result of TrkInstallFile.

parent b61969be
......@@ -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();
......
......@@ -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:
......
......@@ -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()
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment