diff options
Diffstat (limited to 'daemon/bankmanager.cpp')
| -rw-r--r-- | daemon/bankmanager.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/daemon/bankmanager.cpp b/daemon/bankmanager.cpp index ef74ef6..797d7e3 100644 --- a/daemon/bankmanager.cpp +++ b/daemon/bankmanager.cpp @@ -80,7 +80,7 @@ bool BankManager::uploadApp(const QUuid &uuid, int slot) qCDebug(l) << "about to install app" << info.shortName() << "into slot" << slot; - QSharedPointer<QIODevice> binaryFile(info.openFile(AppInfo::BINARY)); + QSharedPointer<QIODevice> binaryFile(info.openFile(AppInfo::APPLICATION)); if (!binaryFile) { qCWarning(l) << "failed to open" << info.shortName() << "AppInfo::BINARY"; return false; @@ -93,11 +93,26 @@ bool BankManager::uploadApp(const QUuid &uuid, int slot) _slots[slot].name.clear(); _slots[slot].uuid = QUuid(); - upload->uploadAppBinary(slot, binaryFile.data(), info.crcFile(AppInfo::BINARY), + upload->uploadAppBinary(slot, binaryFile.data(), info.crcFile(AppInfo::APPLICATION), [this, info, binaryFile, slot]() { qCDebug(l) << "app binary upload succesful"; binaryFile->close(); + // Upload worker if present + if (info.type() == "worker") { + QSharedPointer<QIODevice> workerFile(info.openFile(AppInfo::WORKER)); + if (workerFile) { + upload->uploadAppWorker(slot, workerFile.data(), info.crcFile(AppInfo::WORKER), + [this, workerFile, slot]() { + qCDebug(l) << "app worker upload succesful"; + workerFile->close(); + }, [this, workerFile](int code) { + workerFile->close(); + qCWarning(l) << "app worker upload failed" << code; + }); + } + } + // Proceed to upload the resource file QSharedPointer<QIODevice> resourceFile(info.openFile(AppInfo::RESOURCES)); if (resourceFile) { |
