# HG changeset patch # User Andre Heinecke # Date 1410952399 -7200 # Node ID 1a5f9e2600996e8bab573a2d1a6176e4dd365385 # Parent a07030035349095d2393a0f7c4bcae6fa5fe1c32 (issue130) Remove USE_REAL_RESOURCE option and implement behavior as descript in the issue diff -r a07030035349 -r 1a5f9e260099 ui/mainwindow.cpp --- a/ui/mainwindow.cpp Wed Sep 17 12:14:07 2014 +0200 +++ b/ui/mainwindow.cpp Wed Sep 17 13:13:19 2014 +0200 @@ -66,7 +66,7 @@ #define TB_ARCH_STRING "-amd64" #endif -#ifdef USE_REAL_RESOURCES +#ifdef IS_TAG_BUILD # define LIST_RESOURCE "/zertifikatsliste.txt" # ifdef Q_OS_WIN # define SW_RESOURCE_VERSION "/TrustBridge-%1.exe" @@ -75,13 +75,13 @@ # define SW_RESOURCE_VERSION "/TrustBridge-%1" TB_ARCH_STRING ".sh" # define SW_RESOURCE "/TrustBridge" TB_ARCH_STRING ".sh" # endif -#else // RELEASE_BUILD +#else // Not tag build means develpment build # define LIST_RESOURCE "/zertifikatsliste.txt" # ifdef Q_OS_WIN -# define SW_RESOURCE_VERSION "/development/TrustBridge-development.exe" +# define SW_RESOURCE_VERSION "/development/TrustBridge-%1.exe" # define SW_RESOURCE "/development/TrustBridge.exe" # else -# define SW_RESOURCE_VERSION "/development/TrustBridge-development" TB_ARCH_STRING ".sh" +# define SW_RESOURCE_VERSION "/development/TrustBridge-%1" TB_ARCH_STRING ".sh" # define SW_RESOURCE "/development/TrustBridge" TB_ARCH_STRING ".sh" # endif #endif @@ -222,6 +222,7 @@ QString swFileName = mSettings.value("Software/available").toString(); if (swFileName.isEmpty()) { + qDebug() << "Date set but no fileName"; mSettings.remove("Software/availableDate"); return; } @@ -538,7 +539,6 @@ this, SLOT(downloaderError(const QString &, SSLConnection::ErrorCode))); connect(downloader, SIGNAL(lastModifiedDate(const QDateTime&)), this, SLOT(setLastModifiedSWDate(const QDateTime&))); - downloader->start(); } @@ -563,6 +563,15 @@ showErrorMessage(tr("Failed to check for updates:") + "\n" + message); } setState(TransferError); + +#ifndef IS_TAG_BUILD + /* For development versions we default to datetime::now if + * we can not find our version. */ + if (!mSettings.contains("Software/installedDate") || + mSettings.value("Software/installedVersion").toString() != QApplication::applicationVersion()) { + setLastModifiedSWDate(QDateTime::currentDateTime()); + } +#endif } void MainWindow::createActions()