diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-11 19:31:49 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-12-11 19:31:49 +0000 |
| commit | 9dc5748f6a3aebf2f4d12598f0ce238665e48238 (patch) | |
| tree | f6dcf3567a006c19d832d990ebb31d9aa03d43e3 /src/ui/mainwindow.cpp | |
| parent | 4602c4fda29f1455ed6693b6af421ec7c7f68eb8 (diff) | |
| download | qmmp-9dc5748f6a3aebf2f4d12598f0ce238665e48238.tar.gz qmmp-9dc5748f6a3aebf2f4d12598f0ce238665e48238.tar.bz2 qmmp-9dc5748f6a3aebf2f4d12598f0ce238665e48238.zip | |
--enqueue command line option
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@676 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/mainwindow.cpp')
| -rw-r--r-- | src/ui/mainwindow.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index c7589d1bc..89761a7f0 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -619,12 +619,27 @@ bool MainWindow::processCommandArgs(const QStringList &slist,const QString& cwd) if (slist.count() > 0) { QString str = slist[0]; - if (str.startsWith("--")) // is it a command? + + if (str.startsWith("--enqueue")) //check for "--enqueue" modifier + { + if (slist.count() < 2) + return FALSE; + QStringList full_path_list; + for (int i = 1; i < slist.count(); ++i) + { + if ((slist.at(i).startsWith("/")) || (slist.at(i).contains("://"))) //is it absolute path or url? + full_path_list << slist.at(i); + else + full_path_list << cwd + "/" + slist.at(i); + } + m_playListModel->addFileList(full_path_list); //TODO url support + } + else if (str.startsWith("--")) // is it a command? { if (CommandLineManager::hasOption(str)) m_generalHandler->executeCommand(str); else if (m_option_manager->identify(str)) - m_option_manager->executeCommand(str,this); + m_option_manager->executeCommand(str, this); else return FALSE; } @@ -633,13 +648,12 @@ bool MainWindow::processCommandArgs(const QStringList &slist,const QString& cwd) QStringList full_path_list; foreach(QString s,slist) { - qWarning(qPrintable(cwd + "/" + s)); - if (s.left(1) == "/") //is it absolute path? + if ((s.startsWith("/")) || (s.contains("://"))) //is it absolute path or url? full_path_list << s; else full_path_list << cwd + "/" + s; } - setFileList(full_path_list); + setFileList(full_path_list); //TODO url support } } return TRUE; |
