Debian Codegraph @

online-accounts/lib/qml/Lomiri/OnlineAccounts/authentication_data.cpp

raw symbols SCIP
1 /*
2 * This file is part of OnlineAccountsModule
3 *
4 * Copyright (C) 2015 Canonical Ltd.
5 *
6 * Contact: Alberto Mardegan <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License version 3, as
10 * published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranties of
14 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "authentication_data.h"
22
23 #include <LomiriOnlineAccounts/PendingCall>
24 #include <QDebug>
25
26 QVariantMap replyToMap(const OnlineAccounts::PendingCall &call)
27 {
28 OnlineAccounts::AuthenticationReply reply(call);
29 return reply.data();
30 }
31
32 OnlineAccounts::AuthenticationData
33 authenticationDataFromMap(const QVariantMap &params,
34 OnlineAccounts::AuthenticationMethod method)
35 {
36 OnlineAccounts::AuthenticationData data(method);
37 QVariantMap cleanedParams(params);
38 data.setInteractive(params.value("interactive", true).toBool());
39 if (params["invalidateCachedReply"].toBool()) {
40 data.invalidateCachedReply();
41 }
42 cleanedParams.remove("interactive");
43 cleanedParams.remove("invalidateCachedReply");
44 data.setParameters(cleanedParams);
45 return data;
46 }