signon 8.54

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

signonsessioncoretools.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of signon
3 *
4 * Copyright (C) 2009-2011 Nokia Corporation.
5 *
6 * Contact: Aurel Popirtac <ext-aurel.popirtac@nokia.com>
7 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * version 2.1 as published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24 #include "signonsessioncoretools.h"
25
26 #include <QDebug>
27 #include "signond-common.h"
28
29 using namespace SignonDaemonNS;
30
31 QVariantMap SignonDaemonNS::mergeVariantMaps(const QVariantMap &map1,
32 const QVariantMap &map2)
33 {
34 if (map1.isEmpty()) return map2;
35 if (map2.isEmpty()) return map1;
36
37 QVariantMap map = map1;
38 //map2 values will overwrite map1 values for the same keys.
39 QMapIterator<QString, QVariant> it(map2);
40 while (it.hasNext()) {
41 it.next();
42 if (map.contains(it.key()))
43 map.remove(it.key());
44 }
45 return map.unite(map2);
46 }
47
48 /* --------------------- StoreOperation ---------------------- */
49
50 StoreOperation::StoreOperation(const StoreType type):
51 m_storeType(type)
52 {
53 }
54
55 StoreOperation::StoreOperation(const StoreOperation &src):
56 m_storeType(src.m_storeType),
57 m_info(src.m_info),
58 m_authMethod(src.m_authMethod),
59 m_blobData(src.m_blobData)
60 {
61 }
62
63 StoreOperation::~StoreOperation()
64 {
65 }
66
67 /* --------------------- RequestData ---------------------- */
68
69 RequestData::RequestData(const QDBusConnection &conn,
70 const QDBusMessage &msg,
71 const QVariantMap &params,
72 const QString &mechanism,
73 const QString &cancelKey):
74 m_conn(conn),
75 m_msg(msg),
76 m_params(params),
77 m_mechanism(mechanism),
78 m_cancelKey(cancelKey)
79 {
80 }
81
82 RequestData::RequestData(const RequestData &other):
83 m_conn(other.m_conn),
84 m_msg(other.m_msg),
85 m_params(other.m_params),
86 m_mechanism(other.m_mechanism),
87 m_cancelKey(other.m_cancelKey)
88 {
89 }
90
91 RequestData::~RequestData()
92 {
93 }
signonsessioncoretools.h
SignonDaemonNS::RequestData::RequestData
RequestData(const QDBusConnection &conn, const QDBusMessage &msg, const QVariantMap &params, const QString &mechanism, const QString &cancelKey)
Definition: signonsessioncoretools.cpp:69
SignonDaemonNS::StoreOperation
Describes a credentials store operatation.
Definition: signonsessioncoretools.h:48
signond-common.h
SignonDaemonNS::StoreOperation::~StoreOperation
~StoreOperation()
Definition: signonsessioncoretools.cpp:63
SignonDaemonNS::StoreOperation::StoreType
StoreType
Definition: signonsessioncoretools.h:49
SignonDaemonNS::RequestData::~RequestData
~RequestData()
Definition: signonsessioncoretools.cpp:91
SignonDaemonNS::mergeVariantMaps
QVariantMap mergeVariantMaps(const QVariantMap &map1, const QVariantMap &map2)
Helper method which unites two variant maps.
Definition: signonsessioncoretools.cpp:31
SignonDaemonNS::StoreOperation::StoreOperation
StoreOperation(const StoreType type)
Definition: signonsessioncoretools.cpp:50
SignonDaemonNS::RequestData
Request data.
Definition: signonsessioncoretools.h:71