From d7471d287611a4b62c9abb302ebd1d995e7955ba Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 23 Apr 2014 13:56:03 +0000 Subject: [PATCH] Only use QCommandLineParser if Qt 5.2 available. I had inadvertantly locked WSJT-X into Qt 5.2 or later by using this class which only appeared in Qt 5.2. I have made the usage conditional on Qt version so that builds still work with any Qt 5 version. As a result builds against Qt version < 5.2 no longer support command line arguments, so multi-instance support now requires Qt 5.2. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4063 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 7f84ec182..28e05db7a 100644 --- a/main.cpp +++ b/main.cpp @@ -18,9 +18,12 @@ #include #include #include +#include + +#if QT_VERSION >= 0x050200 #include #include -#include +#endif #include "revision_utils.hpp" @@ -48,6 +51,9 @@ int main(int argc, char *argv[]) "." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH) " " + revision ()); + bool multiple {false}; + +#if QT_VERSION >= 0x050200 QCommandLineParser parser; parser.setApplicationDescription ("\nJT65A & JT9 Weak Signal Communications Program."); parser.addHelpOption (); @@ -69,8 +75,6 @@ int main(int argc, char *argv[]) QStandardPaths::setTestModeEnabled (parser.isSet (test_option)); - bool multiple {false}; - #if WSJT_STANDARD_FILE_LOCATIONS // support for multiple instances running from a single installation if (parser.isSet (rig_option)) @@ -88,6 +92,7 @@ int main(int argc, char *argv[]) } multiple = true; } +#endif #endif auto config_directory = QStandardPaths::writableLocation (QStandardPaths::ConfigLocation);