[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:05:51 UTC 2016


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

The following commit has been merged in the master branch:
commit 2d3e7886febec976721c113da0ad762d7a849768
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date:   Thu Apr 7 22:55:10 2011 +0200

    Cleaned up error handling in contact list
    
    The errors all had seperate slots. I converged them to one "slotGenericOperationFinished"
---
 main-widget.cpp | 54 +++++++-----------------------------------------------
 main-widget.h   | 10 ++--------
 2 files changed, 9 insertions(+), 55 deletions(-)

diff --git a/main-widget.cpp b/main-widget.cpp
index 2e049a1..9102364 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -344,15 +344,7 @@ void MainWidget::startTextChannel(const QModelIndex &index)
     Tp::PendingChannelRequest* channelRequest = account->ensureTextChat(contact,
                                                                         QDateTime::currentDateTime(),
                                                                         PREFERRED_TEXTCHAT_HANDLER);
-    connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)), SLOT(onChannelJoined(Tp::PendingOperation*)));
-}
-
-void MainWidget::onChannelJoined(Tp::PendingOperation* op)
-{
-    if (op->isError()) {
-        kDebug() << op->errorName();
-        kDebug() << op->errorMessage();
-    }
+    connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)), SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
 }
 
 void MainWidget::showMessageToUser(const QString& text, const MainWidget::SystemMessageType type)
@@ -566,14 +558,6 @@ void MainWidget::onCustomContextMenuRequested(const QPoint &)
     menu->exec(QCursor::pos());
 }
 
-void MainWidget::slotAddContactToGroupFinished(Tp::PendingOperation* operation)
-{
-    if (operation->isError()) {
-        kDebug() << operation->errorName();
-        kDebug() << operation->errorMessage();
-    }
-}
-
 void MainWidget::slotAddContactToGroupTriggered()
 {
     QModelIndex index = m_contactsListView->currentIndex();
@@ -593,25 +577,17 @@ void MainWidget::slotAddContactToGroupTriggered()
 
     Tp::PendingOperation* operation = contact->addToGroup(action->text().remove('&'));
     connect(operation, SIGNAL(finished(Tp::PendingOperation*)),
-            SLOT(slotAddContactToGroupFinished(Tp::PendingOperation*)));
+            SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
 
     if (operation) {
         foreach (const QString &group, currentGroups) {
             Tp::PendingOperation* operation = contact->removeFromGroup(group);
             connect(operation, SIGNAL(finished(Tp::PendingOperation*)),
-                    SLOT(slotRemoveContactFromGroupFinished(Tp::PendingOperation*)));
+                    SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
         }
     }
 }
 
-void MainWidget::slotBlockContactFinished(Tp::PendingOperation *operation)
-{
-    if (operation->isError()) {
-        kDebug() << operation->errorName();
-        kDebug() << operation->errorMessage();
-    }
-}
-
 void MainWidget::slotBlockContactTriggered()
 {
     QModelIndex index = m_contactsListView->currentIndex();
@@ -624,7 +600,7 @@ void MainWidget::slotBlockContactTriggered()
 
     Tp::PendingOperation *operation = contact->block(true);
     connect(operation, SIGNAL(finished(Tp::PendingOperation*)),
-            SLOT(slotBlockContactFinished(Tp::PendingOperation*)));
+            SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
 }
 
 void MainWidget::slotDeleteContact()
@@ -661,16 +637,8 @@ void MainWidget::slotDeleteContact()
 void MainWidget::slotGenericOperationFinished(Tp::PendingOperation* operation)
 {
     if (operation->isError()) {
-        kDebug() << operation->errorName();
-        kDebug() << operation->errorMessage();
-    }
-}
-
-void MainWidget::slotRemoveContactFromGroupFinished(Tp::PendingOperation *operation)
-{
-    if (operation->isError()) {
-        kDebug() << operation->errorName();
-        kDebug() << operation->errorMessage();
+        QString errorMsg(operation->errorName() + ": " + operation->errorMessage());
+        showMessageToUser(errorMsg, SystemMessageError);
     }
 }
 
@@ -685,14 +653,6 @@ void MainWidget::slotStartTextChat()
     startTextChannel(index);
 }
 
-void MainWidget::slotUnblockContactFinished(Tp::PendingOperation* operation)
-{
-    if (operation->isError()) {
-        kDebug() << operation->errorName();
-        kDebug() << operation->errorMessage();
-    }
-}
-
 void MainWidget::slotUnblockContactTriggered()
 {
     QModelIndex index = m_contactsListView->currentIndex();
@@ -704,7 +664,7 @@ void MainWidget::slotUnblockContactTriggered()
 
     Tp::PendingOperation *operation = contact->block(false);
     connect(operation, SIGNAL(finished(Tp::PendingOperation*)),
-            SLOT(slotUnblockContactFinished(Tp::PendingOperation*)));
+            SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
 }
 
 
diff --git a/main-widget.h b/main-widget.h
index e310b35..6021c6a 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -64,7 +64,6 @@ public:
 
 public Q_SLOTS:
     void onAccountManagerReady(Tp::PendingOperation *op);
-    void onChannelJoined(Tp::PendingOperation *op);
     void startTextChannel(const QModelIndex &index);
     void onContactListDoubleClick(const QModelIndex &index);
     void onConnectionChanged(const Tp::ConnectionPtr &connection);
@@ -87,16 +86,11 @@ public Q_SLOTS:
     void onCustomContextMenuRequested(const QPoint &point);
 
 private Q_SLOTS:
-    void slotAddContactToGroupFinished(Tp::PendingOperation *operation);
     void slotAddContactToGroupTriggered();
-    void slotBlockContactFinished(Tp::PendingOperation *operation);
     void slotBlockContactTriggered();
-    void slotDeleteContact();   /** deletes contact from user's contactlist */
-    /** called when a Tp::PendingOperation finishes. Used to check for errors */
-    void slotGenericOperationFinished(Tp::PendingOperation *operation);
-    void slotRemoveContactFromGroupFinished(Tp::PendingOperation *operation);
+    void slotDeleteContact();
+    void slotGenericOperationFinished(Tp::PendingOperation *operation); /** called when a Tp::PendingOperation finishes. Used to check for errors */
     void slotStartTextChat();
-    void slotUnblockContactFinished(Tp::PendingOperation *operation);
     void slotUnblockContactTriggered();
 
 private:

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list