Commit bbe3bab2 authored by Robert Loehning's avatar Robert Loehning
Browse files

Trk: Fixed installing without running.

parent 8b9f29f9
...@@ -127,8 +127,6 @@ bool Launcher::startServer(QString *errorMessage) ...@@ -127,8 +127,6 @@ bool Launcher::startServer(QString *errorMessage)
d->m_device.sendTrkMessage(TrkSupported, TrkCallback(this, &Launcher::handleSupportMask)); d->m_device.sendTrkMessage(TrkSupported, TrkCallback(this, &Launcher::handleSupportMask));
d->m_device.sendTrkMessage(TrkCpuType, TrkCallback(this, &Launcher::handleCpuType)); d->m_device.sendTrkMessage(TrkCpuType, TrkCallback(this, &Launcher::handleCpuType));
d->m_device.sendTrkMessage(TrkVersions, TrkCallback(this, &Launcher::handleTrkVersion)); 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()) if (d->m_copyState.sourceFileName.isEmpty() || d->m_copyState.destinationFileName.isEmpty())
installAndRun(); installAndRun();
else else
...@@ -144,12 +142,12 @@ void Launcher::setVerbose(int v) ...@@ -144,12 +142,12 @@ void Launcher::setVerbose(int v)
void Launcher::installAndRun() void Launcher::installAndRun()
{ {
if (!d->m_installFileName.isEmpty()) { if (d->m_installFileName.isEmpty())
installRemotePackageSilently(d->m_installFileName);
} else {
startInferiorIfNeeded(); startInferiorIfNeeded();
} else
installRemotePackageSilently(d->m_installFileName);
} }
void Launcher::logMessage(const QString &msg) void Launcher::logMessage(const QString &msg)
{ {
if (d->m_verbose) if (d->m_verbose)
...@@ -295,7 +293,6 @@ void Launcher::handleTrkVersion(const TrkResult &result) ...@@ -295,7 +293,6 @@ void Launcher::handleTrkVersion(const TrkResult &result)
<< " float size: " << d->m_session.fpTypeSize << " float size: " << d->m_session.fpTypeSize
<< " Trk: v" << trkMajor << '.' << trkMinor << " Protocol: " << protocolMajor << '.' << protocolMinor; << " Trk: v" << trkMajor << '.' << trkMinor << " Protocol: " << protocolMajor << '.' << protocolMinor;
qWarning("%s", qPrintable(msg)); qWarning("%s", qPrintable(msg));
d->m_device.sendTrkMessage(TrkPing, TrkCallback(this, &Launcher::waitForTrkFinished));
} }
} }
...@@ -497,15 +494,18 @@ void Launcher::installRemotePackageSilently(const QString &fileName) ...@@ -497,15 +494,18 @@ void Launcher::installRemotePackageSilently(const QString &fileName)
void Launcher::handleInstallPackageFinished(const TrkResult &) void Launcher::handleInstallPackageFinished(const TrkResult &)
{ {
if (d->m_fileName.isEmpty()) { if (d->m_fileName.isEmpty())
emit finished(); emit finished();
} else { else
startInferiorIfNeeded(); startInferiorIfNeeded();
}
} }
void Launcher::startInferiorIfNeeded() void Launcher::startInferiorIfNeeded()
{ {
if (d->m_fileName.isEmpty()) {
d->m_device.sendTrkMessage(TrkPing, TrkCallback(this, &Launcher::waitForTrkFinished));
return;
}
emit startingApplication(); emit startingApplication();
if (d->m_session.pid != 0) { if (d->m_session.pid != 0) {
logMessage("Process already 'started'"); logMessage("Process already 'started'");
......
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