[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2

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


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=411d23f

The following commit has been merged in the master branch:
commit 411d23f61e9d3d5a96d002182d04763fd2d14190
Author: Dario Freddi <dario.freddi at collabora.com>
Date:   Fri Nov 25 01:53:26 2011 +0100

    Same for denying the request
---
 contact-request-handler.cpp | 31 ++++++++++++++++++++++++++++---
 contact-request-handler.h   |  1 +
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/contact-request-handler.cpp b/contact-request-handler.cpp
index 577e9f6..ccb3936 100644
--- a/contact-request-handler.cpp
+++ b/contact-request-handler.cpp
@@ -243,13 +243,38 @@ void ContactRequestHandler::onContactRequestDenied()
         Tp::ContactPtr contact = m_pendingContacts.value(contactId);
         if (!contact.isNull()) {
             Tp::PendingOperation *op = contact->manager()->removePresencePublication(QList< Tp::ContactPtr >() << contact);
-            //TODO: connect and let user know the result, find and remove the menu from statusnotifier
-            //      don't forget to update the tooltip with -1
-//             delete m_notifierMenu->findChild<KMenu*>(contactId);
+            op->setProperty("__contact", QVariant::fromValue(contact));
+
+            connect(op, SIGNAL(finished(Tp::PendingOperation*)),
+                    this, SLOT(onRemovePresencePublicationFinished(Tp::PendingOperation*)));
         }
     }
 }
 
+void ContactRequestHandler::onRemovePresencePublicationFinished(Tp::PendingOperation *op)
+{
+    Tp::ContactPtr contact = op->property("__contact").value< Tp::ContactPtr >();
+
+    if (op->isError()) {
+        // ARGH
+        m_notifierItem.data()->showMessage(i18n("Error denying contact request"),
+                                           i18n("There was an error while denying the request: %1",
+                                                op->errorMessage()), QLatin1String("dialog-error"));
+
+        // Re-enable the action
+        m_menuItems.value(contact->id())->setEnabled(true);
+    } else {
+        // Yeah
+        m_notifierItem.data()->showMessage(i18n("Contact request denied"),
+                                           i18n("%1 will not be able to see your presence",
+                                                contact->alias()), QLatin1String("dialog-ok-apply"));
+
+        // Update the menu
+        m_pendingContacts.remove(contact->id());
+        updateMenus();
+    }
+}
+
 void ContactRequestHandler::updateMenus()
 {
     if (m_notifierItem.isNull()) {
diff --git a/contact-request-handler.h b/contact-request-handler.h
index 27f9a95..43363ef 100644
--- a/contact-request-handler.h
+++ b/contact-request-handler.h
@@ -52,6 +52,7 @@ public Q_SLOTS:
     void onContactRequestApproved();
     void onContactRequestDenied();
     void onAuthorizePresencePublicationFinished(Tp::PendingOperation*);
+    void onRemovePresencePublicationFinished(Tp::PendingOperation*);
 
 private:
     KStatusNotifierItem *notifierItem();

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list