Custom-type QVariant comparison in KConfigDialogManager

Andreas Pakulat apaku at gmx.de
Sun Jun 17 11:08:51 BST 2007


On 17.06.07 11:52:24, Thiago Macieira wrote:
> 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.

I don't know where the code is, but if you use multiple if's you'll have
at least 2 "positive" blocks with the same code.

> Split it into several ifs or a boolean flag.
 
Personally I don't consider that very nice either.

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

You mean we can have a QVariant::operator==() which also works for
KUrl-QVariants? How?

Andreas

-- 
You'll feel much better once you've given up hope.




More information about the kde-core-devel mailing list