Mercurial > trustbridge
comparison ui/mainwindow.cpp @ 1056:c7db2cc97bad
(issue44) Remove downloaded binaries after update
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 09 Sep 2014 17:04:10 +0200 |
parents | 9812983e7650 |
children | db831a204a6b |
comparison
equal
deleted
inserted
replaced
1055:9812983e7650 | 1056:c7db2cc97bad |
---|---|
376 getLastModForCurrentVersion(); | 376 getLastModForCurrentVersion(); |
377 return; | 377 return; |
378 } | 378 } |
379 QDateTime listInstalledLastMod = mSettings.value("List/installedDate").toDateTime(); | 379 QDateTime listInstalledLastMod = mSettings.value("List/installedDate").toDateTime(); |
380 QDateTime swInstalledLastMod = mSettings.value("Software/installedDate").toDateTime(); | 380 QDateTime swInstalledLastMod = mSettings.value("Software/installedDate").toDateTime(); |
381 | |
382 QDateTime swAvailableLastMod = mSettings.value("Software/availableDate").toDateTime(); | |
383 | |
384 if (swAvailableLastMod.isValid()) { | |
385 qDebug() << "Installed an update: " << swInstalledLastMod << | |
386 " available " << swAvailableLastMod; | |
387 if (swInstalledLastMod == swAvailableLastMod) { | |
388 QString fileName = mSettings.value("Software/available").toString(); | |
389 if (fileName.isEmpty()) { | |
390 qDebug() << "Software marked as available but no filename set."; | |
391 } else { | |
392 if (QFile::remove(fileName)) { | |
393 qDebug() << "Removed: " << fileName; | |
394 } else { | |
395 qDebug() << "Failed to remove: " << fileName; | |
396 } | |
397 } | |
398 /* Clear out available data. */ | |
399 mSettings.remove("Software/available"); | |
400 mSettings.remove("Software/availableDate"); | |
401 } | |
402 } | |
381 | 403 |
382 QString listResource = QString::fromLatin1(LIST_RESOURCE); | 404 QString listResource = QString::fromLatin1(LIST_RESOURCE); |
383 QString swResource = QString::fromLatin1(SW_RESOURCE); | 405 QString swResource = QString::fromLatin1(SW_RESOURCE); |
384 | 406 |
385 #ifndef RELEASE_BUILD | 407 #ifndef RELEASE_BUILD |