From 76b31b99f023df45cf90dcc9daf92a9cd6606eb7 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Thu, 15 Aug 2013 18:04:58 +0000 Subject: 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 --- src/plugins/General/hal/halplugin.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/plugins/General/hal') 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(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; } -- cgit v1.2.3-13-gbd6f