[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:06:22 UTC 2016


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

The following commit has been merged in the master branch:
commit 90bdcc9ed5d302d40c61d3256631f858a45ab1ba
Author: Francesco Nwokeka <francesco.nwokeka at gmail.com>
Date:   Sat May 7 14:27:12 2011 +0200

    Connect connection errors in contactlist
    
    Reviewed by: Martin Klapetek
    REVIEW: 101303
    
    connected connection errors for contact list
---
 main-widget.cpp | 25 ++++++++++++++++++++++++-
 main-widget.h   |  3 +++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/main-widget.cpp b/main-widget.cpp
index 8e2a0d3..e66c678 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -303,7 +303,8 @@ void MainWidget::onAccountConnectionStatusChanged(Tp::ConnectionStatus status)
         m_contactsListView->setExpanded(index, true);
         break;
     case Tp::ConnectionStatusDisconnected:
-        //Fall through
+        handleConnectionError(account);
+        break;
     case Tp::ConnectionStatusConnecting:
         m_contactsListView->setExpanded(index, false);
     default:
@@ -1113,4 +1114,26 @@ void MainWidget::onPresencePublicationRequested(const Tp::Contacts& contacts)
     }
 }
 
+void MainWidget::handleConnectionError(const Tp::AccountPtr& account)
+{
+    QString connectionError = account->connectionError();
+
+    // ignore user disconnect
+    if (connectionError == "org.freedesktop.Telepathy.Error.Cancelled") {
+        return;
+    }
+
+    Tp::ConnectionStatusReason reason = account->connectionStatusReason();
+
+    if (reason == Tp::ConnectionStatusReasonAuthenticationFailed) {
+        showMessageToUser(i18n("Couldn't connect %1. Authentication failed (is your password correct?)", account->displayName()), MainWidget::SystemMessageError);
+    } else if (reason == Tp::ConnectionStatusReasonNetworkError) {
+        showMessageToUser(i18n("Couldn't connect %1. There was a network error, check your connection", account->displayName()), MainWidget::SystemMessageError);
+    } else {
+        // other errors
+        showMessageToUser(i18n("An unexpected error has occured with %1: '%2'", account->displayName(), account->connectionError()), MainWidget::SystemMessageError);
+    }
+}
+
+
 #include "main-widget.moc"
diff --git a/main-widget.h b/main-widget.h
index 7008590..7a5e417 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -107,6 +107,9 @@ private Q_SLOTS:
     void onContactManagerStateChanged(const Tp::ContactManagerPtr &contactManager, Tp::ContactListState state);
 
 private:
+    /** handle connection errors for given account. This method provides visual notification */
+    void handleConnectionError(const Tp::AccountPtr &account);
+
     AccountsModel          *m_model;
     AccountFilterModel     *m_modelFilter;
     Tp::AccountManagerPtr   m_accountManager;

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list