implement a generic listview
ClosedPublic

Authored by astippich on Apr 18 2018, 5:33 PM.

Details

Summary

combine code of alltracks and album view into a somewhat generic implementation of a list browser

Test Plan

all tracks view and album view work as before

Diff Detail

Repository
R255 Elisa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
astippich requested review of this revision.Apr 18 2018, 5:33 PM
astippich created this revision.
mgallien requested changes to this revision.Apr 23 2018, 8:49 PM
mgallien added a subscriber: mgallien.

Thanks for removing code.
Please fix the issues.

src/qml/ListBrowserView.qml
33–34

Could you use an alias property ?

115–119

This is probably not good for performance. Why do you still define the delegate inside the ListBrowserView component instead of setting the delegate at the places where you instantiate the ListBrowserView component.
You would remove the need for this if.

This revision now requires changes to proceed.Apr 23 2018, 8:49 PM
astippich updated this revision to Diff 33122.Apr 26 2018, 6:30 AM
  • use alias
astippich marked an inline comment as done.Apr 26 2018, 6:33 AM
astippich added inline comments.
src/qml/ListBrowserView.qml
115–119

That's what I first tried, but the delegates need to know about some properties, for example the width of the listview, which are not available when defined outside. Do you have any ideas how to solve this?

mgallien added inline comments.Apr 26 2018, 6:50 PM
src/qml/ListBrowserView.qml
115–119

You can create alias properties in ListBrowserView to expose the properties of the ListView child. This way, you should be able to move out the delegate (and reduce the size of this file). This way, ListBrowserView can have somehow the same interface than ListView.

mgallien requested changes to this revision.Apr 26 2018, 6:50 PM
This revision now requires changes to proceed.Apr 26 2018, 6:50 PM
astippich updated this revision to Diff 33281.Apr 29 2018, 9:13 AM
  • move delegates outside
mgallien accepted this revision.Apr 29 2018, 8:13 PM
This revision is now accepted and ready to land.Apr 29 2018, 8:13 PM
This revision was automatically updated to reflect the committed changes.