Commit 20979495 authored by Scott Wheeler's avatar Scott Wheeler

Some interactivity hacks for staying responsive while tagging a list of

files.  This is the best that can be done without going multithreaded.

Added docs and simplified Playlist::slotApplyModification() while I was in
there.

CCMAIL:60066-done@bugs.kde.org

svn path=/trunk/kdemultimedia/juk/; revision=236006
parent d1df75e0
......@@ -972,8 +972,6 @@ void Playlist::slotRenameTag()
void Playlist::applyTag(QListViewItem *item, const QString &text, int column)
{
// kdDebug(65432) << "Applying " << text << " at column " << column << ", replacing \"" << item->text(column) << "\"" << endl;
PlaylistItem *i = static_cast<PlaylistItem *>(item);
switch(column)
......@@ -1012,31 +1010,26 @@ void Playlist::applyTag(QListViewItem *item, const QString &text, int column)
i->slotRefresh();
}
void Playlist::slotApplyModification(QListViewItem *item, const QString &text, int column)
void Playlist::slotApplyModification(QListViewItem *, const QString &text, int column)
{
// kdDebug(65432) << "Playlist::slotApplyModification()" << endl;
if(text == m_editText)
return;
QPtrList<QListViewItem> selectedSongs = KListView::selectedItems();
if (selectedSongs.count() > 1) {
if (KMessageBox::warningYesNo(0,
i18n("This will edit multiple files! Are you sure?"),
QString::null,
KStdGuiItem::yes(),
KStdGuiItem::no(),
"DontWarnMultipleTags") == KMessageBox::No)
{
return;
}
if(text == m_editText ||
(selectedSongs.count() > 1 && KMessageBox::warningYesNo(
0,
i18n("This will edit multiple files! Are you sure?"),
QString::null,
KStdGuiItem::yes(),
KStdGuiItem::no(),
"DontWarnMultipleTags") == KMessageBox::No))
{
return;
}
QPtrListIterator<QListViewItem> it(selectedSongs);
for(; it.current(); ++it)
applyTag((*it), text, column);
QPtrListIterator<QListViewItem> it(selectedSongs);
for(; it.current(); ++it) {
applyTag((*it), text, column);
kapp->processEvents();
}
else
applyTag(item, text, column);
}
void Playlist::slotColumnOrderChanged(int, int from, int to)
......
......@@ -261,6 +261,9 @@ signals:
private:
void setup();
void loadFile(const QString &fileName, const QFileInfo &fileInfo);
/**
* Save the tag for an individual items.
*/
void applyTag(QListViewItem *item, const QString &text, int column);
int leftMostVisibleColumn() const;
......@@ -273,7 +276,16 @@ private:
private slots:
void slotEmitSelected() { emit signalSelectionChanged(selectedItems()); }
void slotShowRMBMenu(QListViewItem *item, const QPoint &point, int column);
void slotApplyModification(QListViewItem *item, const QString &text, int column);
/**
* This slot applys the tag for
*/
void slotApplyModification(QListViewItem *, const QString &text, int column);
/**
* This starts the renaming process by displaying a line edit if the mouse is in
* an appropriate position.
*/
void slotRenameTag();
void slotColumnOrderChanged(int, int from, int to);
void slotToggleColumnVisible(int column);
......
......@@ -495,6 +495,8 @@ void TagEditor::save(const PlaylistItemList &list)
}
else
errorFiles.append(item->fileName());
kapp->processEvents();
}
if(!errorFiles.isEmpty())
......
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