mirror of
https://github.com/js8call/js8call.git
synced 2025-12-22 09:17:08 +00:00
Simplify version function
Option to include patch is always true; no value in having logic to do otherwise.
This commit is contained in:
2
main.cpp
2
main.cpp
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Override programs executable basename as application name.
|
||||
a.setApplicationName("JS8Call");
|
||||
a.setApplicationVersion (version ());
|
||||
a.setApplicationVersion (version());
|
||||
|
||||
#if QT_VERSION >= 0x050200
|
||||
QCommandLineParser parser;
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
#include "revision_utils.hpp"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QRegularExpression>
|
||||
|
||||
QString version (bool include_patch)
|
||||
QString version()
|
||||
{
|
||||
#if defined (CMAKE_BUILD)
|
||||
QString v {WSJTX_STRINGIZE (WSJTX_VERSION_MAJOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR)};
|
||||
if (include_patch)
|
||||
{
|
||||
v += "." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH)
|
||||
QString v {WSJTX_STRINGIZE (WSJTX_VERSION_MAJOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH)};
|
||||
#if 0
|
||||
# if defined (WSJTX_RC)
|
||||
+ "-rc" WSJTX_STRINGIZE (WSJTX_RC)
|
||||
v += "-rc" WSJTX_STRINGIZE (WSJTX_RC)
|
||||
# endif
|
||||
#endif
|
||||
;
|
||||
}
|
||||
#else
|
||||
QString v {"Not for Release"};
|
||||
#endif
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
QString version (bool include_patch = true);
|
||||
QString program_title ();
|
||||
QString version();
|
||||
QString program_title();
|
||||
QString program_version();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user