[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kaccounts-providers] jobs: Add support for runnerid and configure only once
From:       Alex Fiestas <afiestas () kde ! org>
Date:       2015-10-15 21:01:26
Message-ID: E1ZmpeQ-0000yK-PG () scm ! kde ! org
[Download RAW message or body]

Git commit 50fc74b6e0bd97684ebe66362036a15d2641b26b by Alex Fiestas.
Committed on 24/05/2012 at 12:31.
Pushed by mklapetek into branch 'master'.

Add support for runnerid and configure only once

M  +10   -7    jobs/ocreatecontact.cpp

http://commits.kde.org/kaccounts-providers/50fc74b6e0bd97684ebe66362036a15d2641b26b

diff --git a/jobs/ocreatecontact.cpp b/jobs/ocreatecontact.cpp
index a3707cc..0a6620e 100644
--- a/jobs/ocreatecontact.cpp
+++ b/jobs/ocreatecontact.cpp
@@ -115,9 +115,6 @@ void OCreateContact::resourceCreated(KJob* job)
     settings->setDisplayName(m_config.name());
     settings->setSettingsVersion(2);
 
-    settings->writeConfig();
-    agent.reconfigure();
-
     WId windowId = 0;
     if (qApp->activeWindow()) {
         windowId = qApp->activeWindow()->winId();
@@ -130,9 +127,15 @@ void OCreateContact::resourceCreated(KJob* job)
         return;
     }
 
-    QString password;
+    QString password, prefix;
+    if (m_config.readEntry("type", "owncloud") == "runnerid") {
+        prefix = "runnerid";
+    } else {
+        prefix = "owncloud";
+    }
+
     wallet->setFolder("WebAccounts");
-    wallet->readPassword("owncloud-" + m_config.name(), password);
+    wallet->readPassword(prefix + "-" + m_config.name(), password);
 
     QString key (agent.identifier());
     key.append(",$default$");
@@ -140,7 +143,8 @@ void OCreateContact::resourceCreated(KJob* job)
     wallet->setFolder(Wallet::PasswordFolder());
     wallet->writePassword(key, password);
 
-    agent.synchronize();
+    settings->writeConfig();
+    agent.reconfigure();
 
     emitResult();
 }
@@ -166,7 +170,6 @@ void OCreateContact::useCalendarResource()
     }
 
     instance.reconfigure();
-    instance.synchronize();
 
     emitResult();
 }
\ No newline at end of file

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic