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

List:       kde-devel
Subject:    Re: Patch for KTeaTime
From:       Thomas Baumgart <thb () net-bembel ! de>
Date:       2007-08-28 4:37:12
Message-ID: 200708280637.12524 () net-bembel ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi all,

on Monday 27 August 2007 23:02, Daniel Teske wrote:

> > > Hmm, this is actually wrong. The correct code is:
> > > if(parent.isValid())
> > >    return 0;
> > > else
> > >    return m_tealist.size();
> > >
> > > (Pretty clear, right?)
> >
> > Not for me :-(
> > This code returns something if the index is _not_ valid? Is this the
> > intention?
>
> Yes. :)
> The (invisible) root of a model is a invalid QModelIndex. That root has
> one child per tea. So for the root the code must return tealist.siez().
> Each and every child, i.e. every tea has no child, so if the QModelIndex
> is valid, and is thus not the invisible root, the code musr return 0.

An idea might be to drop just that as comment in front of the resp. code 
section.


-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
The amount of experience is directly proportional to
the amount of destroyed equipment.
-------------------------------------------------------------

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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