Review Request 110621: Drag and Drop feature to swap items in playlist added.

saurabh jain saurabhskj at hotmail.com
Fri May 24 08:27:07 UTC 2013



> On May 24, 2013, 5:58 a.m., Shantanu Tushar wrote:
> > libs/mediacenter/playlistmodel.cpp, lines 134-136
> > <http://git.reviewboard.kde.org/r/110621/diff/2/?file=146071#file146071line134>
> >
> >     resetting the whole model is an expensive operation. Its better to use beginMoveRows for the source index.
> >     http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html#beginMoveRows

Using beginMoveRows(), we are able to play the media item though we can't swap or drop the source row with or to the destination place. On contrary, the code given in the patch is able to swap but could not play any media item. 

I hope you were referring to the implementation mentioned below: 

void PlaylistModel::swapItems(int firstIndex, int secondIndex)
{

   //beginResetModel();
   if(!beginMoveRows(QModelIndex(),firstIndex,firstIndex,QModelIndex(),secondIndex))
        return;
   endMoveRows();
   //d->musicList.swap(secondIndex+1,firstIndex);
   //endResetModel();
}


- saurabh


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110621/#review33070
-----------------------------------------------------------


On May 23, 2013, 7:36 p.m., saurabh jain wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110621/
> -----------------------------------------------------------
> 
> (Updated May 23, 2013, 7:36 p.m.)
> 
> 
> Review request for Plasma, Shantanu Tushar and Sinny Kumari.
> 
> 
> Description
> -------
> 
> Reordering of the songs in the playlist is now possible using this patch. Just drag and drop the item to the desired place (where you want to replace it with the item at desired location). 
> 
> 
> Diffs
> -----
> 
>   libs/mediacenter/playlistmodel.h 2c1dc6b 
>   libs/mediacenter/playlistmodel.cpp 40b490c 
>   mediaelements/playlist/PlaylistDelegate.qml b1e6f40 
> 
> Diff: http://git.reviewboard.kde.org/r/110621/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> saurabh jain
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130524/64690f60/attachment.html>


More information about the Plasma-devel mailing list