aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/playlistmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmmpui/playlistmodel.cpp')
-rw-r--r--src/qmmpui/playlistmodel.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp
index 007eee910..53ba242c8 100644
--- a/src/qmmpui/playlistmodel.cpp
+++ b/src/qmmpui/playlistmodel.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright(C) 2006-2009 by Ilya Kotov *
+ * Copyright(C) 2006-2010 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -414,7 +414,7 @@ FileLoader * PlayListModel::createFileLoader()
FileLoader* f_loader = new FileLoader(this);
// f_loader->setStackSize(20 * 1024 * 1024);
m_running_loaders << f_loader;
- connect(f_loader,SIGNAL(newPlayListItem(PlayListItem*)), SLOT(add(PlayListItem*)),Qt::QueuedConnection);
+ connect(f_loader,SIGNAL(newPlayListItem(PlayListItem*)),SLOT(add(PlayListItem*)),Qt::QueuedConnection);
connect(f_loader,SIGNAL(finished()),this,SLOT(preparePlayState()));
connect(f_loader,SIGNAL(finished()),f_loader,SLOT(deleteLater()));
return f_loader;
@@ -920,3 +920,15 @@ void PlayListModel::removeInvalidItems()
removeItem(item);
}
}
+
+void PlayListModel::removeDuplicates()
+{
+ for(int i = 0; i < m_items.size(); ++i)
+ {
+ for(int j = i + 1; j < m_items.size(); ++j)
+ {
+ if(m_items.at(i)->url() == m_items.at(j)->url())
+ removeItem(m_items.at(j));
+ }
+ }
+}