diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-08-15 18:04:58 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-08-15 18:04:58 +0000 |
| commit | 76b31b99f023df45cf90dcc9daf92a9cd6606eb7 (patch) | |
| tree | 3c14d4df18bcfbd821c22297d734cb1128647e38 /src/plugins/General/hal | |
| parent | fb1ab38c333605908a05cd46dd344e95d3449bfc (diff) | |
| download | qmmp-76b31b99f023df45cf90dcc9daf92a9cd6606eb7.tar.gz qmmp-76b31b99f023df45cf90dcc9daf92a9cd6606eb7.tar.bz2 qmmp-76b31b99f023df45cf90dcc9daf92a9cd6606eb7.zip | |
fixed hal, udisks, udisks2 plugins
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3607 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/hal')
| -rw-r--r-- | src/plugins/General/hal/halplugin.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/General/hal/halplugin.cpp b/src/plugins/General/hal/halplugin.cpp index 2f1dfd067..936d3d291 100644 --- a/src/plugins/General/hal/halplugin.cpp +++ b/src/plugins/General/hal/halplugin.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2012 by Ilya Kotov * + * Copyright (C) 2009-2013 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -237,19 +237,23 @@ HalDevice *HalPlugin::findDevice(QAction *action) void HalPlugin::addPath(const QString &path) { - foreach(PlayListTrack *item, MediaPlayer::instance()->playListManager()->selectedPlayList()->items()) // Is it already exist? + PlayListModel *model = PlayListManager::instance()->selectedPlayList(); + + foreach(PlayListItem *item, model->items()) // Is it already exist? { - if (item->url().startsWith(path)) + if(item->isGroup()) + continue; + if (dynamic_cast<PlayListTrack *>(item)->url().startsWith(path)) return; } if (path.startsWith("cdda://") && m_addTracks) { - MediaPlayer::instance()->playListManager()->selectedPlayList()->add(path); + PlayListManager::instance()->selectedPlayList()->add(path); return; } else if (!path.startsWith("cdda://") && m_addFiles) - MediaPlayer::instance()->playListManager()->selectedPlayList()->add(path); + PlayListManager::instance()->selectedPlayList()->add(path); } void HalPlugin::removePath(const QString &path) @@ -258,13 +262,13 @@ void HalPlugin::removePath(const QString &path) (!path.startsWith("cdda://") && !m_removeFiles)) //process settings return; - PlayListModel *model = MediaPlayer::instance()->playListManager()->selectedPlayList(); + PlayListModel *model = PlayListManager::instance()->selectedPlayList(); int i = 0; while (model->count() > 0 && i < model->count()) { - if (model->item(i)->url().startsWith(path)) - model->removeAt (i); + if (model->isTrack(i) && model->track(i)->url().startsWith(path)) + model->removeTrack(i); else ++i; } |
