Bug 226503 - Adding wrong song to saved playlists
Summary: Adding wrong song to saved playlists
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlist (show other bugs)
Version: 2.2.2
Platform: Gentoo Packages Unspecified
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 229703 233279 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-12 11:50 UTC by Fest
Modified: 2010-04-07 21:10 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fest 2010-02-12 11:50:07 UTC
Version:           2.2.2 (using KDE 4.4.0)
Installed from:    Gentoo Packages

When trying to add song to Saved Playlists, and search bar is active (with show only matches) it adding wrong song.

For example: I have two albums in playlist. First one is songs, second is music. If search active with 'songs' and i'm trying to add songs-1 track to saved playlist, it's adding music-1 track instead. Cleaning search bar is making everything works.

Screenshot for example - http://img714.imageshack.us/img714/2421/amarok.png
Comment 1 Carlos 2010-03-02 18:33:48 UTC
I can confirm this. This has been in 2.X for a very long time!
I use the debian build 2.2.2, but all other version i can remember are also affected.

Every time i want to put some music in my mp3 player or filter my playlist for something like "Rammstein" drag&drob some files into dolphin or some playlist .. and then it copys freaking Spice Girls onto my mp3 player ... that is VERY annoying!
Comment 2 Carlos 2010-03-02 19:41:35 UTC
Just tested with 2.3 beta1.
The bug is still there.
Comment 3 Myriam Schweingruber 2010-03-07 12:38:03 UTC
*** Bug 229703 has been marked as a duplicate of this bug. ***
Comment 4 Nikolaj Hald Nielsen 2010-03-15 09:37:35 UTC
commit 65b1b9e2044a87fb8bedd03b73628bbe07258045
Author: Nikolaj Hald Nielsen <nhn@kde.org>
Date:   Mon Mar 15 09:29:40 2010 +0100

    Correctly use mapToSource when getting mime data from a Playlist proxy model.
    
    This fixes the issues with the wrong track getting added to a stored playlist or dragged to an external app when sorting and/or filtering is active.
    ~lart Teo' for not fixing this _very_ obvious TODO
    ~lart nhn for not noticing and lart'ing Teo' sooner.
    
    BUG: 226503

diff --git a/src/playlist/proxymodels/ProxyBase.cpp b/src/playlist/proxymodels/ProxyBase.cpp
index 2e182ac..9fb933c 100644
--- a/src/playlist/proxymodels/ProxyBase.cpp
+++ b/src/playlist/proxymodels/ProxyBase.cpp
@@ -198,7 +198,15 @@ ProxyBase::idAt( const int row ) const
 QMimeData *
 ProxyBase::mimeData( const QModelIndexList &indexes ) const
 {
-    return m_belowModel->mimeData( indexes ); //TODO: probably needs mapToSource!
+
+    QModelIndexList sourceIndexes;
+    foreach( QModelIndex index, indexes )
+    {
+        sourceIndexes << mapToSource( index );
+    }
+    
+    return m_belowModel->mimeData( sourceIndexes );
+    
 }
 
 QStringList
Comment 5 Nikolaj Hald Nielsen 2010-04-07 14:43:08 UTC
*** Bug 233279 has been marked as a duplicate of this bug. ***