summaryrefslogtreecommitdiffstats
path: root/qt-ui/updatemanager.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-02-15 20:25:18 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-15 13:26:51 -0800
commitc45768a09ffcc6393912b74ed3661b5a110041e8 (patch)
treee0f322e344a337abd4d9aa40e85e21a58c65af5e /qt-ui/updatemanager.cpp
parentf6dbed1fc6c71251e1937cb1b63e96ff7a8251c3 (diff)
downloadsubsurface-c45768a09ffcc6393912b74ed3661b5a110041e8.tar.gz
add and use a version.c / version.h pair
version.c is now object code which is recompiled each time ssrf-version.h changes, while the interface file version.h remains that same at all times and files which include it will not need to be recompiled. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/updatemanager.cpp')
-rw-r--r--qt-ui/updatemanager.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/qt-ui/updatemanager.cpp b/qt-ui/updatemanager.cpp
index 3fff8b45d..fbaa6ba3c 100644
--- a/qt-ui/updatemanager.cpp
+++ b/qt-ui/updatemanager.cpp
@@ -4,7 +4,7 @@
#include <QMessageBox>
#include <QUuid>
#include "subsurfacewebservices.h"
-#include "ssrf-version.h"
+#include "version.h"
#include "mainwindow.h"
UpdateManager::UpdateManager(QObject *parent) : QObject(parent)
@@ -16,9 +16,9 @@ UpdateManager::UpdateManager(QObject *parent) : QObject(parent)
return;
if (settings.contains("LastVersionUsed")) {
// we have checked at least once before
- if (settings.value("LastVersionUsed").toString() != GIT_VERSION_STRING) {
+ if (settings.value("LastVersionUsed").toString() != subsurface_git_version()) {
// we have just updated - wait two weeks before you check again
- settings.setValue("LastVersionUsed", QString(GIT_VERSION_STRING));
+ settings.setValue("LastVersionUsed", QString(subsurface_git_version()));
settings.setValue("NextCheck", QDateTime::currentDateTime().addDays(14).toString(Qt::ISODate));
} else {
// is it time to check again?
@@ -28,7 +28,7 @@ UpdateManager::UpdateManager(QObject *parent) : QObject(parent)
return;
}
}
- settings.setValue("LastVersionUsed", QString(GIT_VERSION_STRING));
+ settings.setValue("LastVersionUsed", QString(subsurface_git_version()));
settings.setValue("NextCheck", QDateTime::currentDateTime().addDays(14).toString(Qt::ISODate));
checkForUpdates(true);
}
@@ -47,7 +47,7 @@ void UpdateManager::checkForUpdates(bool automatic)
os = "unknown";
#endif
isAutomaticCheck = automatic;
- QString version = CANONICAL_VERSION_STRING;
+ QString version = subsurface_canonical_version();
QString uuidString = getUUID();
QString url = QString("http://subsurface-divelog.org/updatecheck.html?os=%1&version=%2&uuid=%3").arg(os, version, uuidString);
QNetworkRequest request;