~phablet-team/telephony-service/qml-start-chat

« back to all changes in this revision

Viewing changes to handler/main.cpp

merge parent

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <TelepathyQt/AbstractClient>
31
31
#include <TelepathyQt/AccountManager>
32
32
#include <TelepathyQt/Contact>
 
33
#include <telepathy-farstream/telepathy-farstream.h>
 
34
#include <TelepathyQt/CallChannel>
 
35
 
 
36
Q_DECLARE_METATYPE(Tp::CallChannelPtr)
33
37
 
34
38
int main(int argc, char **argv)
35
39
{
37
41
    QCoreApplication::setApplicationName("telephony-service-handler");
38
42
 
39
43
    Tp::registerTypes();
 
44
    gst_init(&argc, &argv);
 
45
    qRegisterMetaType<Tp::CallChannelPtr>();
 
46
    qRegisterMetaType<AudioOutputDBus>();
 
47
    qRegisterMetaType<AudioOutputDBusList>();
 
48
 
 
49
    qDBusRegisterMetaType<AudioOutputDBus>();
 
50
    qDBusRegisterMetaType<AudioOutputDBusList>();
40
51
 
41
52
    // check if there is already an instance of the handler running
42
53
    if (ApplicationUtils::checkApplicationRunning(TP_QT_IFACE_CLIENT + ".TelephonyServiceHandler")) {
44
55
        return 1;
45
56
    }
46
57
 
 
58
    HandlerDBus dbus;
47
59
    Handler *handler = new Handler();
48
 
    QObject::connect(TelepathyHelper::instance(), &TelepathyHelper::setupReady, [handler]() {
 
60
    QObject::connect(TelepathyHelper::instance(), &TelepathyHelper::setupReady, [&]() {
49
61
        TelepathyHelper::instance()->registerClient(handler, "TelephonyServiceHandler");
 
62
        dbus.connectToBus();
50
63
    });
51
 
 
 
64
 
52
65
    QObject::connect(handler, SIGNAL(callChannelAvailable(Tp::CallChannelPtr)),
53
66
                     CallHandler::instance(), SLOT(onCallChannelAvailable(Tp::CallChannelPtr)));
54
67
    QObject::connect(handler, SIGNAL(textChannelAvailable(Tp::TextChannelPtr)),