aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-03-19 17:52:44 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-03-19 17:52:44 +0100
commit3897ff83b6848e4169f1641b1132714870f01801 (patch)
tree5afcddd6543ceb0109db77156a6d9d452689c0a1 /src
parentAdded build script (diff)
downloadsmolbote-3897ff83b6848e4169f1641b1132714870f01801.tar.xz
Updated BUILDING.md
mach script can now build tarballs
Diffstat (limited to 'src')
-rw-r--r--src/browser.cpp9
-rw-r--r--src/browser.h6
-rw-r--r--src/main.cpp7
-rw-r--r--src/mainwindow.cpp11
4 files changed, 28 insertions, 5 deletions
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 <QNetworkAccessManager>
+#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("<h3>smolbote %1</h3>"
+ QMessageBox::about(this, tr("About"), tr("<h2>smolbote %1</h2>"
"<p><i>yet another Qute browser</i></p>"
"<p>Copyright (C) 2017 Xian Nox</p>"
"<p>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.</p>"
- "<p>Configuration lives in: %2</p>")
- .arg(DESCRIBE).arg(sSettings->filePath()));
+ "<p>"
+ "Version: %2<br>"
+ "Configuration: %3"
+ "</p>")
+ .arg(qApp->applicationVersion())
+ .arg(qApp->applicationLongVersion())
+ .arg(sSettings->filePath()));
}
void MainWindow::loadProfile(const QString &name)