Code review comment for lp://qastaging/~uriboni/webbrowser-app/newtabview-listviews

Revision history for this message
Olivier Tilloy (osomon) wrote :

Reflecting further on the problem we’re trying to solve, I just had an idea (just thinking out loud here, let’s see if you think it can fly):

 How about writing a custom proxy model that uses the BookmarksModel as input, and outputs a list that contains folders (collapsed or expanded) and bookmarks, in the expected order? There would be an additional role that describes what an entry is (is it a bookmark, is it a collapsed folder, or an expanded folder?). The model would have to keep track of the expanded/status state of each folder, and there would be a method to toggle the expanded/collapsed state of a folder (which would result in row insertions/removals). With this, a simple list view (with no section headers) would suffice, the appearance of the delegates would depend on their nature.

If I understand correctly what you did, the idea is similar, but much less generic than your implementation, and all done in C++ as opposed to a mix of C++ and QML/JS. It also doesn’t use sections, which should make it simpler (and maybe more efficient).

This would also allow adding the hardcoded homepage bookmark without modifying the source BookmarksModel.

How does that sound? Have I overlooked important details?

« Back to merge proposal