aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/udisks/udisksplugin.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-08-15 18:04:58 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2013-08-15 18:04:58 +0000
commit76b31b99f023df45cf90dcc9daf92a9cd6606eb7 (patch)
tree3c14d4df18bcfbd821c22297d734cb1128647e38 /src/plugins/General/udisks/udisksplugin.cpp
parentfb1ab38c333605908a05cd46dd344e95d3449bfc (diff)
downloadqmmp-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/udisks/udisksplugin.cpp')
-rw-r--r--src/plugins/General/udisks/udisksplugin.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/General/udisks/udisksplugin.cpp b/src/plugins/General/udisks/udisksplugin.cpp
index 220bf2c03..5034c992e 100644
--- a/src/plugins/General/udisks/udisksplugin.cpp
+++ b/src/plugins/General/udisks/udisksplugin.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2010 by Ilya Kotov *
+ * Copyright (C) 2010-2013 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -231,19 +231,23 @@ UDisksDevice *UDisksPlugin::findDevice(QAction *action)
void UDisksPlugin::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 UDisksPlugin::removePath(const QString &path)
@@ -252,13 +256,13 @@ void UDisksPlugin::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;
}