comparison ui/mainwindow.cpp @ 1127:1a5f9e260099

(issue130) Remove USE_REAL_RESOURCE option and implement behavior as descript in the issue
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 17 Sep 2014 13:13:19 +0200
parents a07030035349
children a4282bc67a8b
comparison
equal deleted inserted replaced
1126:a07030035349 1127:1a5f9e260099
64 #define TB_ARCH_STRING "-i386" 64 #define TB_ARCH_STRING "-i386"
65 #else 65 #else
66 #define TB_ARCH_STRING "-amd64" 66 #define TB_ARCH_STRING "-amd64"
67 #endif 67 #endif
68 68
69 #ifdef USE_REAL_RESOURCES 69 #ifdef IS_TAG_BUILD
70 # define LIST_RESOURCE "/zertifikatsliste.txt" 70 # define LIST_RESOURCE "/zertifikatsliste.txt"
71 # ifdef Q_OS_WIN 71 # ifdef Q_OS_WIN
72 # define SW_RESOURCE_VERSION "/TrustBridge-%1.exe" 72 # define SW_RESOURCE_VERSION "/TrustBridge-%1.exe"
73 # define SW_RESOURCE "/TrustBridge.exe" 73 # define SW_RESOURCE "/TrustBridge.exe"
74 # else 74 # else
75 # define SW_RESOURCE_VERSION "/TrustBridge-%1" TB_ARCH_STRING ".sh" 75 # define SW_RESOURCE_VERSION "/TrustBridge-%1" TB_ARCH_STRING ".sh"
76 # define SW_RESOURCE "/TrustBridge" TB_ARCH_STRING ".sh" 76 # define SW_RESOURCE "/TrustBridge" TB_ARCH_STRING ".sh"
77 # endif 77 # endif
78 #else // RELEASE_BUILD 78 #else // Not tag build means develpment build
79 # define LIST_RESOURCE "/zertifikatsliste.txt" 79 # define LIST_RESOURCE "/zertifikatsliste.txt"
80 # ifdef Q_OS_WIN 80 # ifdef Q_OS_WIN
81 # define SW_RESOURCE_VERSION "/development/TrustBridge-development.exe" 81 # define SW_RESOURCE_VERSION "/development/TrustBridge-%1.exe"
82 # define SW_RESOURCE "/development/TrustBridge.exe" 82 # define SW_RESOURCE "/development/TrustBridge.exe"
83 # else 83 # else
84 # define SW_RESOURCE_VERSION "/development/TrustBridge-development" TB_ARCH_STRING ".sh" 84 # define SW_RESOURCE_VERSION "/development/TrustBridge-%1" TB_ARCH_STRING ".sh"
85 # define SW_RESOURCE "/development/TrustBridge" TB_ARCH_STRING ".sh" 85 # define SW_RESOURCE "/development/TrustBridge" TB_ARCH_STRING ".sh"
86 # endif 86 # endif
87 #endif 87 #endif
88 88
89 /* Help installation path the path relative to the installation directory where 89 /* Help installation path the path relative to the installation directory where
220 void MainWindow::verifySWData() 220 void MainWindow::verifySWData()
221 { 221 {
222 QString swFileName = mSettings.value("Software/available").toString(); 222 QString swFileName = mSettings.value("Software/available").toString();
223 223
224 if (swFileName.isEmpty()) { 224 if (swFileName.isEmpty()) {
225 qDebug() << "Date set but no fileName";
225 mSettings.remove("Software/availableDate"); 226 mSettings.remove("Software/availableDate");
226 return; 227 return;
227 } 228 }
228 229
229 QFileInfo fi(swFileName); 230 QFileInfo fi(swFileName);
536 connect(downloader, SIGNAL(finished()), downloader, SLOT(deleteLater())); 537 connect(downloader, SIGNAL(finished()), downloader, SLOT(deleteLater()));
537 connect(downloader, SIGNAL(error(const QString &, SSLConnection::ErrorCode)), 538 connect(downloader, SIGNAL(error(const QString &, SSLConnection::ErrorCode)),
538 this, SLOT(downloaderError(const QString &, SSLConnection::ErrorCode))); 539 this, SLOT(downloaderError(const QString &, SSLConnection::ErrorCode)));
539 connect(downloader, SIGNAL(lastModifiedDate(const QDateTime&)), 540 connect(downloader, SIGNAL(lastModifiedDate(const QDateTime&)),
540 this, SLOT(setLastModifiedSWDate(const QDateTime&))); 541 this, SLOT(setLastModifiedSWDate(const QDateTime&)));
541
542 downloader->start(); 542 downloader->start();
543 } 543 }
544 544
545 void MainWindow::setLastModifiedSWDate(const QDateTime &date) 545 void MainWindow::setLastModifiedSWDate(const QDateTime &date)
546 { 546 {
561 showMessage(); 561 showMessage();
562 } else { 562 } else {
563 showErrorMessage(tr("Failed to check for updates:") + "\n" + message); 563 showErrorMessage(tr("Failed to check for updates:") + "\n" + message);
564 } 564 }
565 setState(TransferError); 565 setState(TransferError);
566
567 #ifndef IS_TAG_BUILD
568 /* For development versions we default to datetime::now if
569 * we can not find our version. */
570 if (!mSettings.contains("Software/installedDate") ||
571 mSettings.value("Software/installedVersion").toString() != QApplication::applicationVersion()) {
572 setLastModifiedSWDate(QDateTime::currentDateTime());
573 }
574 #endif
566 } 575 }
567 576
568 void MainWindow::createActions() 577 void MainWindow::createActions()
569 { 578 {
570 mCheckUpdates = new QAction(tr("Check for Updates"), this); 579 mCheckUpdates = new QAction(tr("Check for Updates"), this);

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