comparison ui/mainwindow.cpp @ 1256:8ceaa189570d

(issue44) also accept that an update happened if the current version is newer
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 26 Sep 2014 11:31:12 +0200
parents 9a482182f80f
children 8bfbfd4ea568
comparison
equal deleted inserted replaced
1255:2a1aa9df8f11 1256:8ceaa189570d
512 QDateTime listInstalledLastMod = mSettings.value("List/installedDate").toDateTime(); 512 QDateTime listInstalledLastMod = mSettings.value("List/installedDate").toDateTime();
513 QDateTime swInstalledLastMod = mSettings.value("Software/installedDate").toDateTime(); 513 QDateTime swInstalledLastMod = mSettings.value("Software/installedDate").toDateTime();
514 514
515 QDateTime swAvailableLastMod = mSettings.value("Software/availableDate").toDateTime(); 515 QDateTime swAvailableLastMod = mSettings.value("Software/availableDate").toDateTime();
516 516
517 if (swAvailableLastMod.isValid()) { 517 if (swAvailableLastMod.isValid() && swInstalledLastMod.isValid()) {
518 qDebug() << "Installed an update: " << swInstalledLastMod << 518 if (swInstalledLastMod >= swAvailableLastMod) {
519 " available " << swAvailableLastMod; 519 qDebug() << "Installed an update: " << swInstalledLastMod <<
520 syslog_info_printf ("Software has been updated to version: %s\n", 520 " available " << swAvailableLastMod;
521 syslog_info_printf ("Software has been updated to version: %s\n",
521 QApplication::applicationVersion().toUtf8().constData()); 522 QApplication::applicationVersion().toUtf8().constData());
522 if (swInstalledLastMod == swAvailableLastMod) {
523 QString fileName = mSettings.value("Software/available").toString(); 523 QString fileName = mSettings.value("Software/available").toString();
524 if (fileName.isEmpty()) { 524 if (fileName.isEmpty()) {
525 qDebug() << "Software marked as available but no filename set."; 525 qDebug() << "Software marked as available but no filename set.";
526 } else { 526 } else {
527 if (QFile::remove(fileName)) { 527 if (QFile::remove(fileName)) {

http://wald.intevation.org/projects/trustbridge/