Commit 87c5aa57 authored by Michael Pyne's avatar Michael Pyne
Browse files

More code cleanup in preparation for Scott's upcoming Cover Manager fixes.

PlaylistBox::decode() could perhaps use improvement but I have to depart for bed as well.

svn path=/branches/KDE/3.5/kdemultimedia/juk/; revision=457496
parent 0876bec0
......@@ -385,18 +385,16 @@ void PlaylistBox::slotShowDropTarget()
raise(m_dropItem->playlist());
}
// For the following two function calls, we can forward the slot*Item calls
// to the tree view mode as long as it has already been setup, whether or
// not it's actually visible.
void PlaylistBox::slotAddItem(const QString &tag, unsigned column)
{
static_cast<TreeViewMode*>(m_viewModes[2])->addItems(tag, column);
for(QValueListIterator<ViewMode *> it = m_viewModes.begin(); it != m_viewModes.end(); ++it)
(*it)->addItems(tag, column);
}
void PlaylistBox::slotRemoveItem(const QString &tag, unsigned column)
{
static_cast<TreeViewMode*>(m_viewModes[2])->removeItem(tag, column);
for(QValueListIterator<ViewMode *> it = m_viewModes.begin(); it != m_viewModes.end(); ++it)
(*it)->removeItem(tag, column);
}
void PlaylistBox::decode(QMimeSource *s, Item *item)
......
......@@ -54,6 +54,25 @@ public:
*/
virtual void setDynamicListsFrozen(bool /* frozen */) {}
/**
* Used for dynamic view modes. This function will be called when \p items
* are added to \p column (even if the view mode hasn't been shown yet).
*/
virtual void addItems(const QStringList &items, unsigned column)
{
(void) items;
(void) column;
}
/**
* Used for dynamic view modes. This function will be called when \p item
* is removed from \p column (even if the view mode hasn't been shown yet).
*/
virtual void removeItem(const QString &item, unsigned column)
{
(void) item;
(void) column;
}
protected:
PlaylistBox *playlistBox() const { return m_playlistBox; }
......@@ -111,8 +130,8 @@ public:
virtual void setupDynamicPlaylists();
virtual void setDynamicListsFrozen(bool frozen);
void removeItem(const QString &item, unsigned column);
void addItems(const QStringList &items, unsigned column);
virtual void removeItem(const QString &item, unsigned column);
virtual void addItems(const QStringList &items, unsigned column);
signals:
void signalPlaylistDestroyed(Playlist*);
......
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