[Kget] Refactor transferhandler & transfergrouphandler?

Carsten Pfeiffer pfeiffer at kde.org
Tue Aug 12 22:25:59 CEST 2008


Am Dienstag, 12. August 2008 schrieben Sie:

Hi,

> yep, that's for telling difference between a true base pointer and a
> sub-class pointer. It can't tell the difference between two
> sub-classes, and since TransferGroupHandler & TransferHandler are both
> always Handler type, it always return a valid pointer.

I thought you would dynamic_cast for TransferGroupHandler instead of the base 
Handler class? AFAIK there is no problem to 
dynamic_cast<TransferGroupHandler*>(someHandlerPtr)

Another solution would be to add a pure virtual method isTransferGroup() to 
the base Handler class and then implement it as "return false" in 
TransferHandler and as "return true" in TransferGroupHandler.

Cheers,
Carsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 447 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kget/attachments/20080812/39e831be/attachment.pgp 


More information about the Kget mailing list