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
This commit is contained in:
Bill Somerville 2014-04-23 13:56:03 +00:00
parent 63774a983a
commit d7471d2876

View File

@ -18,9 +18,12 @@
#include <QSysInfo>
#include <QDir>
#include <QStandardPaths>
#include <QStringList>
#if QT_VERSION >= 0x050200
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QStringList>
#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);