Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 462c2d2c authored by Scott Wheeler's avatar Scott Wheeler

Add "Refresh Items" to the RMB menu on a playlist.

svn path=/trunk/kdemultimedia/juk/; revision=237439
parent 3b733d71
......@@ -242,23 +242,6 @@ void Playlist::saveAs()
}
}
void Playlist::refresh()
{
PlaylistItemList l = selectedItems();
if(l.isEmpty())
l = visibleItems();
KApplication::setOverrideCursor(Qt::waitCursor);
int j = 0;
for(PlaylistItemList::Iterator it = l.begin(); it != l.end(); ++it) {
(*it)->slotRefreshFromDisk();
if(j % 5 == 0)
kapp->processEvents();
j = j % 5 + 1;
}
KApplication::restoreOverrideCursor();
}
void Playlist::clearItem(PlaylistItem *item, bool emitChanged)
{
emit signalAboutToRemove(item);
......@@ -468,6 +451,23 @@ void Playlist::clear()
clearItems(l);
}
void Playlist::slotRefresh()
{
PlaylistItemList l = selectedItems();
if(l.isEmpty())
l = visibleItems();
KApplication::setOverrideCursor(Qt::waitCursor);
int j = 0;
for(PlaylistItemList::Iterator it = l.begin(); it != l.end(); ++it) {
(*it)->slotRefreshFromDisk();
if(j % 5 == 0)
kapp->processEvents();
j = j % 5 + 1;
}
KApplication::restoreOverrideCursor();
}
void Playlist::slotRenameFile()
{
KApplication::setOverrideCursor(Qt::waitCursor);
......@@ -825,9 +825,9 @@ void Playlist::polish()
m_rmbMenu->insertSeparator();
m_rmbMenu->insertItem(SmallIcon("editdelete"), i18n("Remove From Disk"), this, SLOT(slotDeleteSelectedItems()));
m_rmbEditID = m_rmbMenu->insertItem(SmallIcon("edittool"), i18n("Edit"), this, SLOT(slotRenameTag()));
m_rmbMenu->insertItem(SmallIcon("reload"), i18n("Refresh Items"), this, SLOT(slotRefresh()));
m_rmbMenu->insertItem(SmallIcon("editdelete"), i18n("Remove From Disk"), this, SLOT(slotDeleteSelectedItems()));
connect(this, SIGNAL(selectionChanged()),
this, SLOT(slotEmitSelected()));
......
......@@ -66,7 +66,6 @@ public:
*/
virtual void save();
virtual void saveAs();
virtual void refresh();
virtual void clearItem(PlaylistItem *item, bool emitChanged = true);
virtual void clearItems(const PlaylistItemList &items);
......@@ -181,6 +180,12 @@ public slots:
virtual void clear();
virtual void selectAll() { KListView::selectAll(true); }
/**
* Refreshes the tags of the selection from disk, or all of the files in the
* list if there is no selection.
*/
virtual void slotRefresh();
void slotGuessTagInfoFile();
void slotGuessTagInfoInternet();
void slotRenameFile();
......
......@@ -220,7 +220,7 @@ public slots:
*
* \see slotReloadPlaylist()
*/
void slotRefresh() { visiblePlaylist()->refresh(); }
void slotRefresh() { visiblePlaylist()->slotRefresh(); }
/**
* If the current playlist is one that was imported from a .m3u file, this
......
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