Bug 266249 - Deleting incorrect folders when in Saved playlist
Summary: Deleting incorrect folders when in Saved playlist
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlists/Saved Playlists (show other bugs)
Version: 2.4-GIT
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 2.4.1
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-14 01:08 UTC by Pierre Dumuid
Modified: 2011-03-09 18:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.4.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Dumuid 2011-02-14 01:08:56 UTC
Version:           2.4-GIT (using KDE 4.6.0) 
OS:                Linux

When in "Folder view", deleting selected folders doesn't delete folders correctly!



Reproducible: Always

Steps to Reproduce:
1. Navigate to "playlists/Saved playlists"
2. Ensure "Merged view" is selected, and no entries are listed in playlist.
3. Click "Add Folder" multiple times. (say 6 times) so that the playlist is populated with:

New Folder
New Folder (1)
New Folder (2)
New Folder (3)
New Folder (4)
New Folder (5)

4. Select all the folders, and right click, and select "Delete Folder".


Actual Results:  
Not all folders deleted, with the following remaining:
New Folder (1)
New Folder (3)
New Folder (5)

remain?!  Deleting all again results in folder, "New Folder (3)" remaining.

Expected Results:  
All folders should be deleted!


Various combinations of deleting folders arrives at different results:

Annoyingly it can actually delete folders I didn't select: i.e. choosing to delete 0,2,4 will actually deletes folders 0, and 3 (the later I didn't choose)

Also, when trying to work out how the code works, and fix it myself, I found that clearing the data maps:

      //don't clear the data maps since most of it will probably be needed again.
++    m_groupMaps.clear();


(what ever that is??!!) in QtGroupingProxy::buildTree() seems to alleviate the situation, but I don't know the code very well to fix the problem..

This bug is also reproducable when deleting folders from the "Podcasts" "Merged View"
Comment 1 Bart Cerneels 2011-03-09 17:55:41 UTC
Git commit 67ec0da9dd03700f62eee530ce1b002f759c0520 by Bart Cerneels.
Committed on 09/03/2011 at 17:53.
Pushed by shanachie into branch 'master'.

Use persistentindexes for deleteAction.

While deleting groups the indexes got out of date. QPersistentModelIndex prevents that.

BUG:266249

M  +7    -4    src/browsers/playlistbrowser/PlaylistsInFoldersProxy.cpp     
M  +4    -0    src/browsers/playlistbrowser/PlaylistsInFoldersProxy.h     

http://commits.kde.org/amarok/67ec0da9dd03700f62eee530ce1b002f759c0520