Skip to content
Snippets Groups Projects
Commit 53b4a690 authored by SeeLook's avatar SeeLook :musical_note:
Browse files

Use Qt cammandline parser to interpret debug options

- 'nootini' for now
parent 14d8b706
No related branches found
No related tags found
No related merge requests found
Pipeline #3119 skipped
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "mobile/tmobilemenu.h" #include "mobile/tmobilemenu.h"
#else #else
#include "nootini/taudioanalyzeitem.h" #include "nootini/taudioanalyzeitem.h"
#include <QtCore/qcommandlineparser.h>
#endif #endif
#include <QtWidgets/qapplication.h> #include <QtWidgets/qapplication.h>
...@@ -243,7 +244,16 @@ int main(int argc, char *argv[]) ...@@ -243,7 +244,16 @@ int main(int argc, char *argv[])
nooObj->openFile(androidArg); nooObj->openFile(androidArg);
#else #else
if (argc > 1) { if (argc > 1) {
if (QString::fromLocal8Bit(argv[argc - 1]).contains(QLatin1String("--nootini"))) { QCommandLineParser cmd;
auto helpOpt = cmd.addHelpOption();
QCommandLineOption nootiniOpt(QStringLiteral("nootini"), QStringLiteral("launch audio analyzer"));
cmd.addOption(nootiniOpt);
cmd.parse(a->arguments());
if (cmd.isSet(helpOpt))
cmd.showHelp();
if (cmd.isSet(nootiniOpt)) {
qmlRegisterType<TaudioAnalyzeItem>("Nootka.Main", 1, 0, "TaudioAnalyzeItem"); qmlRegisterType<TaudioAnalyzeItem>("Nootka.Main", 1, 0, "TaudioAnalyzeItem");
QMetaObject::invokeMethod(e->rootObjects().first(), "audioAnalyze"); QMetaObject::invokeMethod(e->rootObjects().first(), "audioAnalyze");
} else } else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment