bug #86756: klistview::selectedItems() returns hidden items

Ingo Klöcker kloecker at kde.org
Wed Sep 15 22:30:57 BST 2004


On Wednesday 15 September 2004 14:17, Jason Keirstead wrote:
> > i'd be surprised if this was the only use case. especially now that
> > we have dynamic filtering of lists in use in places such as kmail,
> > juk and elsewhere. the patch completely denies the ability to get
> > hidden items which are selected back.
>
> Read my above reply for why the developer should *not* be trying to
> gett he selected items back in the first place.

If there's a valid reason, why not?

> If a filter action has occured, hidden items should always be
> de-selected by default. A user applying a filter expects his
> subsequent actions to only be affecting the items he sees, not the
> hidden items.

I agree and Aaron also agrees with you (if I understood Aaron 
correctly).

> Imagine you have a list of items, select 5 of them, thenapply a
> filter. Now you only see 3 items. Wouldn't you expect any actions you
> now take ( drag, execute, delete ) to only affect those 3 items?

Sure.

> What person would ever expect this to also be affecting the items you
> selected  before the filter?

Nobody?

But that's exactly what Aaron proposed (and what you've snipped away). 
He proposed a selectedItems(bool includeHiddenItems = true) method. So 
if you only want items which are selected _and_ visible then you call 
selectedItems( false ). Whether including hidden items by default is a 
good idea is debatable, but since using false as default would be a 
behavior incompatible change it's probably better to use true as 
default.

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040915/5456593a/attachment.sig>


More information about the kde-core-devel mailing list