@@ -89,16 +89,7 @@ Application::Application(int& argc, char** argv) :
8989 qWarning () << qPrintable (tr (" [file]\t\t Open this SQLite database" ));
9090 m_dontShowMainWindow = true ;
9191 } else if (arguments ().at (i) == " -v" || arguments ().at (i) == " --version" ) {
92- // Distinguish between high and low patch version numbers. High numbers as in x.y.99 indicate nightly builds or
93- // beta releases. For these we want to include the build date. For the release versions we don't add the release
94- // date in order to avoid confusion about what is more important, version number or build date, and about different
95- // build dates for the same version. This also should help making release builds reproducible out of the box.
96- #if PATCH_VERSION >= 99
97- QString build_date = QString (" (%1)" ).arg (__DATE__);
98- #else
99- QString build_date;
100- #endif
101- qWarning () << qPrintable (tr (" This is DB Browser for SQLite version %1%2." ).arg (APP_VERSION).arg (build_date));
92+ qWarning () << qPrintable (tr (" This is DB Browser for SQLite version %1." ).arg (versionString ()));
10293 m_dontShowMainWindow = true ;
10394 } else if (arguments ().at (i) == " -s" || arguments ().at (i) == " --sql" ) {
10495 // Run SQL file: If file exists add it to list of scripts to execute
@@ -170,3 +161,16 @@ bool Application::event(QEvent* event)
170161 return QApplication::event (event);
171162 }
172163}
164+
165+ QString Application::versionString ()
166+ {
167+ // Distinguish between high and low patch version numbers. High numbers as in x.y.99 indicate nightly builds or
168+ // beta releases. For these we want to include the build date. For the release versions we don't add the release
169+ // date in order to avoid confusion about what is more important, version number or build date, and about different
170+ // build dates for the same version. This also should help making release builds reproducible out of the box.
171+ #if PATCH_VERSION >= 99
172+ return QString (" %1 (%2)" ).arg (APP_VERSION).arg (__DATE__);
173+ #else
174+ return QString (" %1" ).arg (APP_VERSION);
175+ #endif
176+ }
0 commit comments