diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-01-03 16:39:32 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-01-03 16:39:32 +0100 |
commit | 85d9f14aa8bac16ab341662c770b64a15c21628b (patch) | |
tree | 422db18e798646cd4bc98abf342f25c09c0bdf1d /src/forms | |
parent | Download items' width should no longer exceed the list width (diff) | |
download | smolbote-85d9f14aa8bac16ab341662c770b64a15c21628b.tar.xz |
Changed from qbs to cmake
Diffstat (limited to 'src/forms')
-rw-r--r-- | src/forms/aboutdialog.cpp | 37 | ||||
-rw-r--r-- | src/forms/aboutdialog.h | 2 |
2 files changed, 24 insertions, 15 deletions
diff --git a/src/forms/aboutdialog.cpp b/src/forms/aboutdialog.cpp index 25c5384..3f89118 100644 --- a/src/forms/aboutdialog.cpp +++ b/src/forms/aboutdialog.cpp @@ -8,6 +8,28 @@ #include "aboutdialog.h" #include "ui_aboutdialog.h" +#include "version.h" + +constexpr const char *getCompiler() +{ + // clang also defines __GNUC__, so we need to check for clang first +#if defined(__clang__) + return "Clang " __clang_version__; +#elif defined(__GNUC__) + return "GCC " __VERSION__; +#else + return "unknown compiler"; +#endif +} + +inline const QString getLongVersion() +{ +#ifdef GIT_DESCRIBE + return QString(GIT_DESCRIBE); +#else + return qApp->applicationVersion(); +#endif +} AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), @@ -22,7 +44,7 @@ AboutDialog::AboutDialog(QWidget *parent) : aboutLabel->setWordWrap(true); aboutLabel->setText(tr("<h2>smolbote %1</h2>" "<p><i>yet another Qute browser</i></p>") - .arg(qApp->applicationVersion().left(qApp->applicationVersion().indexOf('-')))); + .arg(qApp->applicationVersion())); ui->toolBox->addItem(aboutLabel, tr("About")); QLabel *licenseLabel = new QLabel(this); @@ -50,7 +72,7 @@ AboutDialog::AboutDialog(QWidget *parent) : "<li>Qt %3</li>" "<li>libconfig</li>" "</ul></p>") - .arg(qApp->applicationVersion(), getCompiler(), qVersion())); + .arg(getLongVersion(), getCompiler(), qVersion())); ui->toolBox->addItem(libsLabel, tr("Details")); } @@ -58,14 +80,3 @@ AboutDialog::~AboutDialog() { delete ui; } - -constexpr const char *getCompiler() -{ -#if defined(__clang__) - return "Clang " __clang_version__; -#elif defined(__GNUC__) - return "GCC " __VERSION__; -#else - return "unknown compiler"; -#endif -} diff --git a/src/forms/aboutdialog.h b/src/forms/aboutdialog.h index ba848e7..9f2189e 100644 --- a/src/forms/aboutdialog.h +++ b/src/forms/aboutdialog.h @@ -27,6 +27,4 @@ private: Ui::AboutDialog *ui; }; -constexpr const char* getCompiler(); - #endif // ABOUTDIALOG_H |