[Patch+Problem] Enabling drag&drop from the albums applet
Seb Ruiz
ruiz at kde.org
Sun Oct 12 01:59:17 CEST 2008
2008/10/11 Andreas Mützel <andreas.muetzel at gmx.net>:
> Hi,
>
> i'm trying to implement dragging functions in the albums applet so that you
> can drag albums and/or songs to the playlist from there.
>
> It's almost working but one issue prevents me from finishing the work: If i
> simply enable dragging in the albums applet the dragged items won't be
> recognized by the playlist because of the missing mimedata, so i wrote an
> AlbumsModel that should take care of this.
> That seems to work, but there is a strange problem with the treeview in the
> albums applet:
> If you drag something, qt/amarok/whatever seems to request the mime data of
> the parent entry. I.e. if you drag an album to the playlist nothing happens
> but if you drag a single track to the playlist the whole album is added.
>
> My work up to this point is attached as a patch.
> The file "context/applets/albums/AlbumsModel.cpp" contains debug output that
> tells you whether mime data for a TrackItem or an AlbumItem is requested so
> you can verify that mime data for the parent entry seems to be fetched.
>
> Has anybody already experienced a similar problem when doing drag&drop from a
> treeview?
>
> I'm posting this because i hope that someone knows a solution for this or that
> it could be useful for someone who wants to work on the dragging stuff (to
> avoid duplicate effort etc.).
>
> Regards,
> Andreas
>
> P.s.: This patch is not really good from a usability point of view, for
> example if it worked and you selected an album and some tracks of it the
> complete album + the selected tracks would be added to the playlist,
> resulting in duplicate entries.
> I'm not sure if my problem has an easy fix so i didn't want to waste my time
> on writing code that possibly would be useless because a completely different
> approach could be needed...
>
Even though the patch is incomplete, I've commit it for the sake of
having it available to anybody using SVN. This means you won't have to
go and apply this patch just to figure out what's going on.
I haven't had a chance to look at it thoroughly yet (soon, I hope).
--
Seb Ruiz
http://www.sebruiz.net/
http://amarok.kde.org/
More information about the Amarok-devel
mailing list