[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:08:53 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=7864e97

The following commit has been merged in the master branch:
commit 7864e974637ec0ab72ec770fd3ebe6bedf4ffdf8
Author: Martin Klapetek <mklapetek at kde.org>
Date:   Thu Jun 4 20:11:23 2015 +0200

    [kaccounts] Create new SignOn::Identity with new KAccount
---
 kaccounts/kaccounts-ktp-plugin.cpp | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/kaccounts/kaccounts-ktp-plugin.cpp b/kaccounts/kaccounts-ktp-plugin.cpp
index 409b4cb..bbdd8c4 100644
--- a/kaccounts/kaccounts-ktp-plugin.cpp
+++ b/kaccounts/kaccounts-ktp-plugin.cpp
@@ -43,6 +43,8 @@
 #include <Accounts/Manager>
 #include <Accounts/Account>
 #include <Accounts/AccountService>
+#include <SignOn/IdentityInfo>
+#include <SignOn/Identity>
 
 #include <KAccounts/getcredentialsjob.h>
 #include <KAccounts/core.h>
@@ -198,6 +200,25 @@ void KAccountsKTpPlugin::onStorageProviderRetrieved(Tp::PendingOperation *op)
         }
     }
 
+    SignOn::IdentityInfo info;
+    info.setUserName(account->nickname());
+    // TODO? Query for the current password and store directly?
+    // info.setSecret(secret);
+    info.setCaption(account->nickname());
+    info.setAccessControlList(QStringList(QLatin1String("*")));
+    info.setType(SignOn::IdentityInfo::Application);
+
+    SignOn::Identity *identity = SignOn::Identity::newIdentity(info, this);
+
+    if (!identity) {
+        qWarning() << "Unable to create new SignOn::Identity, aborting...";
+        d->derefMigrationCount();
+        return;
+    }
+
+    identity->storeCredentials(info);
+
+    kaccount->setCredentialsId(identity->id());
     kaccount->sync();
     QObject::connect(kaccount, &Accounts::Account::synced, this, &KAccountsKTpPlugin::onAccountSynced);
 }

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list