diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2018-12-29 21:07:21 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2018-12-29 21:07:21 +0000 |
| commit | 3e2d3721988640845beeba150e01ff7f516f60b3 (patch) | |
| tree | 64cb42329070a9d52c4ff04cc3013fc1171a74f7 /src/app | |
| parent | a13a898395740f6663dcba0ba24ff4e46d42d29c (diff) | |
| download | qmmp-3e2d3721988640845beeba150e01ff7f516f60b3.tar.gz qmmp-3e2d3721988640845beeba150e01ff7f516f60b3.tar.bz2 qmmp-3e2d3721988640845beeba150e01ff7f516f60b3.zip | |
fixed --pl-help processing
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8535 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/qmmpstarter.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/app/qmmpstarter.cpp b/src/app/qmmpstarter.cpp index 34927514e..2c7af2b89 100644 --- a/src/app/qmmpstarter.cpp +++ b/src/app/qmmpstarter.cpp @@ -101,19 +101,42 @@ QMMPStarter::QMMPStarter() : QObject() if(!commands.isEmpty()) { - foreach(QString arg, commands.keys()) + foreach(QString key, commands.keys()) { - if(!m_option_manager->identify(arg) && !CommandLineManager::hasOption(arg) && - arg != "--no-start" && arg != "--ui") + CommandLineHandler::OptionFlags flags; + if(!m_option_manager->identify(key) && + !CommandLineManager::hasOption(key, &flags) && + key != "--no-start" && + key != "--ui") { cout << qPrintable(tr("Unknown command")) << endl; m_exit_code = EXIT_FAILURE; m_finished = true; return; } + + if(flags & CommandLineHandler::NO_START) + { + m_exit_code = EXIT_SUCCESS; + m_finished = true; + //show dialog with command line documentation under ms windows +#ifdef Q_OS_WIN + stringstream tmp_stream; + tmp_stream.copyfmt(cout); + streambuf* old_stream = cout.rdbuf(tmp_stream.rdbuf()); +#endif + cout << qPrintable(CommandLineManager::executeCommand(key, commands.value(key))); +#ifdef Q_OS_WIN + string text = tmp_stream.str(); + QMessageBox::information(0, tr("Command Line Help"), QString::fromLocal8Bit(text.c_str())); + cout.rdbuf(old_stream); //restore old stream buffer +#endif + return; + } } } + m_server = new QLocalServer(this); m_socket = new QLocalSocket(this); bool noStart = commands.keys().contains("--no-start") || commands.keys().contains("--quit"); |
