diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-08-20 17:25:34 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-08-20 17:25:34 +0000 |
| commit | 4ad1526dc8448d6e379cdc92836d797a977b5e20 (patch) | |
| tree | 85d9cd41b0303fc0fbe6115560f847e2ad9d106d | |
| parent | d057f8d99068633dfe7b8a8cae6e02760afd6043 (diff) | |
| download | qmmp-4ad1526dc8448d6e379cdc92836d797a977b5e20.tar.gz qmmp-4ad1526dc8448d6e379cdc92836d797a977b5e20.tar.bz2 qmmp-4ad1526dc8448d6e379cdc92836d797a977b5e20.zip | |
enabled PlayListOption plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3631 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/CommandLineOptions/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/plugins/CommandLineOptions/CommandLineOptions.pro | 4 | ||||
| -rw-r--r-- | src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp | 11 |
3 files changed, 10 insertions, 7 deletions
diff --git a/src/plugins/CommandLineOptions/CMakeLists.txt b/src/plugins/CommandLineOptions/CMakeLists.txt index 5fcde7b7f..51aae5fdb 100644 --- a/src/plugins/CommandLineOptions/CMakeLists.txt +++ b/src/plugins/CommandLineOptions/CMakeLists.txt @@ -1,4 +1,4 @@ add_subdirectory(IncDecVolumeOption) add_subdirectory(SeekOption) add_subdirectory(StatusOption) -#add_subdirectory(PlayListOption) +add_subdirectory(PlayListOption) diff --git a/src/plugins/CommandLineOptions/CommandLineOptions.pro b/src/plugins/CommandLineOptions/CommandLineOptions.pro index 9435a8682..ea15469d5 100644 --- a/src/plugins/CommandLineOptions/CommandLineOptions.pro +++ b/src/plugins/CommandLineOptions/CommandLineOptions.pro @@ -1,5 +1,5 @@ TEMPLATE = subdirs SUBDIRS = IncDecVolumeOption \ SeekOption \ - StatusOption - #PlayListOption + StatusOption \ + PlayListOption diff --git a/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp b/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp index 3c77e977e..2fcd37b30 100644 --- a/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp +++ b/src/plugins/CommandLineOptions/PlayListOption/playlistoption.cpp @@ -83,7 +83,10 @@ QString PlayListOption::executeCommand(const QString& opt_str, const QStringList return tr("Invalid playlist ID") + "\n"; for(int i = 0; i < model->count(); ++i) { - out += QString("%1. %2").arg(i+1).arg(formatter.parse(model->item(i))); + PlayListTrack *track = model->track(i); + if(!track) + continue; + out += QString("%1. %2").arg(i+1).arg(formatter.parse(track)); if(i == model->currentIndex()) out += " [*]"; out += "\n"; @@ -99,13 +102,13 @@ QString PlayListOption::executeCommand(const QString& opt_str, const QStringList PlayListModel *model = pl_manager->playListAt(pl_id); if(!model) return tr("Invalid playlist ID") + "\n"; - PlayListTrack *item = model->item(track_id); - if(!item) + PlayListTrack *track = model->track(track_id); + if(!track) return tr("Invalid track ID") + "\n"; player->stop(); pl_manager->activatePlayList(model); pl_manager->selectPlayList(model); - model->setCurrent(item); + model->setCurrent(track); player->play(); } else if(opt_str == "--pl-clear") |
