Commit b5da0896 authored by Michael Pyne's avatar Michael Pyne

kde3support: Remove never-implemented emitChange flag.

Instead just use existing (and superior) JuK internal API. Search
playlist tested and working here.
parent b16909a3
......@@ -596,7 +596,7 @@ void Playlist::updateDeletedItem(PlaylistItem *item)
m_subtractTime.removeAll(item);
}
void Playlist::clearItem(PlaylistItem *item, bool emitChanged)
void Playlist::clearItem(PlaylistItem *item)
{
// Automatically updates internal structs via updateDeletedItem
delete item;
......
......@@ -111,16 +111,13 @@ public:
virtual void saveAs();
/**
* Removes \a item from the Playlist, but not from the disk. If
* \a emitChanged is true this will also notify relevant classes
* that the content of the list has changed.
* Removes \a item from the Playlist, but not from the disk.
*
* In some situations, for instance when removing items in a loop, it is
* preferable to delay this notification until after other operations have
* completed. In those cases set \a emitChanged to false and call the
* signal directly.
* Since the GUI updates after an item is cleared, you should use clearItems() if you have
* a list of items to remove, as that will remove the whole batch before updating
* other components/GUI to the change.
*/
virtual void clearItem(PlaylistItem *item, bool emitChanged = true);
virtual void clearItem(PlaylistItem *item);
/**
* Remove \a items from the playlist and emit a signal indicating
......
......@@ -72,12 +72,7 @@ void SearchPlaylist::updateItems()
newItems.append(item->collectionItem());
}
foreach(PlaylistItem *item, oldItems)
clearItem(item, false);
if(!oldItems.isEmpty() && newItems.isEmpty())
dataChanged();
clearItems(PlaylistItemList(oldItems.values()));
createItems(newItems);
if(synchronizePlaying()) {
......
......@@ -109,10 +109,10 @@ void UpcomingPlaylist::playNext()
}
}
void UpcomingPlaylist::clearItem(PlaylistItem *item, bool emitChanged)
void UpcomingPlaylist::clearItem(PlaylistItem *item)
{
m_playlistIndex.remove(item);
Playlist::clearItem(item, emitChanged);
Playlist::clearItem(item);
}
void UpcomingPlaylist::addFiles(const QStringList &files, PlaylistItem *after)
......
......@@ -88,7 +88,7 @@ public:
/**
* Reimplemented to remove the item from the Playlist index.
*/
virtual void clearItem(PlaylistItem *item, bool emitChanged = true);
virtual void clearItem(PlaylistItem *item);
virtual void addFiles(const QStringList &files, PlaylistItem *after = 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment