Custom-type QVariant comparison in KConfigDialogManager

Thiago Macieira thiago at kde.org
Sun Jun 17 10:52:24 BST 2007


Andreas Pakulat wrote:
>if(  ( ( p.userType() >= QVariant::UserType
>         || item->property.userType() >= QVariant::UserType
>       ) && p.userType() != item->property().userType()
>    )
>    || ( ( p.userType() < QVariant::UserType
>           && item->property.userType() < QVariant::UserType
>         ) && p != item->property()
>       )
>    )
>
>should work. Its not beautiful, but keeps duplicating code.

Right, it's not beautiful, don't use it. I can't understand what you want.

Split it into several ifs or a boolean flag.

Also, you want to handle the known custom types, especially KUrl.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070617/4d2b709d/attachment.sig>


More information about the kde-core-devel mailing list