Review Request 118691: Change currentIndex of playlistModel to -1 when a media is not from playlist
Shantanu Tushar
shantanu at kde.org
Fri Jun 13 15:18:59 UTC 2014
> On June 12, 2014, 5:54 p.m., Mark Gaiser wrote:
> > Why would you do it this way?
> > I mean, you should have a model in the C++ side and you should have a view (probably ListView). Then you can just ask the view the count: http://qt-project.org/doc/qt-5/qml-qtquick-listview.html#count-prop i kinda miss the point of doing this via C++. But then again, i don't know the code in this project.
>
> Ashish Madeti wrote:
> I don't understand how 'count' is relevant here (I didn't get your point). We want to set the currentIndex (which points to the item currently playing in playlist) to -1 whenever a user plays something from other than playlist.
>
> Mark Gaiser wrote:
> Ahh, sorry. I was wrong about the count property. It has nothing to do with this.
> But you "could" have used the currentIndex property: http://qt-project.org/doc/qt-5/qml-qtquick-listview.html#currentIndex-prop
> But that would only work if you also use the highlight functionality in the views. In this case there should be no item highlighted which means the ListView currentIndex property is -1.
>
> Does it make a bit more sense now? :)
We do use the currentIndex property of the view, we have two things-
1. Currently selected item in the View (the one with highlight), the user can move this using arrow keys/mouse.
2. Currently *playing* item in the playlist.
For 1 we use currentIndex of the View and 2 is implemented using a currentIndex property in the model (could use a better name though)
- Shantanu
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118691/#review59895
-----------------------------------------------------------
On June 12, 2014, 5:51 p.m., Ashish Madeti wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118691/
> -----------------------------------------------------------
>
> (Updated June 12, 2014, 5:51 p.m.)
>
>
> Review request for Plasma, Shantanu Tushar and Sinny Kumari.
>
>
> Repository: plasma-mediacenter
>
>
> Description
> -------
>
> Change the currentIndex of playlistModel to -1 when a media is played from somewhere other than playlist.
>
>
> Diffs
> -----
>
> libs/mediacenter/playlistmodel.h 0de7c56
> libs/mediacenter/playlistmodel.cpp c5ab1ab
> shells/newshell/package/contents/ui/mediacenter.qml a859225
>
> Diff: https://git.reviewboard.kde.org/r/118691/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Ashish Madeti
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20140613/8647fb04/attachment-0001.html>
More information about the Plasma-devel
mailing list