Debian Codegraph @

online-accounts-plugins/lib/LomiriOnlineAccountsPlugin/application-manager.cpp

raw symbols SCIP
1 /*
2 * Copyright (C) 2013 Canonical Ltd.
3 *
4 * Contact: Alberto Mardegan <[email protected]>
5 *
6 * This file is part of liblomiri-online-accounts-plugin
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 3, as published
10 * 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 General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "account-manager.h"cxx . . $ `<file>/online-accounts-plugins/lib/LomiriOnlineAccountsPlugin/account-manager.h`/
22 #include "application-manager.h"cxx . . $ `<file>/online-accounts-plugins/lib/LomiriOnlineAccountsPlugin/application-manager.h`/
23
24 #include <QDebug>
25 #include <QDomDocument>
26 #include <QDomElement>
27 #include <QFile>
28 #include <QSettings>
29 #include <QStandardPaths>
30
31 using namespace OnlineAccountsUi;
32
33 ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# *ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::m_instancecxx . . $ OnlineAccountsUi/ApplicationManager#m_instance. = 0;
34
35 namespace OnlineAccountsUicxx . . $ OnlineAccountsUi/ {
36 class ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#
37 {
38 public:
39 ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#ApplicationManagerPrivate(49f6e7a06ebc5aa8).();
40
41 QStringcxx . . $ QString# applicationProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationProfile(5555d9024dcf93fb).(const QStringcxx . . $ QString# &applicationId) const;
42 bool applicationMatchesProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationMatchesProfile(392fd0e0419680d6).(const Accountscxx . . $ Accounts/::Applicationcxx . . $ Accounts/Application# &application,
43 const QStringcxx . . $ QString# &profile) const;
44 static QStringcxx . . $ QString# stripVersioncxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#stripVersion(fd988a2ab94d906b).(const QStringcxx . . $ QString# &appId);
45 static QStringcxx . . $ QString# displayIdcxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#displayId(fd988a2ab94d906b).(const QStringcxx . . $ QString# &appId);
46 };
47 } // namespace
48
49 ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#::ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#ApplicationManagerPrivate(49f6e7a06ebc5aa8).()
50 {
51 }
52
53 QStringcxx . . $ QString# ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#::applicationProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationProfile(5555d9024dcf93fb).(const QStringcxx . . $ QString# &applicationId) const
54 {
55 /* We need to load the XML file and look for the "profile" element. The
56 * file lookup would become unnecessary if a domDocument() method were
57 * added to the Accounts::Application class. */
58 QStringcxx . . $ QString# localShare =
59 QStandardPathscxx . . $ QStandardPaths#::writableLocationcxx . . $ QStandardPaths#writableLocation(7d8b34fbb6a9c1bf).(QStandardPathscxx . . $ QStandardPaths#::GenericDataLocationcxx . . $ QStandardPaths#GenericDataLocation.);
60 QFilecxx . . $ QFile# filecxx . . $ QFile#QFile(3520e46b33348bf6).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1/accounts/applications/%2.application").
61 argcxx . . $ QString#arg(bc823072288cbbb5).(localShare).argcxx . . $ QString#arg(bc823072288cbbb5).(applicationId));
62 if (!file.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QIODevice#::ReadOnlycxx . . $ QIODevice#ReadOnly. |cxx . . $ `operator|`(c9e45f682471e48d). QIODevicecxx . . $ QIODevice#::Textcxx . . $ QIODevice#Text.)) {
63 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "file not found:" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). file.fileNamecxx . . $ QFile#fileName(6ef7b6c27b00b43d).();
64 /* libaccounts would fall back to looking into /usr/share/accounts/,
65 * but we know that .click packages don't install files in there, and
66 * currently the profile information is only attached to click
67 * applications. Therefore, if we don't find the file in
68 * ~/.local/share/accounts/, we can assume we won't find the profile
69 * info anywhere.
70 */
71 return QStringcxx . . $ QString#QString(ced63f7c635d850d).();
72 }
73 QDomDocumentcxx . . $ QDomDocument# doccxx . . $ QDomDocument#QDomDocument(49f6e7a06ebc5aa8).;
74 doc.setContentcxx . . $ QDomDocument#setContent(561bc04b7005bb24).(&file);
75 const QDomElementcxx . . $ QDomElement# root = doc.documentElementcxx . . $ QDomDocument#documentElement(654df8c29726cab1).();
76 return root.firstChildElementcxx . . $ QDomNode#firstChildElement(d563d9084a4b323c).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("profile")).textcxx . . $ QDomElement#text(6ef7b6c27b00b43d).();
77 }
78
79 bool ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#::applicationMatchesProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationMatchesProfile(392fd0e0419680d6).(const Accountscxx . . $ Accounts/::Applicationcxx . . $ Accounts/Application# &application,
80 const QStringcxx . . $ QString# &profile) const
81 {
82 /* We don't restrict unconfined apps. */
83 if (profile ==cxx . . $ `operator==`(5bc2975d2d751687). QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("unconfined")) return true;
84
85 /* It's a confined app. We must make sure that the applicationId it
86 * specified matches the apparmor profile.
87 */
88 QStringcxx . . $ QString# declaredProfile = applicationProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationProfile(5555d9024dcf93fb).(application.namecxx . . $ Accounts/Application#name(6ef7b6c27b00b43d).());
89 return declaredProfile ==cxx . . $ `operator==`(5bc2975d2d751687). profile;
90 }
91
92 QStringcxx . . $ QString# ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#::stripVersioncxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#stripVersion(fd988a2ab94d906b).(const QStringcxx . . $ QString# &appId)
93 {
94 QStringListcxx . . $ QStringList# components = appId.splitcxx . . $ QString#split(92030b8bf74e4227).('_'cxx . . $ QChar#QChar(f349c77f591a7878).);
95 if (components.countcxx . . $ QList#count(455f465bc33b4cdf).() != 3) return QStringcxx . . $ QString#QString(ced63f7c635d850d).();
96
97 /* Click packages have a profile of the form
98 * $name_$application_$version
99 * (see https://wiki.ubuntu.com/SecurityTeam/Specifications/ApplicationConfinement/Manifest#Click)
100 *
101 * We assume that this is a click package, and strip out the last part.
102 */
103 components.removeLastcxx . . $ QList#removeLast(49f6e7a06ebc5aa8).();
104 return components.joincxx . . $ QListSpecialMethods#join(227e33e1a3bf1f91).('_'cxx . . $ QChar#QChar(f349c77f591a7878).);
105 }
106
107 QStringcxx . . $ QString# ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#::displayIdcxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#displayId(fd988a2ab94d906b).(const QStringcxx . . $ QString# &appId)
108 {
109 QStringListcxx . . $ QStringList# components = appIdcxx . . $ QStringList#QStringList(6fe09f9fe6e0f503)..splitcxx . . $ QString#split(92030b8bf74e4227).('_'cxx . . $ QChar#QChar(f349c77f591a7878).).midcxx . . $ QList#mid(45fc363cae6a3705).(0, 2);
110 if (components.countcxx . . $ QList#count(455f465bc33b4cdf).() != 2) return appIdcxx . . $ QString#QString(132dd6869045752b).;
111
112 return components.joincxx . . $ QListSpecialMethods#join(227e33e1a3bf1f91).('/'cxx . . $ QChar#QChar(f349c77f591a7878).);
113 }
114
115 ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager# *ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::instancecxx . . $ OnlineAccountsUi/ApplicationManager#instance(e61827766a1125e9).()
116 {
117 if (!m_instancecxx . . $ OnlineAccountsUi/ApplicationManager#m_instance.) {
118 m_instancecxx . . $ OnlineAccountsUi/ApplicationManager#m_instance. = new ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#;
119 }
120
121 return m_instancecxx . . $ OnlineAccountsUi/ApplicationManager#m_instance.;
122 }
123
124 ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#ApplicationManager(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent):
125 QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent),
126 d_ptrcxx . . $ OnlineAccountsUi/ApplicationManager#d_ptr.(new ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#ApplicationManagerPrivate(49f6e7a06ebc5aa8).)
127 {
128 }
129
130 ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::~cxx . . $ OnlineAccountsUi/ApplicationManager#`~ApplicationManager`(ced63f7c635d850d).ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#()
131 {
132 delete d_ptrcxx . . $ OnlineAccountsUi/ApplicationManager#d_ptr.;
133 }
134
135 QVariantMapcxx . . $ QVariantMap# ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::applicationInfocxx . . $ OnlineAccountsUi/ApplicationManager#applicationInfo(d822f47b982b0b13).(const QStringcxx . . $ QString# &claimedAppId,
136 const QStringcxx . . $ QString# &profile)
137 {
138 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const ApplicationManager);
139
140 if (Q_UNLIKELYcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:247:11`!(profile.isEmpty())) return QVariantMapcxx . . $ QMap#QMap(ced63f7c635d850d).();
141
142 /* Special case: when the applicationId is "lomiri-system-settings", we don't
143 * require the existance of the .application file, because this request
144 * will always be about creating a new account. */
145 if (claimedAppId ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "lomiri-system-settings") {
146 QVariantMapcxx . . $ QVariantMap# appcxx . . $ QMap#QMap(ced63f7c635d850d).;
147 app.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("id"), claimedAppIdcxx . . $ QVariant#QVariant(3520e46b33348bf6).);
148 app.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("profile"), profilecxx . . $ QVariant#QVariant(3520e46b33348bf6).);
149 return appcxx . . $ QMap#QMap(28c642871a274d78).;
150 }
151
152 QStringcxx . . $ QString# applicationId = claimedAppIdcxx . . $ QString#QString(132dd6869045752b).;
153 Accountscxx . . $ Accounts/::Applicationcxx . . $ Accounts/Application# application =
154 AccountManagercxx . . $ OnlineAccountsUi/AccountManager#::instancecxx . . $ OnlineAccountsUi/AccountManager#instance(10dcba297537ffe).()->applicationcxx . . $ Accounts/Manager#application(867e189e0e2e5aa7).(applicationId);
155 if (!application.isValidcxx . . $ Accounts/Application#isValid(50ce9a9e25b4a850).()) {
156 application =cxx . . $ Accounts/Application#`operator=`(9f15070797a09704). applicationFromProfilecxx . . $ OnlineAccountsUi/ApplicationManager#applicationFromProfile(2395a26dc7c1e889).(profile);
157 applicationId =cxx . . $ QString#`operator=`(4f35bf974e7f8568). application.namecxx . . $ Accounts/Application#name(6ef7b6c27b00b43d).();
158 }
159
160 /* Make sure that the app is who it claims to be */
161 if (!d->applicationMatchesProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationMatchesProfile(392fd0e0419680d6).(application, profile)) {
162 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Given applicationId doesn't match profile";
163 return QVariantMapcxx . . $ QMap#QMap(ced63f7c635d850d).();
164 }
165
166 QVariantMapcxx . . $ QVariantMap# appcxx . . $ QMap#QMap(ced63f7c635d850d).;
167 app.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("id"), applicationIdcxx . . $ QVariant#QVariant(3520e46b33348bf6).);
168 app.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("displayId"), dcxx . . $ QVariant#QVariant(3520e46b33348bf6).->displayIdcxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#displayId(fd988a2ab94d906b).(applicationId));
169 app.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("displayName"), applicationcxx . . $ QVariant#QVariant(3520e46b33348bf6)..displayNamecxx . . $ Accounts/Application#displayName(6ef7b6c27b00b43d).());
170 app.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("icon"), applicationcxx . . $ QVariant#QVariant(3520e46b33348bf6)..iconNamecxx . . $ Accounts/Application#iconName(6ef7b6c27b00b43d).());
171 /* The applicationMatchesProfile() test above ensures that either the peer
172 * is unconfined, or the profile in the .application file matches the one
173 * we see from our peer.
174 * In the first case, what we really want is the profile from the
175 * .application file (if that's set), to cover the case where an unconfined
176 * process is asking authorization on behalf of a confined app. */
177 QStringcxx . . $ QString# targetProfile = d->applicationProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationProfile(5555d9024dcf93fb).(application.namecxx . . $ Accounts/Application#name(6ef7b6c27b00b43d).());
178 if (targetProfile.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) {
179 targetProfile =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). profile;
180 }
181 app.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("profile"), targetProfilecxx . . $ QVariant#QVariant(3520e46b33348bf6).);
182
183 /* List all the services supported by this application */
184 QVariantListcxx . . $ QVariantList# serviceIdscxx . . $ QList#QList(ced63f7c635d850d).;
185 Accountscxx . . $ Accounts/::ServiceListcxx . . $ Accounts/ServiceList# allServices =
186 AccountManagercxx . . $ OnlineAccountsUi/AccountManager#::instancecxx . . $ OnlineAccountsUi/AccountManager#instance(10dcba297537ffe).()->serviceListcxx . . $ Accounts/Manager#serviceList(afa5a1da79d6f492).();
187 Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(const Accounts::Service &service, allServices) {
188 if (!application.serviceUsagecxx . . $ Accounts/Application#serviceUsage(bda90266231d1911).(service).isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) {
189 serviceIds.appendcxx . . $ QList#append(77d9f17553126ecb).(servicecxx . . $ QVariant#QVariant(3520e46b33348bf6)..namecxx . . $ Accounts/Service#name(6ef7b6c27b00b43d).());
190 }
191 }
192 app.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("services"), serviceIdscxx . . $ QVariant#QVariant(2f4009bfc0c7e161).);
193
194 return appcxx . . $ QMap#QMap(28c642871a274d78).;
195 }
196
197 QVariantMapcxx . . $ QVariantMap# ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::providerInfocxx . . $ OnlineAccountsUi/ApplicationManager#providerInfo(b5169218cdb2f965).(const QStringcxx . . $ QString# &providerId) const
198 {
199 Accountscxx . . $ Accounts/::Providercxx . . $ Accounts/Provider# provider =
200 AccountManagercxx . . $ OnlineAccountsUi/AccountManager#::instancecxx . . $ OnlineAccountsUi/AccountManager#instance(10dcba297537ffe).()->providercxx . . $ Accounts/Manager#provider(9b65a80ff034fbb0).(providerId);
201 if (Q_UNLIKELYcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:247:11`!(!provider.isValid())) {
202 qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Invalid provider" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). providerId;
203 return QVariantMapcxx . . $ QMap#QMap(ced63f7c635d850d).();
204 }
205
206 QVariantMapcxx . . $ QVariantMap# infocxx . . $ QMap#QMap(ced63f7c635d850d).;
207 info.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("id"), providerIdcxx . . $ QVariant#QVariant(3520e46b33348bf6).);
208 info.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("displayName"), providercxx . . $ QVariant#QVariant(3520e46b33348bf6)..displayNamecxx . . $ Accounts/Provider#displayName(6ef7b6c27b00b43d).());
209 info.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("icon"), providercxx . . $ QVariant#QVariant(3520e46b33348bf6)..iconNamecxx . . $ Accounts/Provider#iconName(6ef7b6c27b00b43d).());
210 info.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("isSingleAccount"), providercxx . . $ QVariant#QVariant(b45ddcbc8423892c)..isSingleAccountcxx . . $ Accounts/Provider#isSingleAccount(50ce9a9e25b4a850).());
211
212 /* Get Ubuntu-specific information directly from the XML file */
213 const QDomDocumentcxx . . $ QDomDocument# doc = provider.domDocumentcxx . . $ Accounts/Provider#domDocument(d18178be4b98d736).();
214 QDomElementcxx . . $ QDomElement# root = doc.documentElementcxx . . $ QDomDocument#documentElement(654df8c29726cab1).();
215 info.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("profile"),
216 rootcxx . . $ QVariant#QVariant(3520e46b33348bf6)..firstChildElementcxx . . $ QDomNode#firstChildElement(d563d9084a4b323c).("profile"cxx . . $ QString#QString(85c52e162fed56f9).).textcxx . . $ QDomElement#text(6ef7b6c27b00b43d).());
217 info.insertcxx . . $ QMap#insert(929a1ed410fe8423).(QStringLiteralcxx . . $ `<external>/2817157206922689722/qstringliteral.h:65:9`!("package-dir"),
218 rootcxx . . $ QVariant#QVariant(3520e46b33348bf6)..firstChildElementcxx . . $ QDomNode#firstChildElement(d563d9084a4b323c).("package-dir"cxx . . $ QString#QString(85c52e162fed56f9).).textcxx . . $ QDomElement#text(6ef7b6c27b00b43d).());
219 return infocxx . . $ QMap#QMap(28c642871a274d78).;
220 }
221
222 QStringListcxx . . $ QStringList# ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::usefulProviderscxx . . $ OnlineAccountsUi/ApplicationManager#usefulProviders(e1dbd5c4feadc8f5).() const
223 {
224 AccountManagercxx . . $ OnlineAccountsUi/AccountManager# *manager = AccountManagercxx . . $ OnlineAccountsUi/AccountManager#::instancecxx . . $ OnlineAccountsUi/AccountManager#instance(10dcba297537ffe).();
225 Accountscxx . . $ Accounts/::ServiceListcxx . . $ Accounts/ServiceList# allServices = manager->serviceListcxx . . $ Accounts/Manager#serviceList(afa5a1da79d6f492).();
226 QStringListcxx . . $ QStringList# providerscxx . . $ QStringList#QStringList(ced63f7c635d850d).;
227 Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(const Accounts::Service &service, allServices) {
228 if (providers.containscxx . . $ QStringList#contains(8cce4688c16f48f3).(service.providercxx . . $ Accounts/Service#provider(6ef7b6c27b00b43d).())) continue;
229
230 if (!manager->applicationListcxx . . $ Accounts/Manager#applicationList(6d6ec52e5dbb854b).(service).isEmptycxx . . $ QList#isEmpty(3482b152b9333168).() ||
231 service.providercxx . . $ Accounts/Service#provider(6ef7b6c27b00b43d).() ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "ubuntuone") {
232 providers.appendcxx . . $ QList#append(77d9f17553126ecb).(service.providercxx . . $ Accounts/Service#provider(6ef7b6c27b00b43d).());
233 }
234 }
235 return providers;
236 }
237
238 QStringListcxx . . $ QStringList#
239 ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::addApplicationToAclcxx . . $ OnlineAccountsUi/ApplicationManager#addApplicationToAcl(75f30ff5959b637d).(const QStringListcxx . . $ QStringList# &acl,
240 const QStringcxx . . $ QString# &applicationId) const
241 {
242 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const ApplicationManager);
243
244 QStringListcxx . . $ QStringList# newAcl = acl;
245 QStringcxx . . $ QString# profile = d->applicationProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationProfile(5555d9024dcf93fb).(applicationId);
246 qDebugcxx . . $ `<external>/10450329605257866924/qlogging.h:164:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "profile of" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). applicationId <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). ":" <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). profile;
247 if (!profile.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) {
248 newAcl.appendcxx . . $ QList#append(77d9f17553126ecb).(profile);
249 }
250 return newAcl;
251 }
252
253 QStringListcxx . . $ QStringList#
254 ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::removeApplicationFromAclcxx . . $ OnlineAccountsUi/ApplicationManager#removeApplicationFromAcl(75f30ff5959b637d).(const QStringListcxx . . $ QStringList# &acl,
255 const QStringcxx . . $ QString# &applicationId) const
256 {
257 Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const ApplicationManager);
258
259 QStringcxx . . $ QString# profile = d->applicationProfilecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#applicationProfile(5555d9024dcf93fb).(applicationId);
260 if (profile.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) {
261 return acl;
262 }
263
264 QStringListcxx . . $ QStringList# newAclcxx . . $ QStringList#QStringList(ced63f7c635d850d).;
265 QStringcxx . . $ QString# unversionedProfile =
266 ApplicationManagerPrivatecxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#::stripVersioncxx . . $ OnlineAccountsUi/ApplicationManagerPrivate#stripVersion(fd988a2ab94d906b).(profile);
267 Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(const QString &app, acl) {
268 if (app !=cxx . . $ `operator!=`(5bc2975d2d751687). profile &&
269 (unversionedProfile.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() ||
270 !app.startsWithcxx . . $ QString#startsWith(8cce4688c16f48f3).(unversionedProfile))) {
271 newAcl.appendcxx . . $ QList#append(77d9f17553126ecb).(app);
272 }
273 }
274 return newAcl;
275 }
276
277 Accountscxx . . $ Accounts/::Applicationcxx . . $ Accounts/Application#
278 ApplicationManagercxx . . $ OnlineAccountsUi/ApplicationManager#::applicationFromProfilecxx . . $ OnlineAccountsUi/ApplicationManager#applicationFromProfile(2395a26dc7c1e889).(const QStringcxx . . $ QString# &profile)
279 {
280 /* If the profile is not a click package profile, we have no way of knowing
281 * what application it is. */
282 QStringListcxx . . $ QStringList# components = profile.splitcxx . . $ QString#split(92030b8bf74e4227).('_'cxx . . $ QChar#QChar(f349c77f591a7878).);
283 if (components.countcxx . . $ QList#count(455f465bc33b4cdf).() != 3) return Accountscxx . . $ Accounts/Application#Application(49f6e7a06ebc5aa8).::Applicationcxx . . $ Accounts/Application#();
284
285 /* First try to see if we can use the full profile as app ID; if not, strip
286 * out the version, and if that fails as well then use only the package
287 * name. */
288 AccountManagercxx . . $ OnlineAccountsUi/AccountManager# *manager = AccountManagercxx . . $ OnlineAccountsUi/AccountManager#::instancecxx . . $ OnlineAccountsUi/AccountManager#instance(10dcba297537ffe).();
289 Accountscxx . . $ Accounts/::Applicationcxx . . $ Accounts/Application# application = manager->applicationcxx . . $ Accounts/Manager#application(867e189e0e2e5aa7).(profile);
290 if (application.isValidcxx . . $ Accounts/Application#isValid(50ce9a9e25b4a850).()) return applicationcxx . . $ Accounts/Application#Application(bcbaf6c2fd20a2d6).;
291
292 QStringcxx . . $ QString# applicationId = components[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0] +cxx . . $ operator+(3d22f08efddf8107). "_" +cxx . . $ operator+(fab9b4f80031f353). components[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).1];
293 application =cxx . . $ Accounts/Application#`operator=`(9f15070797a09704). manager->applicationcxx . . $ Accounts/Manager#application(867e189e0e2e5aa7).(applicationId);
294 if (application.isValidcxx . . $ Accounts/Application#isValid(50ce9a9e25b4a850).()) return applicationcxx . . $ Accounts/Application#Application(bcbaf6c2fd20a2d6).;
295
296 return manager->applicationcxx . . $ Accounts/Manager#application(867e189e0e2e5aa7).(components[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]);
297 }