Review Request: Add methods to set and get preferred handlers

Daniele Elmo Domenichelli daniele.domenichelli at gmail.com
Mon Nov 12 16:20:03 UTC 2012


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

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/20121112/6b737185/attachment.html>


More information about the KDE-Telepathy mailing list