29 using namespace SignonDaemonNS;
32 const QVariantMap &map2)
34 if (map1.isEmpty())
return map2;
35 if (map2.isEmpty())
return map1;
37 QVariantMap map = map1;
39 QMapIterator<QString, QVariant> it(map2);
40 while (it.hasNext()) {
42 if (map.contains(it.key()))
45 return map.unite(map2);
56 m_storeType(src.m_storeType),
58 m_authMethod(src.m_authMethod),
59 m_blobData(src.m_blobData)
70 const QDBusMessage &msg,
71 const QVariantMap ¶ms,
72 const QString &mechanism,
73 const QString &cancelKey):
77 m_mechanism(mechanism),
78 m_cancelKey(cancelKey)
85 m_params(other.m_params),
86 m_mechanism(other.m_mechanism),
87 m_cancelKey(other.m_cancelKey)
103 AuthCoreCache::AuthCache::~AuthCache()
109 return (m_password.isEmpty() && m_blobData.isEmpty());
112 AuthCoreCache::AuthCoreCache(QObject *parent):
133 return m_cache.value(
id, 0);
138 if (cache == 0)
return;
142 if ((data != 0) && data->
isEmpty()) {
148 m_cache.insert(
id.first, cache);
149 m_cachingSessionsMethods[
id.first] =
AuthMethods() <<
id.second;
151 if (cache->m_username.isEmpty())
152 cache->m_username = data->m_username;
153 if (cache->m_password.isEmpty())
154 cache->m_password = data->m_password;
160 m_cache.insert(
id.first, cache);
162 AuthMethods cachingSessionsMethods = m_cachingSessionsMethods[
id.first];
163 if (!cachingSessionsMethods.contains(
id.second))
164 cachingSessionsMethods.append(
id.second);
172 AuthMethods authMethods = m_cachingSessionsMethods[
id.first];
173 authMethods.removeOne(
id.second);
174 if (authMethods.isEmpty()) {
175 delete m_cache.take(
id.first);
176 (void)m_cachingSessionsMethods.take(
id.first);
183 QList<IdentityId> keys = m_cache.keys();
185 delete m_cache.take(key);
187 m_cachingSessionsMethods.clear();