Having a KTp::Contact

George Kiagiadakis kiagiadakis.george at gmail.com
Thu Nov 29 09:02:11 UTC 2012


On Thu, Nov 29, 2012 at 12:03 AM, David Edmundson
<david at davidedmundson.co.uk> wrote:
> However, it's quite a large change in direction I think, so I want
> input from you guys.

+1 from me, I would say.

> Downsides:
>  - I can see this potentially turning into wrapping large amounts of
> the public API of TpQt. (not sure if this is a bad thing)

Not a bad thing, but always remember to try and push upstream whatever
makes sense to be there.

>  - KTp::Contact and Tp::Contact may get really confusing, especially
> if someone writes "using namespace..." at any point.

With my dictator hat on (:P), "using namespace" is forbidden in Tp/KTp code!

>  - None of the methods in Tp::Contact are virtual, which means if we
> were to override the block method to show the "are you sure" dialog
> first (for example), you would get a different behaviour happen
> depending on whether you had casted or not.

That's the only real problem that I can see. We should be extremely
careful to always cast objects to what they really are before using
them.

>  - Any code which tried to use KTp::Contact with a standard
> Tp::ContactFactory would crash.

Not very difficult to fix...

>  - I'm not really sure if the Collabora people will tell me off for
> abusing the contact factory.

I believe this falls within the intended use cases of the factory classes.

George


More information about the KDE-Telepathy mailing list