items.append(PlaylistItem (PlaylistItem (fname)));
}
}
- if (!items.isEmpty())
+// if (!items.isEmpty())
+ if (items.size () > index)
{
metaInformationResolver->setCurrentSource(items.at(index).source);
lastMetaRead = index;
items.append(PlaylistItem (string));
}
}
- if (!items.isEmpty())
+// if (!items.isEmpty())
+ if (items.size () > index)
{
metaInformationResolver->setCurrentSource(items.at(index).source);
lastMetaRead = index;
appendPlaylist(filename);
else if (filename.right(4).toLower() == ".pls")
appendPlaylistPLS(filename);
- if (!items.isEmpty())
+ if (items.size () > index)
+// if (!items.isEmpty())
{
metaInformationResolver->setCurrentSource(items.at(index).source);
lastMetaRead = index;
void PlaylistManager::removeItem(int i)
{
items.removeAt (i);
- emit playlistChanged(i);
+ emit itemRemoved(i);
}
+
bool PlaylistManager::fileSupported (const QString& fname) const
{
QString ext = fname.right(3).toLower();
return false;
}
+
+bool PlaylistManager::moveItemUp (int i)
+{
+ if (i)
+ {
+ PlaylistItem tmp = items[i - 1];
+ items[i - 1] = items[i];
+ items[i] = tmp;
+ return true;
+// emit playlistChanged(i - 1);
+ }
+ return false;
+}
+
+bool PlaylistManager::moveItemDown (int i)
+{
+ if (i < items.size () - 1)
+ {
+ PlaylistItem tmp = items[i + 1];
+ items[i + 1] = items[i];
+ items[i] = tmp;
+ return true;
+// emit playlistChanged(i - 1);
+ }
+ return false;
+}