summaryrefslogtreecommitdiffstats
path: root/qt-ui/updatemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/updatemanager.cpp')
-rw-r--r--qt-ui/updatemanager.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/qt-ui/updatemanager.cpp b/qt-ui/updatemanager.cpp
index 3fff8b45d..8a22400b9 100644
--- a/qt-ui/updatemanager.cpp
+++ b/qt-ui/updatemanager.cpp
@@ -1,10 +1,11 @@
#include "updatemanager.h"
#include "usersurvey.h"
+#include "helpers.h"
#include <QtNetwork>
#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 +17,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 +29,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,13 +48,13 @@ 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;
request.setUrl(url);
request.setRawHeader("Accept", "text/xml");
- QString userAgent = UserSurvey::getUserAgent();
+ QString userAgent = getUserAgent();
request.setRawHeader("User-Agent", userAgent.toUtf8());
connect(SubsurfaceWebServices::manager()->get(request), SIGNAL(finished()), this, SLOT(requestReceived()), Qt::UniqueConnection);
}