Review Request: Implement contact notifications
David Edmundson
kde at davidedmundson.co.uk
Thu Sep 6 11:27:41 UTC 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106355/#review18615
-----------------------------------------------------------
You've fallen for some oddities in TpQt that everyone falls for with new connections.
Also we're duplicating a lot of code that's in the KDED for the new subscription handling, so I'd like to put this on hold whilst I make a class that we can use for both of them.
contactnotify.h
<http://git.reviewboard.kde.org/r/106355/#comment14722>
This doesn't work.
if you have two accounts, you have two connections.
contactnotify.cpp
<http://git.reviewboard.kde.org/r/106355/#comment14717>
As mentioned above m_connection doesn't really work. (well, I suppose it will, but only via a hack)
You'll have to use the QObject::sender().
also you need to wait for contactManager state to be contactManager ready before you use it. It isn't always on first run.
contactnotify.cpp
<http://git.reviewboard.kde.org/r/106355/#comment14718>
Didn't we discuss that we only want notifications if a presence increases.
i.e show for away->online but never for online->away
contactnotify.cpp
<http://git.reviewboard.kde.org/r/106355/#comment14720>
always cast qojbects with qobject_cast. It's safer
contactnotify.cpp
<http://git.reviewboard.kde.org/r/106355/#comment14719>
const & on the QString and KIcon
never use Tp::Contact*
always Tp::ContactPtr
there's not really any scope for this to go wrong in this scenario, but it's a good habbit.
in contactPresenceChanged you can run Tp::ContactPtr contact(qobject_cast<Tp::Contact*>(sender());
contactnotify.cpp
<http://git.reviewboard.kde.org/r/106355/#comment14721>
Using icon names is faster for notifications than pixmaps.
you can use ktpPresence.iconName() to get this.
- David Edmundson
On Sept. 6, 2012, 11:11 a.m., Rohan Garg wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106355/
> -----------------------------------------------------------
>
> (Updated Sept. 6, 2012, 11:11 a.m.)
>
>
> Review request for Telepathy.
>
>
> Description
> -------
>
> Minor styling fixup
>
>
> Make sure that the connection and contacts actually exist before doing anything
>
> This change makes the code a bit more asynchronous and uses the right
> eventID for notifications
>
> Implement contact notifications
>
>
> Diffs
> -----
>
> CMakeLists.txt 96cedcff5a09eb26217b9032a68f4b4e01768805
> contactnotify.h PRE-CREATION
> contactnotify.cpp PRE-CREATION
> telepathy-module.h 15666bcebf6d4b1d9640e016ff8d6202471b7629
> telepathy-module.cpp 2085fea3d133db388e43c47ee8b0f3af8d5279cd
>
> Diff: http://git.reviewboard.kde.org/r/106355/diff/
>
>
> Testing
> -------
>
> Notifications from specific contacts were shown.
>
>
> Screenshots
> -----------
>
>
> http://git.reviewboard.kde.org/r/106355/s/718/
>
>
> Thanks,
>
> Rohan Garg
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20120906/6984f165/attachment-0001.html>
More information about the KDE-Telepathy
mailing list