From kde-devel Fri Oct 26 10:15:56 2007 From: Thiago Macieira Date: Fri, 26 Oct 2007 10:15:56 +0000 To: kde-devel Subject: Re: Replacement for deprecated KConfigGroup:entryMap() Message-Id: <200710261215.56669.thiago () kde ! org> X-MARC-Message: https://marc.info/?l=kde-devel&m=119339380710145 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0995703261==" --===============0995703261== Content-Type: multipart/signed; boundary="nextPart2193383.yFskJIaVDs"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2193383.yFskJIaVDs Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Em Friday 26 October 2007 11:53:57 Oswald Buddenhagen escreveu: > > I'd say try a toString() (or equivalent QVariant conversion) and let > > the default value be returned in case of conversion errors (just like > > QVariant). > > i don't think pretending a legitimate case when an error occurs is good. > maybe one should even do something as nasty as returning " be converted to a string>" instead of just QString() - it's probable it > will get to the user somehow. I'd say an API like QVariant would then be useful: if you call convert() and it can't convert, it'll silently fail. You'll get= =20 the default value for the type (empty lists, null QStrings, 0 integers,=20 false, 0.0 for double, etc.). But if you do that, it's your fault. You should have checked canConvert()=20 first. You say now everything is a string, so the "canConvert()" to string is alwa= ys=20 true. But a new backend could have different logic there. =2D-=20 =A0 Thiago Macieira =A0- =A0thiago (AT) macieira.info - thiago (AT) kde.org =A0 =A0 PGP/GPG: 0x6EF45358; fingerprint: =A0 =A0 E067 918B B660 DBD1 105C =A0966C 33F5 F005 6EF4 5358 --nextPart2193383.yFskJIaVDs Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHIb5cM/XwBW70U1gRAvFlAJ0doIYn28x6ghsIsR+epCnb5x81ewCdG54P qBFzbaBRbX++Lxa4+sOBgHs= =Gs9y -----END PGP SIGNATURE----- --nextPart2193383.yFskJIaVDs-- --===============0995703261== 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 << --===============0995703261==--