[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:14:37 UTC 2016


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

The following commit has been merged in the master branch:
commit a731ad4cf562d40f5ade31b214c8d641883bb118
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Mon Nov 12 21:56:14 2012 +0900

    Code tidy in Error Handler
    
    Make slot names in error-handler consistent with KTp
    Fix typo in i18nc comments
    Remove duplicate code
---
 error-handler.cpp | 18 ++++++++----------
 error-handler.h   |  6 +++---
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/error-handler.cpp b/error-handler.cpp
index 5bfe7ae..fa54f7f 100644
--- a/error-handler.cpp
+++ b/error-handler.cpp
@@ -33,13 +33,11 @@ ErrorHandler::ErrorHandler(const Tp::AccountManagerPtr& am, QObject* parent)
     m_accountManager = am;
 
     Q_FOREACH(const Tp::AccountPtr &account, am->allAccounts()) {
-        connect(account.data(),
-                SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)),
-                this, SLOT(handleErrors(Tp::ConnectionStatus)));
+        onNewAccount(account);
     }
 
     connect(m_accountManager.data(), SIGNAL(newAccount(Tp::AccountPtr)),
-            this, SLOT(handleNewAccount(Tp::AccountPtr)));
+            this, SLOT(onNewAccount(Tp::AccountPtr)));
 }
 
 ErrorHandler::~ErrorHandler()
@@ -47,7 +45,7 @@ ErrorHandler::~ErrorHandler()
 
 }
 
-void ErrorHandler::handleErrors(const Tp::ConnectionStatus status)
+void ErrorHandler::onConnectionStatusChanged(const Tp::ConnectionStatus status)
 {
     Tp::AccountPtr account(qobject_cast< Tp::Account* >(sender()));
 
@@ -61,16 +59,16 @@ void ErrorHandler::handleErrors(const Tp::ConnectionStatus status)
                 //do nothing
                 break;
             case Tp::ConnectionStatusReasonAuthenticationFailed:
-                showMessageToUser(i18nc("%1 ist the account name", "Could not connect %1. Authentication failed (is your password correct?)", account->displayName()), ErrorHandler::SystemMessageError);
+                showMessageToUser(i18nc("%1 is the account name", "Could not connect %1. Authentication failed (is your password correct?)", account->displayName()), ErrorHandler::SystemMessageError);
                 break;
             case Tp::ConnectionStatusReasonNetworkError:
                 //if connected to the network, and there was a network error - display it. Otherwise do nothing.
                 if (Solid::Networking::status() == Solid::Networking::Connected) {
-                    showMessageToUser(i18nc("%1 ist the account name", "Could not connect %1. There was a network error, check your connection", account->displayName()), ErrorHandler::SystemMessageError);
+                    showMessageToUser(i18nc("%1 is the account name", "Could not connect %1. There was a network error, check your connection", account->displayName()), ErrorHandler::SystemMessageError);
                 }
                 break;
             default:
-                showMessageToUser(i18nc("%1 ist the account name, %2 the error message", "There was a problem while trying to connect %1 - %2", account->displayName(), KTp::ErrorDictionary::displayVerboseErrorMessage(connectionError)), ErrorHandler::SystemMessageError);
+                showMessageToUser(i18nc("%1 is the account name, %2 the error message", "There was a problem while trying to connect %1 - %2", account->displayName(), KTp::ErrorDictionary::displayVerboseErrorMessage(connectionError)), ErrorHandler::SystemMessageError);
                 break;
         }
     }
@@ -93,8 +91,8 @@ void ErrorHandler::showMessageToUser(const QString &text, const ErrorHandler::Sy
     notification->sendEvent();
 }
 
-void ErrorHandler::handleNewAccount(const Tp::AccountPtr& account)
+void ErrorHandler::onNewAccount(const Tp::AccountPtr& account)
 {
     connect(account.data(), SIGNAL(connectionStatusChanged(Tp::ConnectionStatus)),
-            this, SLOT(handleErrors(Tp::ConnectionStatus)));
+            this, SLOT(onConnectionStatusChanged(Tp::ConnectionStatus)));
 }
diff --git a/error-handler.h b/error-handler.h
index 5c033aa..60fe5e8 100644
--- a/error-handler.h
+++ b/error-handler.h
@@ -48,11 +48,11 @@ public:
     };
 
 private Q_SLOTS:
-    void handleErrors(const Tp::ConnectionStatus status);
-    void showMessageToUser(const QString &text, const ErrorHandler::SystemMessageType type);
-    void handleNewAccount(const Tp::AccountPtr &account);
+    void onConnectionStatusChanged(const Tp::ConnectionStatus status);
+    void onNewAccount(const Tp::AccountPtr &account);
 
 private:
+    void showMessageToUser(const QString &text, const ErrorHandler::SystemMessageType type);
     Tp::AccountManagerPtr m_accountManager;
 };
 

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list