diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-11 00:08:59 +0100 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-11 00:08:59 +0100 |
| commit | f92941ec79d8ddaf772a7f1e21600c447af87ecd (patch) | |
| tree | 4c2ccf5d7dd9eb753c03a8ab40e63b518a4e5ed5 /daemon/bankmanager.cpp | |
| parent | c1230f9c89218e4c47a21aac20f2593fbd751224 (diff) | |
Moved all Pebble App file access to AppInfo
Diffstat (limited to 'daemon/bankmanager.cpp')
| -rw-r--r-- | daemon/bankmanager.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/daemon/bankmanager.cpp b/daemon/bankmanager.cpp index 8f31959..f4bb7b3 100644 --- a/daemon/bankmanager.cpp +++ b/daemon/bankmanager.cpp @@ -78,27 +78,25 @@ bool BankManager::uploadApp(const QUuid &uuid, int slot) return false; } - qCDebug(l) << "about to install app " << info.shortName() << "into slot" << slot; + qCDebug(l) << "about to install app" << info.shortName() << "into slot" << slot; - QFile *binaryFile = new QFile(info.filePath(AppInfo::BINARY), this); + QIODevice *binaryFile = info.openFile(AppInfo::BINARY); if (!binaryFile->open(QIODevice::ReadOnly)) { - qCWarning(l) << "failed to open" << binaryFile->fileName() << ":" << binaryFile->errorString(); + qCWarning(l) << "failed to open" << info.shortName() + << "AppInfo::BINARY" << binaryFile->errorString(); delete binaryFile; return false; } qCDebug(l) << "binary file size is" << binaryFile->size(); - QFile *resourceFile = 0; - QString resourceFileName = info.filePath(AppInfo::RESOURCES); - if (!resourceFileName.isEmpty()) { - resourceFile = new QFile(resourceFileName, this); - if (!resourceFile->open(QIODevice::ReadOnly)) { - qCWarning(l) << "failed to open" << resourceFile->fileName() << ":" << resourceFile->errorString(); - delete binaryFile; - delete resourceFile; - return false; - } + QIODevice *resourceFile = info.openFile(AppInfo::RESOURCES); + if (resourceFile && !resourceFile->open(QIODevice::ReadOnly)) { + qCWarning(l) << "failed to open " << info.shortName() + << "AppInfo::RESOURCES" << resourceFile->errorString(); + delete binaryFile; + delete resourceFile; + return false; } // Mark the slot as used, but without any app, just in case. |
