diff --git a/src/FastTrack.pro b/src/FastTrack.pro index 655d094..23ab341 100644 --- a/src/FastTrack.pro +++ b/src/FastTrack.pro @@ -10,6 +10,9 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = FastTrack TEMPLATE = app +VERSION = 4.9.1 +DEFINES += APP_VERSION=\\\"$$VERSION\\\" + unix:!macx { DESTDIR=build diff --git a/src/main.cpp b/src/main.cpp index 0290067..d020085 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,9 +21,10 @@ This file is part of Fast Track. int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; - a.setApplicationName("Fast Track"); - a.setOrganizationName("Benjamin Gallois"); - a.setOrganizationDomain("fasttrack.benjamin-gallois.fr"); + a.setApplicationName("FastTrack"); + a.setApplicationVersion(APP_VERSION); + a.setOrganizationName("FastTrackOrg"); + a.setOrganizationDomain("www.fasttrack.sh"); w.setWindowIcon(QIcon(":/assets/icon.png")); w.show(); a.exec(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 16313bf..3872ecf 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -44,7 +44,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), QDir::setCurrent(QCoreApplication::applicationDirPath()); ui->setupUi(this); setWindowState(Qt::WindowMaximized); - setWindowTitle("FastTrack " + version); + setWindowTitle(qApp->applicationName() + " " + APP_VERSION); // Setup style QFile stylesheet(":/theme.qss"); @@ -72,7 +72,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), QByteArray message = downloadedData.mid(downloadedData.indexOf("message") + 7, downloadedData.indexOf("!message") - downloadedData.indexOf("message") - 7); QByteArray warning = downloadedData.mid(downloadedData.indexOf("warning") + 7, downloadedData.indexOf("!warning") - downloadedData.indexOf("warning") - 7); - if (lastVersion != version) { + if (lastVersion != APP_VERSION) { QMessageBox msgBox; msgBox.setTextFormat(Qt::RichText); msgBox.setText("FastTrack version " + lastVersion + " is available!
Please update.
Need help to update?
" + message + "
" + warning); diff --git a/src/mainwindow.h b/src/mainwindow.h index b79282d..73552e8 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -47,7 +47,6 @@ class MainWindow : public QMainWindow { public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); - QByteArray version = "4.9.1"; private: Ui::MainWindow *ui; /*!< ui file from Qt designer. */