Permalink
Browse files

Show the build date of the nightlies in the About dialog

  • Loading branch information...
MKleusberg committed Oct 31, 2017
1 parent 3fe181b commit 0bc430bfad1c9517d0dde0095cc91bbc821f15c6
Showing with 18 additions and 12 deletions.
  1. +2 −2 src/AboutDialog.cpp
  2. +14 −10 src/Application.cpp
  3. +2 −0 src/Application.h
@@ -1,7 +1,7 @@
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include "version.h"
#include "sqlite.h"
#include "Application.h"

AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
@@ -11,7 +11,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
this->setFixedSize(this->width(), this->height());
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);

ui->label_version->setText(tr("Version ") + APP_VERSION + "\n\n" +
ui->label_version->setText(tr("Version ") + Application::versionString() + "\n\n" +
tr("Qt Version ") + QT_VERSION_STR + "\n\n" +
#ifdef ENABLE_SQLCIPHER
tr("SQLCipher Version ") + SQLITE_VERSION
@@ -89,16 +89,7 @@ Application::Application(int& argc, char** argv) :
qWarning() << qPrintable(tr(" [file]\t\tOpen this SQLite database"));
m_dontShowMainWindow = true;
} else if(arguments().at(i) == "-v" || arguments().at(i) == "--version") {
// Distinguish between high and low patch version numbers. High numbers as in x.y.99 indicate nightly builds or
// beta releases. For these we want to include the build date. For the release versions we don't add the release
// date in order to avoid confusion about what is more important, version number or build date, and about different
// build dates for the same version. This also should help making release builds reproducible out of the box.
#if PATCH_VERSION >= 99
QString build_date = QString(" (%1)").arg(__DATE__);
#else
QString build_date;
#endif
qWarning() << qPrintable(tr("This is DB Browser for SQLite version %1%2.").arg(APP_VERSION).arg(build_date));
qWarning() << qPrintable(tr("This is DB Browser for SQLite version %1.").arg(versionString()));
m_dontShowMainWindow = true;
} else if(arguments().at(i) == "-s" || arguments().at(i) == "--sql") {
// Run SQL file: If file exists add it to list of scripts to execute
@@ -170,3 +161,16 @@ bool Application::event(QEvent* event)
return QApplication::event(event);
}
}

QString Application::versionString()
{
// Distinguish between high and low patch version numbers. High numbers as in x.y.99 indicate nightly builds or
// beta releases. For these we want to include the build date. For the release versions we don't add the release
// date in order to avoid confusion about what is more important, version number or build date, and about different
// build dates for the same version. This also should help making release builds reproducible out of the box.
#if PATCH_VERSION >= 99
return QString("%1 (%2)").arg(APP_VERSION).arg(__DATE__);
#else
return QString("%1").arg(APP_VERSION);
#endif
}
@@ -18,6 +18,8 @@ class Application : public QApplication

MainWindow* mainWindow() { return m_mainWindow; }

static QString versionString();

protected:
bool event(QEvent* event);

0 comments on commit 0bc430b

Please sign in to comment.