[SCM] ktp-auth-handler packaging branch, master, updated. debian/15.12.1-2-282-g080758e

Maximiliano Curia maxy at moszumanska.debian.org
Fri May 27 23:59:11 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-auth-handler.git;a=commitdiff;h=7a46640

The following commit has been merged in the master branch:
commit 7a46640181228cb81765cf4621076d7995744d36
Author: Àlex Fiestas <afiestas at kde.org>
Date:   Fri Jun 7 14:13:26 2013 +0200

    Update version of GetCredentialsJob
    
    I hope we won't need to copypaste code anymore in a few weeks (or a month)
    but for now we have to.
    
    I will keep it update.
---
 getcredentialsjob.cpp | 31 ++++++++++++++++++-------------
 getcredentialsjob.h   |  5 -----
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/getcredentialsjob.cpp b/getcredentialsjob.cpp
index 5ef5c6a..f540a60 100644
--- a/getcredentialsjob.cpp
+++ b/getcredentialsjob.cpp
@@ -18,14 +18,14 @@
 
 #include "getcredentialsjob.h"
 
-#include <QtCore/QDebug>
-
 #include <Accounts/Manager>
 #include <Accounts/Account>
 #include <Accounts/AccountService>
 
 #include <SignOn/Identity>
 
+#include <KDebug>
+
 GetCredentialsJob::GetCredentialsJob(const Accounts::AccountId& id, QObject* parent)
 : KJob(parent)
 , m_id(id)
@@ -46,12 +46,18 @@ void GetCredentialsJob::setServiceType(const QString& serviceType)
 
 void GetCredentialsJob::getCredentials()
 {
-    Accounts::Account* acc = m_manager->account(m_id);
+    Accounts::Account *acc = m_manager->account(m_id);
+    if (!acc) {
+        setError(-1);
+        setErrorText("Could not find account");
+        emitResult();
+        return;
+    }
     Accounts::AccountService *service = new Accounts::AccountService(acc, m_manager->service(m_serviceType), this);
 
     Accounts::AuthData authData = service->authData();
     m_authData = authData.parameters();
-    SignOn::Identity* identity = SignOn::Identity::existingIdentity(acc->credentialsId(), this);
+    SignOn::Identity* identity = SignOn::Identity::existingIdentity(authData.credentialsId(), this);
 
     if (!identity) {
         setError(-1);
@@ -59,7 +65,7 @@ void GetCredentialsJob::getCredentials()
         emitResult();
         return;
     }
-    
+
     QPointer<SignOn::AuthSession> authSession = identity->createSession(authData.method());
 
     connect(authSession, SIGNAL(response(SignOn::SessionData)),
@@ -67,25 +73,24 @@ void GetCredentialsJob::getCredentials()
     connect(authSession, SIGNAL(error(SignOn::Error)),
             SLOT(sessionError(SignOn::Error)));
 
-    qDebug() << authData.parameters();
-    qDebug() << authData.mechanism();
+    kDebug() << authData.parameters();
+    kDebug() << authData.mechanism();
     authSession->process(authData.parameters(), authData.mechanism());
 }
 
-void GetCredentialsJob::info(const SignOn::IdentityInfo& info)
-{
-}
-
 void GetCredentialsJob::sessionResponse(const SignOn::SessionData& data)
 {
-    qDebug() << data.toMap();
+    kDebug() << data.toMap();
     m_sessionData = data;
     emitResult();
 }
 
 void GetCredentialsJob::sessionError(const SignOn::Error& error)
 {
-    qDebug() << error.message();
+    kDebug() << error.message();
+    setError(-1);
+    setErrorText(error.message());
+    emitResult();
 }
 
 Accounts::AccountId GetCredentialsJob::accountId() const
diff --git a/getcredentialsjob.h b/getcredentialsjob.h
index 30b2178..92cf152 100644
--- a/getcredentialsjob.h
+++ b/getcredentialsjob.h
@@ -30,7 +30,6 @@ namespace Accounts {
 };
 namespace SignOn {
     class Error;
-    class IdentityInfo;
 };
 
 class GetCredentialsJob : public KJob
@@ -45,12 +44,8 @@ public:
     QVariantMap credentialsData() const;
     Accounts::AccountId accountId() const;
 
-Q_SIGNALS:
-    void gotCredentials(const SignOn::SessionData& data);
-
 private Q_SLOTS:
     void getCredentials();
-    void info(const SignOn::IdentityInfo &info);
     void sessionResponse(const SignOn::SessionData &data);
     void sessionError(const SignOn::Error &error);
 

-- 
ktp-auth-handler packaging



More information about the pkg-kde-commits mailing list