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 35fa762c authored by Scott Wheeler's avatar Scott Wheeler

fix inline tag editing -- there previously was a test for a condition that

always returned true

svn path=/trunk/kdemultimedia/juk/; revision=223560
parent 2b704d23
......@@ -745,6 +745,7 @@ void Playlist::setup()
// hide some columns by default
//////////////////////////////////////////////////
hideColumn(PlaylistItem::CommentColumn);
hideColumn(PlaylistItem::FileNameColumn);
......@@ -860,6 +861,8 @@ void Playlist::slotShowRMBMenu(QListViewItem *item, const QPoint &point, int col
void Playlist::slotRenameTag()
{
// kdDebug(65432) << "Playlist::slotRenameTag()" << endl;
// setup completions and validators
CollectionList *list = CollectionList::instance();
......@@ -885,12 +888,14 @@ void Playlist::slotRenameTag()
edit->setCompletionMode(KGlobalSettings::CompletionAuto);
m_editText = currentItem()->text(m_currentColumn);
rename(currentItem(), m_currentColumn);
}
void Playlist::applyTag(QListViewItem *item, const QString &text, int column)
{
//kdDebug(65432) << "Applying " << text << " at column " << column << ", replacing \"" << item->text(column) << "\"" << endl;
// kdDebug(65432) << "Applying " << text << " at column " << column << ", replacing \"" << item->text(column) << "\"" << endl;
PlaylistItem *i = static_cast<PlaylistItem *>(item);
......@@ -932,8 +937,10 @@ void Playlist::applyTag(QListViewItem *item, const QString &text, int column)
void Playlist::slotApplyModification(QListViewItem *item, const QString &text, int column)
{
if (item->text(column) == text)
return;
// kdDebug(65432) << "Playlist::slotApplyModification()" << endl;
if(text == m_editText)
return;
QPtrList<QListViewItem> selectedSongs = KListView::selectedItems();
if (selectedSongs.count() > 1)
......
......@@ -123,9 +123,8 @@ public:
int count() const { return childCount(); }
/**
* This gets the next item to be played. This is static because often we
* know about the playing item, but not to which list it belongs.
/**
* This gets the next item to be played.
*/
PlaylistItem *nextItem(PlaylistItem *current, bool random = false);
PlaylistItem *previousItem(PlaylistItem *current, bool random = false);
......@@ -253,6 +252,13 @@ private:
QPtrStack<PlaylistItem> m_history;
QString m_fileName;
/**
* Used to store the text for inline editing before it is changed so that
* we can know if something actually changed and as such if we need to save
* the tag.
*/
QString m_editText;
/**
* This is only defined if the playlist name is something other than the
......
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