best place for a helper function

Vishesh Handa me at vhanda.in
Fri Mar 1 12:08:50 UTC 2013


On Fri, Mar 1, 2013 at 5:35 PM, Daniele E. Domenichelli <
daniele.domenichelli at gmail.com> wrote:

> On 01/03/13 12:21, Martin Klapetek wrote:
> > What you could do is to put it inside KTp::Contact and then reimplement
> > avatar() and check if the contact is offline and if so, return the
> > greyed avatar. Makes things simpler and you don't have to change any
> > other code.
>
> It looks like the right place to me, but I don't remember a
> {Tp/KTp}::Contact::avatar() method to reimplement, I think that we have
> just a "QString Tp::Contact::avatarToken()" that returns just a string.
> We could add a KTp::contact::avatar() that does the magic though, but
> I'm not sure if we want it grayed wherever it is used, so I'd suggest to
> add a "bool KTp::Contact::avatar(grayIfUnavailable = false)".
>

It might be better to use an enum instead of a boolean value. It's easier
to figure out what the code is doing that way -

 avatar = contact.avatar( Greyed );
instead of
 avatar = contact.avatar( true );



>
> Cheers,
>  Daniele
>
> _______________________________________________
> KDE-Telepathy mailing list
> KDE-Telepathy at kde.org
> https://mail.kde.org/mailman/listinfo/kde-telepathy
>



-- 
Vishesh Handa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20130301/eb3ef301/attachment.html>


More information about the KDE-Telepathy mailing list