diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2015-02-15 20:25:18 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-15 13:26:51 -0800 |
commit | c45768a09ffcc6393912b74ed3661b5a110041e8 (patch) | |
tree | e0f322e344a337abd4d9aa40e85e21a58c65af5e /qt-ui | |
parent | f6dbed1fc6c71251e1937cb1b63e96ff7a8251c3 (diff) | |
download | subsurface-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')
-rw-r--r-- | qt-ui/about.cpp | 4 | ||||
-rw-r--r-- | qt-ui/mainwindow.cpp | 4 | ||||
-rw-r--r-- | qt-ui/updatemanager.cpp | 10 | ||||
-rw-r--r-- | qt-ui/usersurvey.cpp | 8 |
4 files changed, 13 insertions, 13 deletions
diff --git a/qt-ui/about.cpp b/qt-ui/about.cpp index 361031599..203357010 100644 --- a/qt-ui/about.cpp +++ b/qt-ui/about.cpp @@ -1,5 +1,5 @@ #include "about.h" -#include "ssrf-version.h" +#include "version.h" #include <QDesktopServices> #include <QUrl> #include <QShortcut> @@ -9,7 +9,7 @@ SubsurfaceAbout::SubsurfaceAbout(QWidget *parent, Qt::WindowFlags f) : QDialog(p ui.setupUi(this); setWindowModality(Qt::ApplicationModal); - QString versionString(GIT_VERSION_STRING); + QString versionString(subsurface_git_version()); QStringList readableVersions = QStringList() << "4.3.950" << "4.4 Beta 1" << "4.3.960" << "4.4 Beta 2" << "4.3.970" << "4.4 Beta 3"; diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 9a528e97f..d7f520f18 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -11,7 +11,7 @@ #include <QSettings> #include <QShortcut> #include <QToolBar> -#include "ssrf-version.h" +#include "version.h" #include "divelistview.h" #include "downloadfromdivecomputer.h" #include "preferences.h" @@ -999,7 +999,7 @@ void MainWindow::checkSurvey(QSettings *s) s->setValue("FirstUse42", value); } // wait a week for production versions, but not at all for non-tagged builds - QString ver(VERSION_STRING); + QString ver(subsurface_version()); int waitTime = 7; QDate firstUse42 = s->value("FirstUse42").toDate(); if (run_survey || (firstUse42.daysTo(QDate().currentDate()) > waitTime && !s->contains("SurveyDone"))) { 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; diff --git a/qt-ui/usersurvey.cpp b/qt-ui/usersurvey.cpp index ac8486988..a2b47e4d0 100644 --- a/qt-ui/usersurvey.cpp +++ b/qt-ui/usersurvey.cpp @@ -4,7 +4,7 @@ #include "usersurvey.h" #include "ui_usersurvey.h" -#include "ssrf-version.h" +#include "version.h" #include "subsurfacewebservices.h" #include "updatemanager.h" @@ -22,7 +22,7 @@ UserSurvey::UserSurvey(QWidget *parent) : QDialog(parent), QShortcut *quitKey = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this); connect(quitKey, SIGNAL(activated()), parent, SLOT(close())); - os = QString("ssrfVers=%1").arg(VERSION_STRING); + os = QString("ssrfVers=%1").arg(subsurface_version()); os.append(QString("&prettyOsName=%1").arg(SubsurfaceSysInfo::prettyOsName())); QString arch = SubsurfaceSysInfo::buildCpuArchitecture(); os.append(QString("&appCpuArch=%1").arg(arch)); @@ -39,7 +39,7 @@ QString UserSurvey::getVersion() { QString arch; // fill in the system data - QString sysInfo = QString("Subsurface %1").arg(VERSION_STRING); + QString sysInfo = QString("Subsurface %1").arg(subsurface_version()); sysInfo.append(tr("\nOperating system: %1").arg(SubsurfaceSysInfo::prettyOsName())); arch = SubsurfaceSysInfo::buildCpuArchitecture(); sysInfo.append(tr("\nCPU architecture: %1").arg(arch)); @@ -54,7 +54,7 @@ QString UserSurvey::getUserAgent() QString arch; // fill in the system data - use ':' as separator // replace all other ':' with ' ' so that this is easy to parse - QString userAgent = QString("Subsurface:%1:").arg(VERSION_STRING); + QString userAgent = QString("Subsurface:%1:").arg(subsurface_version()); userAgent.append(SubsurfaceSysInfo::prettyOsName().replace(':', ' ') + ":"); arch = SubsurfaceSysInfo::buildCpuArchitecture().replace(':', ' '); userAgent.append(arch); |