mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-23 18:02:29 -04:00
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:
parent
63774a983a
commit
d7471d2876
11
main.cpp
11
main.cpp
@ -18,9 +18,12 @@
|
|||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050200
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QCommandLineOption>
|
#include <QCommandLineOption>
|
||||||
#include <QStringList>
|
#endif
|
||||||
|
|
||||||
#include "revision_utils.hpp"
|
#include "revision_utils.hpp"
|
||||||
|
|
||||||
@ -48,6 +51,9 @@ int main(int argc, char *argv[])
|
|||||||
"." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR)
|
"." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR)
|
||||||
"." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH) " " + revision ());
|
"." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH) " " + revision ());
|
||||||
|
|
||||||
|
bool multiple {false};
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050200
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.setApplicationDescription ("\nJT65A & JT9 Weak Signal Communications Program.");
|
parser.setApplicationDescription ("\nJT65A & JT9 Weak Signal Communications Program.");
|
||||||
parser.addHelpOption ();
|
parser.addHelpOption ();
|
||||||
@ -69,8 +75,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QStandardPaths::setTestModeEnabled (parser.isSet (test_option));
|
QStandardPaths::setTestModeEnabled (parser.isSet (test_option));
|
||||||
|
|
||||||
bool multiple {false};
|
|
||||||
|
|
||||||
#if WSJT_STANDARD_FILE_LOCATIONS
|
#if WSJT_STANDARD_FILE_LOCATIONS
|
||||||
// support for multiple instances running from a single installation
|
// support for multiple instances running from a single installation
|
||||||
if (parser.isSet (rig_option))
|
if (parser.isSet (rig_option))
|
||||||
@ -88,6 +92,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
multiple = true;
|
multiple = true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
auto config_directory = QStandardPaths::writableLocation (QStandardPaths::ConfigLocation);
|
auto config_directory = QStandardPaths::writableLocation (QStandardPaths::ConfigLocation);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user