[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:08:08 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=0a306b0

The following commit has been merged in the master branch:
commit 0a306b0583874b84c7d757322954c75e845ce906
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Mon Nov 28 15:15:58 2011 +0100

    Remove contact subscription requests from contact list, these are now in kded
    
    Reviewed-by: David Edmundson
---
 main-widget.cpp | 87 ---------------------------------------------------------
 main-widget.h   |  6 ----
 2 files changed, 93 deletions(-)

diff --git a/main-widget.cpp b/main-widget.cpp
index 7f0adf1..7fd60e1 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -433,14 +433,6 @@ void MainWidget::onNewAccountAdded(const Tp::AccountPtr& account)
 {
     Q_ASSERT(account->isReady(Tp::Account::FeatureCore));
 
-    if (account->connection()) {
-        monitorPresence(account->connection());
-    }
-
-    connect(account.data(),
-            SIGNAL(connectionChanged(Tp::ConnectionPtr)),
-            this, SLOT(onConnectionChanged(Tp::ConnectionPtr)));
-
     connect(account.data(),
             SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)),
             this, SLOT(onAccountConnectionStatusChanged(Tp::ConnectionStatus)));
@@ -454,45 +446,6 @@ void MainWidget::onNewAccountAdded(const Tp::AccountPtr& account)
     }
 }
 
-void MainWidget::monitorPresence(const Tp::ConnectionPtr &connection)
-{
-    kDebug();
-    connect(connection->contactManager().data(), SIGNAL(presencePublicationRequested(Tp::Contacts)),
-            this, SLOT(onPresencePublicationRequested(Tp::Contacts)));
-
-    connect(connection->contactManager().data(),
-            SIGNAL(stateChanged(Tp::ContactListState)),
-            this, SLOT(onContactManagerStateChanged(Tp::ContactListState)));
-    onContactManagerStateChanged(connection->contactManager(),
-                                 connection->contactManager()->state());
-}
-
-void MainWidget::onContactManagerStateChanged(Tp::ContactListState state)
-{
-    onContactManagerStateChanged(Tp::ContactManagerPtr(qobject_cast< Tp::ContactManager* >(sender())), state);
-}
-
-void MainWidget::onContactManagerStateChanged(const Tp::ContactManagerPtr &contactManager, Tp::ContactListState state)
-{
-    if (state == Tp::ContactListStateSuccess) {
-        QFutureWatcher< Tp::ContactPtr > *watcher = new QFutureWatcher< Tp::ContactPtr >(this);
-        connect(watcher, SIGNAL(finished()), this, SLOT(onAccountsPresenceStatusFiltered()));
-        watcher->setFuture(QtConcurrent::filtered(contactManager->allKnownContacts(),
-                                                kde_tp_filter_contacts_by_publication_status));
-
-        kDebug() << "Watcher is on";
-    }
-}
-
-
-
-void MainWidget::onConnectionChanged(const Tp::ConnectionPtr& connection)
-{
-    if(! connection.isNull()) {
-        monitorPresence(connection);
-    }
-}
-
 void MainWidget::onContactListClicked(const QModelIndex& index)
 {
     if (!index.isValid()) {
@@ -1253,46 +1206,6 @@ void MainWidget::showSettingsKCM()
     dialog->exec();
 }
 
-void MainWidget::onAccountsPresenceStatusFiltered()
-{
-    kDebug() << "Watcher is here";
-    QFutureWatcher< Tp::ContactPtr > *watcher = dynamic_cast< QFutureWatcher< Tp::ContactPtr > * >(sender());
-    kDebug() << "Watcher is casted";
-    Tp::Contacts contacts = watcher->future().results().toSet();
-    kDebug() << "Watcher is used";
-    if (!contacts.isEmpty()) {
-        onPresencePublicationRequested(contacts);
-    }
-    watcher->deleteLater();
-}
-
-void MainWidget::onPresencePublicationRequested(const Tp::Contacts& contacts)
-{
-    foreach (const Tp::ContactPtr &contact, contacts) {
-        Tp::ContactManagerPtr manager = contact->manager();
-        Tp::PendingOperation *op = 0;
-
-        if (contact->subscriptionState() == Tp::Contact::PresenceStateYes) {
-            op = manager->authorizePresencePublication(QList< Tp::ContactPtr >() << contact);
-        } else if (KMessageBox::questionYesNo(this, i18n("The contact %1 added you to their contact list. "
-                                                  "Do you want to allow this person to see your presence "
-                                                  "and add them to your contact list?", contact->id()),
-                                       i18n("Subscription request")) == KMessageBox::Yes) {
-
-            op = manager->authorizePresencePublication(QList< Tp::ContactPtr >() << contact);
-
-            if (manager->canRequestPresenceSubscription() && contact->subscriptionState() == Tp::Contact::PresenceStateNo) {
-                manager->requestPresenceSubscription(QList< Tp::ContactPtr >() << contact);
-            }
-        }
-
-        if (op) {
-            connect(op, SIGNAL(finished(Tp::PendingOperation*)),
-                    SLOT(onGenericOperationFinished(Tp::PendingOperation*)));
-        }
-    }
-}
-
 QStringList MainWidget::extractLinksFromIndex(const QModelIndex& index)
 {
     QString presenceMsg = index.data(AccountsModel::PresenceMessageRole).toString();
diff --git a/main-widget.h b/main-widget.h
index 9c36ae9..65ec9f9 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -110,14 +110,9 @@ private Q_SLOTS:
     void onAccountManagerReady(Tp::PendingOperation *op);
     void onContactListClicked(const QModelIndex &index);
     void onContactListDoubleClicked(const QModelIndex &index);
-    void onConnectionChanged(const Tp::ConnectionPtr &connection);
     void onAccountConnectionStatusChanged(Tp::ConnectionStatus status);
     void onCustomContextMenuRequested(const QPoint &point);
 
-    void onAccountsPresenceStatusFiltered();
-    void onPresencePublicationRequested(const Tp::Contacts &contacts);
-    void onContactManagerStateChanged(Tp::ContactListState state);
-    void onContactManagerStateChanged(const Tp::ContactManagerPtr &contactManager, Tp::ContactListState state);
     void onSwitchToFullView();
     void onSwitchToCompactView();
     void onNewGroupModelItemsInserted(const QModelIndex &index, int start, int end);
@@ -125,7 +120,6 @@ private Q_SLOTS:
     void onGenericOperationFinished(Tp::PendingOperation *operation);   /** called when a Tp::PendingOperation finishes. Used to check for errors */
     void onOpenLinkTriggered(QAction *action);                          /** triggered from custom contact menu when user clicks contact link */
     void groupContacts(bool enabled);
-    void monitorPresence(const Tp::ConnectionPtr &connection);
 
 Q_SIGNALS:
     void enableOverlays(bool);

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list