[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: [PATCH] enable external drives list in kickoff again
From:       Kevin Ottens <ervin () kde ! org>
Date:       2008-03-28 7:26:16
Message-ID: 200803280826.16699.ervin () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


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."

["signature.asc" (application/pgp-signature)]

_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic