Review Request: Add methods to set and get preferred handlers

George Kiagiadakis kiagiadakis.george at gmail.com
Tue Nov 13 11:23:12 UTC 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107295/#review21927
-----------------------------------------------------------


That's some very good quality code :)

This API is useful, so I agree to the idea. We need a way to configure handler preferences, especially for tube apps. You will definitely need to distinguish between requested=true/false (think of krfb/krdc) and perhaps TargetHandleType=1/2 for extensibility.

I am not totally sure how this is going to blend with the .desktop files, but here are my thoughts. There are 2 kinds of .desktop files:

1) Ones that specify actions to start (channels with requested=true). These can populate the CL with actions on contacts for example. For this kind, we will either need a mechanism to group together apps that do the same action (for example vino and krfb) and use this API to know which one is the preferred app to use, or we can let them both be there as actions with the app name in parenthesis or something like that.

2) Ones that specify notification messages for the approver. Here the approver will have to choose the preferred app and use its .desktop file as a source for the messages. I think it should be possible to use this API for this purpose.

One last thing. I don't really like having desktop sharing in the API. I think that all tube apps should be equal and use the .desktop file specification. We may want to remove it one day (say krfb breaks and nobody maintains it...) or we may want to exchange it with another app that speaks another protocol (other than rfb). The API should stay clean of these changes. But in any case, I think that for the moment it can stay and we can remove it after the whole thing with the .desktop files has been implemented (we don't keep BC anyway).

- George Kiagiadakis


On Nov. 12, 2012, 4:20 p.m., Daniele Elmo Domenichelli wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107295/
> -----------------------------------------------------------
> 
> (Updated Nov. 12, 2012, 4:20 p.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Description
> -------
> 
> Together with https://git.reviewboard.kde.org/r/107169 , I would like to have methods to set and get preferred handlers, so here it is, documentation included.
> 
> In future, when we have the .desktop magic working, I would like to add methods to retrieve available handlers for one channel type in order to have some interface where we can configure them, for now I suggest we start using preferredHandlerForXXX everywhere.
> 
> 
> Diffs
> -----
> 
>   KTp/CMakeLists.txt 0fd12f084384c4df308707b8879e51d8b5908c69 
>   KTp/handlers.h PRE-CREATION 
>   KTp/handlers.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/107295/diff/
> 
> 
> Testing
> -------
> 
> Run this test, works as expected both reading and writing, but I'm too lazy to write proper unit tests, since we don't have them yet in ktp-common-internals (yes, we definitely should have them, but that's another patch)
> 
>     kDebug() << KTp::Handlers::defaultHandlerForTextChat();
>     kDebug() << KTp::Handlers::defaultHandlerForFileTransfer();
>     kDebug() << KTp::Handlers::defaultHandlerForAudioVideo();
>     kDebug() << KTp::Handlers::defaultHandlerForDesktopSharing();
> 
>     kDebug() << KTp::Handlers::preferredHandlerForTextChat();
>     kDebug() << KTp::Handlers::preferredHandlerForFileTransfer();
>     kDebug() << KTp::Handlers::preferredHandlerForAudioVideo();
>     kDebug() << KTp::Handlers::preferredHandlerForDesktopSharing();
> 
>     kDebug() << KTp::Handlers::preferredHandlerForTextChat(QLatin1String("A"));
>     kDebug() << KTp::Handlers::preferredHandlerForFileTransfer(QLatin1String("B"));
>     kDebug() << KTp::Handlers::preferredHandlerForAudioVideo(QLatin1String("C"));
>     kDebug() << KTp::Handlers::preferredHandlerForDesktopSharing(QLatin1String("D"));
> 
>     KTp::Handlers::setPreferredHandlerForTextChat(QLatin1String("E"));
>     KTp::Handlers::setPreferredHandlerForFileTransfer(QLatin1String("F"));
>     KTp::Handlers::setPreferredHandlerForAudioVideo(QLatin1String("G"));
>     KTp::Handlers::setPreferredHandlerForDesktopSharing(QLatin1String("H"));
> 
>     kDebug() << KTp::Handlers::preferredHandlerForTextChat(QLatin1String("I"));
>     kDebug() << KTp::Handlers::preferredHandlerForFileTransfer(QLatin1String("J"));
>     kDebug() << KTp::Handlers::preferredHandlerForAudioVideo(QLatin1String("K"));
>     kDebug() << KTp::Handlers::preferredHandlerForDesktopSharing(QLatin1String("L"));
> 
>     KTp::Handlers::unsetPreferredHandlerForTextChat();
>     KTp::Handlers::unsetPreferredHandlerForFileTransfer();
>     KTp::Handlers::unsetPreferredHandlerForAudioVideo();
>     KTp::Handlers::unsetPreferredHandlerForDesktopSharing();
> 
>     kDebug() << KTp::Handlers::preferredHandlerForTextChat();
>     kDebug() << KTp::Handlers::preferredHandlerForFileTransfer();
>     kDebug() << KTp::Handlers::preferredHandlerForAudioVideo();
>     kDebug() << KTp::Handlers::preferredHandlerForDesktopSharing();
> 
> 
> Thanks,
> 
> Daniele Elmo Domenichelli
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20121113/643b255c/attachment.html>


More information about the KDE-Telepathy mailing list