[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ktp-contact-list/kde-telepathy-0.7] /: If in kpeople mode use the shared AccountManager
From:       David Edmundson <kde () davidedmundson ! co ! uk>
Date:       2013-10-25 11:31:55
Message-ID: E1VZfcR-0003i6-6n () scm ! kde ! org
[Download RAW message or body]

Git commit a141bd2b1ad13885cb7a5c378f912a638bbc8d89 by David Edmundson.
Committed on 13/10/2013 at 15:40.
Pushed by davidedmundson into branch 'kde-telepathy-0.7'.

If in kpeople mode use the shared AccountManager

REVIEW: 113232
BUG:325216

M  +31   -26   main-widget.cpp

http://commits.kde.org/telepathy-contact-list/a141bd2b1ad13885cb7a5c378f912a638bbc8d89


diff --git a/main-widget.cpp b/main-widget.cpp
index 525df47..65beae8 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -515,32 +515,37 @@ void MainWidget::setupToolBar()
 void MainWidget::setupTelepathy()
 {
     Tp::registerTypes();
-    Tp::AccountFactoryPtr  accountFactory = \
                Tp::AccountFactory::create(QDBusConnection::sessionBus(),
-                                                                       \
                Tp::Features() << Tp::Account::FeatureCore
-                                                                       << \
                Tp::Account::FeatureAvatar
-                                                                       << \
                Tp::Account::FeatureCapabilities
-                                                                       << \
                Tp::Account::FeatureProtocolInfo
-                                                                       << \
                Tp::Account::FeatureProfile);
-
-    Tp::ConnectionFactoryPtr connectionFactory = \
                Tp::ConnectionFactory::create(QDBusConnection::sessionBus(),
-                                                                               \
                Tp::Features() << Tp::Connection::FeatureCore
-                                                                               << \
                Tp::Connection::FeatureSelfContact);
-
-    Tp::ContactFactoryPtr contactFactory = \
                KTp::ContactFactory::create(Tp::Features()  << \
                Tp::Contact::FeatureAlias
-                                                                      << \
                Tp::Contact::FeatureAvatarToken
-                                                                      << \
                Tp::Contact::FeatureAvatarData
-                                                                      << \
                Tp::Contact::FeatureSimplePresence
-                                                                      << \
                Tp::Contact::FeatureCapabilities
-                                                                      << \
                Tp::Contact::FeatureClientTypes);
-
-    Tp::ChannelFactoryPtr channelFactory = \
                Tp::ChannelFactory::create(QDBusConnection::sessionBus());
-    channelFactory->addFeaturesForTextChats(Tp::Features() << \
                Tp::Channel::FeatureCore << Tp::TextChannel::FeatureMessageQueue);
-
-    m_accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus(),
-                                                  accountFactory,
-                                                  connectionFactory,
-                                                  channelFactory,
-                                                  contactFactory);
+
+    if (KTp::kpeopleEnabled()) {
+        m_accountManager = KTp::accountManager();
+    } else {
+
+        Tp::AccountFactoryPtr  accountFactory = \
Tp::AccountFactory::create(QDBusConnection::sessionBus(), +                           \
Tp::Features() << Tp::Account::FeatureCore +                                          \
<< Tp::Account::FeatureAvatar +                                                       \
<< Tp::Account::FeatureCapabilities +                                                 \
<< Tp::Account::FeatureProtocolInfo +                                                 \
<< Tp::Account::FeatureProfile); +
+        Tp::ConnectionFactoryPtr connectionFactory = \
Tp::ConnectionFactory::create(QDBusConnection::sessionBus(), +                        \
Tp::Features() << Tp::Connection::FeatureCore +                                       \
<< Tp::Connection::FeatureSelfContact); +
+        Tp::ContactFactoryPtr contactFactory = \
KTp::ContactFactory::create(Tp::Features()  << Tp::Contact::FeatureAlias +            \
<< Tp::Contact::FeatureAvatarToken +                                                  \
<< Tp::Contact::FeatureAvatarData +                                                   \
<< Tp::Contact::FeatureSimplePresence +                                               \
<< Tp::Contact::FeatureCapabilities +                                                 \
<< Tp::Contact::FeatureClientTypes); +
+        Tp::ChannelFactoryPtr channelFactory = \
Tp::ChannelFactory::create(QDBusConnection::sessionBus()); +
+        m_accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus(),
+                                                    accountFactory,
+                                                    connectionFactory,
+                                                    channelFactory,
+                                                    contactFactory);
+    }
 
     connect(m_accountManager->becomeReady(), \
SIGNAL(finished(Tp::PendingOperation*)),  this, \
SLOT(onAccountManagerReady(Tp::PendingOperation*)));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic