From 3897ff83b6848e4169f1641b1132714870f01801 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 19 Mar 2017 17:52:44 +0100 Subject: Updated BUILDING.md mach script can now build tarballs --- src/browser.cpp | 9 +++++++++ src/browser.h | 6 ++++++ src/main.cpp | 7 +++++-- src/mainwindow.cpp | 11 ++++++++--- 4 files changed, 28 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/browser.cpp b/src/browser.cpp index 41c6355..2c7115d 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -42,6 +42,15 @@ Browser::~Browser() delete m_downloadManager; } +QString Browser::applicationLongVersion() const +{ +#ifdef GIT_DESCRIBE + return QString(GIT_DESCRIBE); +#else + return applicationVersion(); +#endif +} + /*! * Check if the settings are empty */ diff --git a/src/browser.h b/src/browser.h index aa7c605..a6820c8 100644 --- a/src/browser.h +++ b/src/browser.h @@ -29,6 +29,10 @@ #include "settings.h" #include +#ifdef qApp +#undef qApp +#define qApp Browser::instance() +#endif #define sSettings Browser::instance()->settings() #define sNetwork Browser::instance()->network() @@ -41,6 +45,8 @@ public: Browser(int &argc, char *argv[]); ~Browser(); + QString applicationLongVersion() const; + void firstRun(); bool preLaunch(QStringList urls); diff --git a/src/main.cpp b/src/main.cpp index b787caf..a99e5de 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,9 +26,12 @@ int main(int argc, char *argv[]) { Browser app(argc, argv); -#ifdef VERSION - app.setApplicationVersion(VERSION); +#ifdef GIT_VERSION + app.setApplicationVersion(GIT_VERSION); +#else + app.setApplicationVersion("1.0.0"); #endif + app.setWindowIcon(QIcon(QLatin1String(":/icon.svg"))); QCommandLineParser parser; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 087c5f8..bab0520 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -155,13 +155,18 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::about() { - QMessageBox::about(this, tr("About"), tr("

smolbote %1

" + QMessageBox::about(this, tr("About"), tr("

smolbote %1

" "

yet another Qute browser

" "

Copyright (C) 2017 Xian Nox

" "

This program comes with ABSOLUTELY NO WARRANTY. " "This is free software, and you are welcome to redistribute it under the conditions set by the GNU GPLv3.

" - "

Configuration lives in: %2

") - .arg(DESCRIBE).arg(sSettings->filePath())); + "

" + "Version: %2
" + "Configuration: %3" + "

") + .arg(qApp->applicationVersion()) + .arg(qApp->applicationLongVersion()) + .arg(sSettings->filePath())); } void MainWindow::loadProfile(const QString &name) -- cgit v1.2.1