[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:07:33 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=8ee0f2f

The following commit has been merged in the master branch:
commit 8ee0f2f600a836f1223a9d7999c0c78abca9c1b4
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Wed Feb 6 16:00:22 2013 +0100

    Remove more unneeded stuff from the feeder
    
    Since we have direct interface with Telepathy in KPeople,
    we don't need most of the feeded things. Currently for contacts
    we'll be feeding just Telepathy ID, alias, avatar and groups,
    all the rest will come directly from Telepathy. Makes the feeder
    ligher and faster too.
    
    REVIEW: 108803
---
 kpeople/nepomuk-feeder/abstract-storage.h  |  36 ------
 kpeople/nepomuk-feeder/account.cpp         |  45 -------
 kpeople/nepomuk-feeder/account.h           |   8 --
 kpeople/nepomuk-feeder/controller.cpp      |  27 ++---
 kpeople/nepomuk-feeder/nepomuk-storage.cpp | 183 -----------------------------
 kpeople/nepomuk-feeder/nepomuk-storage.h   |   4 -
 6 files changed, 8 insertions(+), 295 deletions(-)

diff --git a/kpeople/nepomuk-feeder/abstract-storage.h b/kpeople/nepomuk-feeder/abstract-storage.h
index 4580a24..9218554 100644
--- a/kpeople/nepomuk-feeder/abstract-storage.h
+++ b/kpeople/nepomuk-feeder/abstract-storage.h
@@ -116,42 +116,6 @@ public Q_SLOTS:
     virtual void setContactGroups(const QString &path, const QString &id, const QStringList &groups) = 0;
 
     /**
-     * Invoked to update the blocked status of the Telepathy Contact.
-     *
-     * \param path the object path (unique identifier) of the account
-     * \param id the id (e.g. me at example.com) that in conjunction with the \p path uniquely identifies the contact.
-     * \param blocked indicates whether the contact is blocked or not.
-     */
-    virtual void setContactBlockStatus(const QString &path, const QString &id, bool blocked) = 0;
-
-    /**
-     * Invoked to update the presence-publishing state of the Telepathy Contact.
-     *
-     * \param path the object path (unique identifier) of the account
-     * \param id the id (e.g. me at example.com) that in conjunction with the \p path uniquely identifies the contact.
-     * \param state the presence-publishing state of the contact.
-     */
-    virtual void setContactPublishState(const QString &path, const QString &id, const Tp::Contact::PresenceState &state) = 0;
-
-    /**
-     * Invoked to update the presence-subscription state of the Telepathy Contact.
-     *
-     * \param path the object path (unique identifier) of the account
-     * \param id the id (e.g. me at example.com) that in conjunction with the \p path uniquely identifies the contact.
-     * \param state the presence-subscription state of the contact.
-     */
-    virtual void setContactSubscriptionState(const QString &path, const QString &id, const Tp::Contact::PresenceState &state) = 0;
-
-    /**
-     * Invoked to update the capabilities of the Telepathy Contact.
-     *
-     * \param path the object path (unique identifier) of the account
-     * \param id the id (e.g. me at example.com) that in conjunction with the \p path uniquely identifies the contact.
-     * \param capabilities the complete list of capabilities of the contact.
-     */
-    virtual void setContactCapabilities(const QString &path, const QString &id, const Tp::ConnectionPtr &connection, const Tp::ContactCapabilities &capabilities) = 0;
-
-    /**
      * Invoked to update the avatar of the Telepathy Contact.
      *
      * \param path the object path (unique identifier) of the account
diff --git a/kpeople/nepomuk-feeder/account.cpp b/kpeople/nepomuk-feeder/account.cpp
index 0b89ff5..f58a55b 100644
--- a/kpeople/nepomuk-feeder/account.cpp
+++ b/kpeople/nepomuk-feeder/account.cpp
@@ -177,18 +177,6 @@ void Account::onNewContact(const Tp::ContactPtr &contact)
                 SIGNAL(removedFromGroup(QString)),
                 SLOT(onContactRemovedFromGroup(QString)));
         connect(contact.data(),
-                SIGNAL(blockStatusChanged(bool)),
-                SLOT(onContactBlockStatusChanged(bool)));
-        connect(contact.data(),
-                SIGNAL(publishStateChanged(Tp::Contact::PresenceState)),
-                SLOT(onContactPublishStateChanged(Tp::Contact::PresenceState)));
-        connect(contact.data(),
-                SIGNAL(subscriptionStateChanged(Tp::Contact::PresenceState)),
-                SLOT(onContactSubscriptionStateChanged(Tp::Contact::PresenceState)));
-        connect(contact.data(),
-                SIGNAL(capabilitiesChanged(Tp::ContactCapabilities)),
-                SLOT(onContactCapabilitiesChanged(Tp::ContactCapabilities)));
-        connect(contact.data(),
                 SIGNAL(avatarDataChanged(Tp::AvatarData)),
                 SLOT(onContactAvatarChanged(Tp::AvatarData)));
 
@@ -220,39 +208,6 @@ void Account::onContactAliasChanged(const QString &alias)
     emit contactAliasChanged(m_account->objectPath(), contact->id(), alias);
 }
 
-void Account::onContactBlockStatusChanged(bool blocked)
-{
-    const Tp::ContactPtr contact(qobject_cast<Tp::Contact*>(sender()));
-    Q_ASSERT(contact);
-
-    emit contactBlockStatusChanged(m_account->objectPath(), contact->id(), blocked);
-}
-
-void Account::onContactPublishStateChanged(const Tp::Contact::PresenceState &state)
-{
-    const Tp::ContactPtr contact(qobject_cast<Tp::Contact*>(sender()));
-    Q_ASSERT(contact);
-
-    emit contactPublishStateChanged(m_account->objectPath(), contact->id(), state);
-}
-
-void Account::onContactSubscriptionStateChanged(const Tp::Contact::PresenceState &state)
-{
-    const Tp::ContactPtr contact(qobject_cast<Tp::Contact*>(sender()));
-    Q_ASSERT(contact);
-
-    emit contactSubscriptionStateChanged(m_account->objectPath(), contact->id(), state);
-}
-
-void Account::onContactCapabilitiesChanged(const Tp::ContactCapabilities &capabilities)
-{
-    const Tp::ContactPtr contact(qobject_cast<Tp::Contact*>(sender()));
-    Q_ASSERT(contact);
-
-
-    emit contactCapabilitiesChanged(m_account->objectPath(), contact->id(), m_connection, capabilities);
-}
-
 void Account::onContactAvatarChanged(const Tp::AvatarData &avatar)
 {
     const Tp::ContactPtr contact(qobject_cast<Tp::Contact*>(sender()));
diff --git a/kpeople/nepomuk-feeder/account.h b/kpeople/nepomuk-feeder/account.h
index 1518aa4..e7eb2ee 100644
--- a/kpeople/nepomuk-feeder/account.h
+++ b/kpeople/nepomuk-feeder/account.h
@@ -56,10 +56,6 @@ Q_SIGNALS:
     void contactCreated(const QString &path, const QString &id);
     void contactAliasChanged(const QString &path, const QString &id, const QString &alias);
     void contactGroupsChanged(const QString &path, const QString &id, const QStringList &groups);
-    void contactBlockStatusChanged(const QString &path, const QString &id, bool blocked);
-    void contactPublishStateChanged(const QString &path, const QString &id, const Tp::Contact::PresenceState &state);
-    void contactSubscriptionStateChanged(const QString &path, const QString &id, const Tp::Contact::PresenceState &state);
-    void contactCapabilitiesChanged(const QString &path, const QString &id, const Tp::ConnectionPtr &connection, const Tp::ContactCapabilities &capabilities);
     void contactAvatarChanged(const QString &path, const QString &id, const Tp::AvatarData &avatar);
 
 private Q_SLOTS:
@@ -72,10 +68,6 @@ private Q_SLOTS:
     void onContactAddedToGroup(const QString &group);
     void onContactRemovedFromGroup(const QString &group);
     void onContactAliasChanged(const QString &alias);
-    void onContactBlockStatusChanged(bool blocked);
-    void onContactPublishStateChanged(const Tp::Contact::PresenceState &state);
-    void onContactSubscriptionStateChanged(const Tp::Contact::PresenceState &state);
-    void onContactCapabilitiesChanged(const Tp::ContactCapabilities &capabilities);
     void onContactAvatarChanged(const Tp::AvatarData &avatar);
 
 private:
diff --git a/kpeople/nepomuk-feeder/controller.cpp b/kpeople/nepomuk-feeder/controller.cpp
index b33b185..449a1c4 100644
--- a/kpeople/nepomuk-feeder/controller.cpp
+++ b/kpeople/nepomuk-feeder/controller.cpp
@@ -52,19 +52,19 @@ void Controller::onStorageInitialised(bool success)
     Tp::Features fAccountFactory;
     fAccountFactory << Tp::Account::FeatureCore
                     << Tp::Account::FeatureAvatar
-                    << Tp::Account::FeatureCapabilities
-                    << Tp::Account::FeatureProfile
-                    << Tp::Account::FeatureProtocolInfo;
+                    << Tp::Account::FeatureProfile;
+
     Tp::AccountFactoryConstPtr accountFactory = Tp::AccountFactory::create(
             QDBusConnection::sessionBus(),
             fAccountFactory);
 
     Tp::Features fConnectionFactory;
     fConnectionFactory << Tp::Connection::FeatureCore
+                       // uncomment if the feeder crashes...said Dave. Dave is usually right.
+                       //<< Tp::Connection::FeatureSelfContact
                        << Tp::Connection::FeatureRoster
-                       << Tp::Connection::FeatureRosterGroups
-                       << Tp::Connection::FeatureSelfContact
-                       << Tp::Connection::FeatureSimplePresence;
+                       << Tp::Connection::FeatureRosterGroups;
+
     Tp::ConnectionFactoryConstPtr connectionFactory = Tp::ConnectionFactory::create(
             QDBusConnection::sessionBus(),
             fConnectionFactory);
@@ -73,11 +73,8 @@ void Controller::onStorageInitialised(bool success)
             QDBusConnection::sessionBus());
 
     Tp::Features fContactFactory;
-    fContactFactory << Tp::Contact::FeatureAlias
-                    << Tp::Contact::FeatureCapabilities
-                    << Tp::Contact::FeatureInfo
-                    << Tp::Contact::FeatureLocation
-                    << Tp::Contact::FeatureSimplePresence;
+    fContactFactory << Tp::Contact::FeatureAlias;
+
     Tp::ContactFactoryConstPtr contactFactory = Tp::ContactFactory::create(fContactFactory);
 
     // Create an instance of the AccountManager and start to get it ready.
@@ -149,14 +146,6 @@ void Controller::onNewAccount(const Tp::AccountPtr &account)
             m_storage, SLOT(setContactAlias(QString,QString,QString)));
     connect(acc, SIGNAL(contactGroupsChanged(QString,QString,QStringList)),
             m_storage, SLOT(setContactGroups(QString,QString,QStringList)));
-    connect(acc, SIGNAL(contactBlockStatusChanged(QString,QString,bool)),
-            m_storage, SLOT(setContactBlockStatus(QString,QString,bool)));
-    connect(acc, SIGNAL(contactPublishStateChanged(QString,QString,Tp::Contact::PresenceState)),
-            m_storage, SLOT(setContactPublishState(QString,QString,Tp::Contact::PresenceState)));
-    connect(acc, SIGNAL(contactSubscriptionStateChanged(QString,QString,Tp::Contact::PresenceState)),
-            m_storage, SLOT(setContactSubscriptionState(QString,QString,Tp::Contact::PresenceState)));
-    connect(acc, SIGNAL(contactCapabilitiesChanged(QString,QString,Tp::ConnectionPtr,Tp::ContactCapabilities)),
-            m_storage, SLOT(setContactCapabilities(QString,QString,Tp::ConnectionPtr,Tp::ContactCapabilities)));
     connect(acc, SIGNAL(contactAvatarChanged(QString,QString,Tp::AvatarData)),
             m_storage, SLOT(setContactAvatar(QString,QString,Tp::AvatarData)));
 
diff --git a/kpeople/nepomuk-feeder/nepomuk-storage.cpp b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
index cdd0b44..07d3003 100644
--- a/kpeople/nepomuk-feeder/nepomuk-storage.cpp
+++ b/kpeople/nepomuk-feeder/nepomuk-storage.cpp
@@ -513,20 +513,6 @@ void NepomukStorage::cleanupAccountContacts(const QString &path, const QList<QSt
 {
     QSet<QString> idSet = ids.toSet();
 
-    // Go through all the contacts in the cache and make any that are not in the list we
-    // received from the account into Ghost Contacts. Do this as a batch job to improve performance.
-    foreach (const ContactIdentifier &cid, m_contacts.keys()) {
-        if (cid.accountId() == path) {
-            if (!idSet.contains(cid.contactId())) {
-                // TODO: Do this properly once the ontology supports this
-                // TODO: Do this as a batch job to reduce the number of nepomuk queries that result.
-                kDebug() << "Ghosting contact: " << cid.contactId();
-                setContactPublishState(path, cid.contactId(), Tp::Contact::PresenceStateNo);
-                setContactSubscriptionState(path, cid.contactId(), Tp::Contact::PresenceStateNo);
-            }
-        }
-    }
-
     // Go through all the contacts that we have received from the account and create any
     // new ones in Nepomuk.
     QSet<QString> nepomukIds;
@@ -641,175 +627,6 @@ void NepomukStorage::setContactGroups(const QString &path,
     fireGraphTimer();
 }
 
-void NepomukStorage::setContactBlockStatus(const QString &path, const QString &id, bool blocked)
-{
-    ContactResources contact = findContact(path, id);
-    if( contact.isEmpty() )
-        return;
-
-    Nepomuk2::SimpleResource &imAccount = m_graph[contact.imAccount()];
-    imAccount.setProperty( NCO::isBlocked(), blocked );
-
-    fireGraphTimer();
-}
-
-void NepomukStorage::setContactPublishState(const QString &path,
-                                     const QString &id,
-                                     const Tp::Contact::PresenceState &state)
-{
-    /*
-    ContactResources contact = findContact(path, id);
-    if( contact.isEmpty() )
-        return;
-
-    AccountResources account = m_accounts.value(path);
-    if( account.isEmpty() )
-        return;
-
-    QUrl imAccountUri = contact.imAccount();
-    QUrl localAccountUri = account.account();
-
-    bool usRequest = false;
-    bool themPublish = false;
-
-    // Change the relationships based on the PresenceState value.
-    switch( state ) {
-        case Tp::Contact::PresenceStateYes:
-            themPublish = true;
-            break;
-
-        case Tp::Contact::PresenceStateAsk:
-            usRequest = true;
-            break;
-
-        case Tp::Contact::PresenceStateNo:
-            break;
-
-        default:
-            kWarning() << "Invalid Tp::Contact::PresenceState received.";
-            Q_ASSERT(false);
-    }
-
-    Nepomuk2::SimpleResource &localAccountRes = m_graph[localAccountUri];
-    if( usRequest ) {
-        localAccountRes.setProperty( NCO::requestedPresenceSubscriptionTo(), imAccountUri );
-    }
-    else {
-        localAccountRes.setProperty(NCO::requestedPresenceSubscriptionTo(), QVariant());
-    }
-
-    Nepomuk2::SimpleResource &imAccount = m_graph[imAccountUri];
-    if( themPublish ) {
-        imAccount.setProperty( NCO::publishesPresenceTo(), localAccountUri );
-    }
-    else {
-        imAccount.setProperty( NCO::publishesPresenceTo(), QVariant() );
-    }
-
-    fireGraphTimer();
-    */
-}
-
-void NepomukStorage::setContactSubscriptionState(const QString &path,
-                                          const QString &id,
-                                          const Tp::Contact::PresenceState &state)
-{
-    /*
-    ContactResources contact = findContact(path, id);
-    if( contact.isEmpty() )
-        return;
-
-    AccountResources account = m_accounts.value(path);
-    if( account.isEmpty() )
-        return;
-
-    QUrl imAccountUri = contact.imAccount();
-    QUrl localAccountUri = account.account();
-
-    bool usPublish = false;
-    bool themRequest = false;
-
-    // Change the relationships based on the PresenceState value.
-    switch( state ) {
-        case Tp::Contact::PresenceStateYes:
-            usPublish = true;
-            break;
-
-        case Tp::Contact::PresenceStateAsk:
-            themRequest = true;
-            break;
-
-        case Tp::Contact::PresenceStateNo:
-            break;
-
-        default:
-            kWarning() << "Invalid Tp::Contact::PresenceState received.";
-            Q_ASSERT(false);
-    }
-
-    Nepomuk2::SimpleResource &localAccountRes = m_graph[localAccountUri];
-    if( usPublish ) {
-        localAccountRes.setProperty( NCO::publishesPresenceTo(), imAccountUri );
-    }
-    else {
-        localAccountRes.setProperty( NCO::publishesPresenceTo(), QVariant() );
-    }
-
-    Nepomuk2::SimpleResource &imAccount = m_graph[imAccountUri];
-    if( themRequest ) {
-        imAccount.setProperty( NCO::requestedPresenceSubscriptionTo(), localAccountUri );
-    }
-    else {
-        imAccount.setProperty( NCO::requestedPresenceSubscriptionTo(), QVariant() );
-    }
-
-    fireGraphTimer();
-    */
-}
-
-void NepomukStorage::setContactCapabilities(const QString &path,
-                                            const QString &id,
-                                            const Tp::ConnectionPtr &connection,
-                                            const Tp::ContactCapabilities &capabilities)
-{
-    ContactResources contact = findContact(path, id);
-    if( contact.isEmpty() )
-        return;
-
-    bool audioCallsCap = false;
-    bool videoCallsCap = false;
-
-    if (connection) {
-        bool contactCanStreamAudio = CapabilitiesHackPrivate::audioCalls(
-            capabilities, connection->cmName());
-        bool selfCanStreamAudio = CapabilitiesHackPrivate::audioCalls(
-            connection->selfContact()->capabilities(), connection->cmName());
-        audioCallsCap = contactCanStreamAudio && selfCanStreamAudio;
-
-        bool contactCanStreamVideo = CapabilitiesHackPrivate::videoCalls(
-            capabilities, connection->cmName());
-        bool selfCanStreamVideo = CapabilitiesHackPrivate::videoCalls(
-            connection->selfContact()->capabilities(), connection->cmName());
-        videoCallsCap = contactCanStreamVideo && selfCanStreamVideo;
-    }
-
-    Nepomuk2::SimpleResource &imAccount = m_graph[contact.imAccount()];
-
-    // For each supported (by the ontology) capability, check it and save the correct value
-    // FIXME: Add other caps to the ontologies so that we can add them here.
-    if (capabilities.textChats()) {
-        imAccount.addProperty( NCO::hasIMCapability(), NCO::imCapabilityText() );
-    }
-    if (audioCallsCap) {
-        imAccount.addProperty( NCO::hasIMCapability(), NCO::imCapabilityAudio() );
-    }
-    if (videoCallsCap) {
-        imAccount.addProperty( NCO::hasIMCapability(), NCO::imCapabilityVideo() );
-    }
-
-    fireGraphTimer();
-}
-
 void NepomukStorage::setContactAvatar(const QString &path,
                                       const QString &id,
                                       const Tp::AvatarData &avatar)
diff --git a/kpeople/nepomuk-feeder/nepomuk-storage.h b/kpeople/nepomuk-feeder/nepomuk-storage.h
index 60ae252..2aab888 100644
--- a/kpeople/nepomuk-feeder/nepomuk-storage.h
+++ b/kpeople/nepomuk-feeder/nepomuk-storage.h
@@ -128,10 +128,6 @@ public Q_SLOTS:
     virtual void createContact(const QString &path, const QString &id);
     virtual void setContactAlias(const QString &path, const QString &id, const QString &alias);
     virtual void setContactGroups(const QString &path, const QString &id, const QStringList &groups);
-    virtual void setContactBlockStatus(const QString &path, const QString &id, bool blocked);
-    virtual void setContactPublishState(const QString &path, const QString &id, const Tp::Contact::PresenceState &state);
-    virtual void setContactSubscriptionState(const QString &path, const QString &id, const Tp::Contact::PresenceState &state);
-    virtual void setContactCapabilities(const QString &path, const QString &id, const Tp::ConnectionPtr &connection, const Tp::ContactCapabilities &capabilities);
     virtual void setContactAvatar(const QString &path, const QString &id, const Tp::AvatarData &avatar);
 
 signals:

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list