From kde-devel Tue Aug 28 04:37:12 2007 From: Thomas Baumgart Date: Tue, 28 Aug 2007 04:37:12 +0000 To: kde-devel Subject: Re: Patch for KTeaTime Message-Id: <200708280637.12524 () net-bembel ! de> X-MARC-Message: https://marc.info/?l=kde-devel&m=118827628507524 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0793537694==" --===============0793537694== Content-Type: multipart/signed; boundary="nextPart4547198.v5JfguKTve"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart4547198.v5JfguKTve Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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=20 section. =2D-=20 Regards Thomas Baumgart GPG-FP: E55E D592 F45F 116B 8429 4F99 9C59 DB40 B75D D3BA =2D------------------------------------------------------------ The amount of experience is directly proportional to the amount of destroyed equipment. =2D------------------------------------------------------------ --nextPart4547198.v5JfguKTve Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: http://www.net-bembel.de/ iD8DBQBG06Z4nFnbQLdd07oRAs9aAJ0Uhv06+SzL2g+GlrZCsIsEbV/QoQCg/GKs sFCpOca4nXVKNizkey1RK2c= =vXMp -----END PGP SIGNATURE----- --nextPart4547198.v5JfguKTve-- --===============0793537694== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============0793537694==--