[PATCH] enable external drives list in kickoff again

Kevin Ottens ervin at kde.org
Fri Mar 28 08:26:16 CET 2008


Le Friday 28 March 2008, Aaron J. Seigo a écrit :
> when you return  d->placesModel->rowCount(); though it ends up iterating
> through the whole placesModel, discarding the bad entries (e.g. "Home
> Directory" under the REMOVABLE_ROW) and showing the good ones.
>
> so while this would probably screw up any "real" view (i'll bet it shows
> empty rows in a qtreeview, for instance) , it works with kickoff's views
> and that's probably all that matters. it may be work documenting this ...

Well, that's why I did it like this in the first place (used to return 
rowCount() IIRC, no idea who changed that). As for "screw up any real view" 
the cheap trick is too mark the bad entries as "hidden", then you won't get 
empty rows in a qtreeview.

> alternatively, one *could* make the view well behaved and actually map,
> e.g. via a proxy model or some such (or even just really go the cheap route
> and have a couple of index maps around), the items which are bookmarks or
> devices in the places model.

For the record, it's already a proxy model. And internally you'd have to make 
the index maps if you want to make it well behaved. Basically I didn't 
because:
1) I'm a lazy bastard and couldn't see the benefit to be well behaved in this 
context (kickoff isn't really well behaved in general);
2) That'd mean having maps of QPersistentModelIndex which auto-update 
(huzzah!), but are expensive to keep up to date (signal-slot going on in each 
persistent index for each model change).

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080328/9d4ec895/attachment.pgp 


More information about the Panel-devel mailing list