| 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 "account_model.h"cxx . . $ `<file>/online-accounts/lib/qml/Lomiri/OnlineAccounts/account_model.h`/ |
| 22 | |
| 23 | #include "account.h"cxx . . $ `<file>/online-accounts/lib/qml/Lomiri/OnlineAccounts/account.h`/ |
| 24 | #include "authentication_data.h"cxx . . $ `<file>/online-accounts/lib/qml/Lomiri/OnlineAccounts/authentication_data.h`/ |
| 25 | |
| 26 | #include <LomiriOnlineAccounts/Account>cxx . . $ `<file>/online-accounts/lib/qt/LomiriOnlineAccounts/Account`/ |
| 27 | #include <LomiriOnlineAccounts/AuthenticationData>cxx . . $ `<file>/online-accounts/lib/qt/LomiriOnlineAccounts/AuthenticationData`/ |
| 28 | #include <LomiriOnlineAccounts/Manager>cxx . . $ `<file>/online-accounts/lib/qt/LomiriOnlineAccounts/Manager`/ |
| 29 | #include <LomiriOnlineAccounts/PendingCall>cxx . . $ `<file>/online-accounts/lib/qt/LomiriOnlineAccounts/PendingCall`/ |
| 30 | #include <QDebug> |
| 31 | #include <QQmlEngine> |
| 32 | #include <QVariantMap> |
| 33 | #include <QtQml> |
| 34 | |
| 35 | using namespace OnlineAccountsModule; |
| 36 | |
| 37 | namespace OnlineAccountsModulecxx . . $ OnlineAccountsModule/ { |
| 38 | |
| 39 | class AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#: public QObjectcxx . . $ QObject# |
| 40 | { |
| 41 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 42 | Q_DECLARE_PUBLICcxx . . $ `<external>/15045578679651060896/qglobal.h:1172:9`!(AccountModel) |
| 43 | |
| 44 | public: |
| 45 | AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#AccountModelPrivate(8cd954cafd0477da).(AccountModelcxx . . $ OnlineAccountsModule/AccountModel# *q); |
| 46 | |
| 47 | void queueUpdatecxx . . $ OnlineAccountsModule/AccountModelPrivate#queueUpdate(49f6e7a06ebc5aa8).(); |
| 48 | Accountcxx . . $ OnlineAccountsModule/Account# *handleAccountcxx . . $ OnlineAccountsModule/AccountModelPrivate#handleAccount(fddc04bfb7577e0e).(OnlineAccountscxx . . $ OnlineAccounts/::Accountcxx . . $ OnlineAccounts/Account# *account); |
| 49 | |
| 50 | private Q_SLOTScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:92:10`!: |
| 51 | void updatecxx . . $ OnlineAccountsModule/AccountModelPrivate#update(49f6e7a06ebc5aa8).(); |
| 52 | void updateAccountListcxx . . $ OnlineAccountsModule/AccountModelPrivate#updateAccountList(49f6e7a06ebc5aa8).(); |
| 53 | void onAccountAvailablecxx . . $ OnlineAccountsModule/AccountModelPrivate#onAccountAvailable(992388887f278361).(OnlineAccountscxx . . $ OnlineAccounts/::Accountcxx . . $ OnlineAccounts/Account# *account); |
| 54 | void onAccessRequestFinishedcxx . . $ OnlineAccountsModule/AccountModelPrivate#onAccessRequestFinished(49f6e7a06ebc5aa8).(); |
| 55 | void onAccountValidChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#onAccountValidChanged(49f6e7a06ebc5aa8).(); |
| 56 | void onAccountChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#onAccountChanged(49f6e7a06ebc5aa8).(); |
| 57 | |
| 58 | private: |
| 59 | QHashcxx . . $ QHash#<int, QByteArraycxx . . $ QByteArray#> roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.; |
| 60 | OnlineAccountscxx . . $ OnlineAccounts/::Managercxx . . $ OnlineAccounts/Manager# *m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager.; |
| 61 | QListcxx . . $ QList#<Accountcxx . . $ OnlineAccountsModule/Account#*> m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts.; |
| 62 | QStringcxx . . $ QString# m_applicationIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationId.; |
| 63 | QStringcxx . . $ QString# m_serviceIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceId.; |
| 64 | bool m_isReadycxx . . $ OnlineAccountsModule/AccountModelPrivate#m_isReady.; |
| 65 | bool m_updateQueuedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_updateQueued.; |
| 66 | bool m_applicationIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationIdChanged.; |
| 67 | bool m_serviceIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceIdChanged.; |
| 68 | mutable AccountModelcxx . . $ OnlineAccountsModule/AccountModel# *q_ptrcxx . . $ OnlineAccountsModule/AccountModelPrivate#q_ptr.; |
| 69 | }; |
| 70 | |
| 71 | } // namespace |
| 72 | |
| 73 | AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#AccountModelPrivate(8cd954cafd0477da).(AccountModelcxx . . $ OnlineAccountsModule/AccountModel# *q): |
| 74 | QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(q), |
| 75 | m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager.(0), |
| 76 | m_isReadycxx . . $ OnlineAccountsModule/AccountModelPrivate#m_isReady.(false), |
| 77 | m_updateQueuedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_updateQueued.(true), // because componentComplete will be called |
| 78 | m_applicationIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationIdChanged.(false), |
| 79 | m_serviceIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceIdChanged.(false), |
| 80 | q_ptrcxx . . $ OnlineAccountsModule/AccountModelPrivate#q_ptr.(q) |
| 81 | { |
| 82 | roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.[cxx . . $ QHash#`operator[]`(bbd415b616967878).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::DisplayNameRolecxx . . $ OnlineAccountsModule/AccountModel#DisplayNameRole.] =cxx . . $ QByteArray#`operator=`(715145f812399bcb). "displayName"; |
| 83 | roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.[cxx . . $ QHash#`operator[]`(bbd415b616967878).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::ValidRolecxx . . $ OnlineAccountsModule/AccountModel#ValidRole.] =cxx . . $ QByteArray#`operator=`(715145f812399bcb). "valid"; |
| 84 | roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.[cxx . . $ QHash#`operator[]`(bbd415b616967878).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::AccountIdRolecxx . . $ OnlineAccountsModule/AccountModel#AccountIdRole.] =cxx . . $ QByteArray#`operator=`(715145f812399bcb). "accountId"; |
| 85 | roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.[cxx . . $ QHash#`operator[]`(bbd415b616967878).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::ServiceIdRolecxx . . $ OnlineAccountsModule/AccountModel#ServiceIdRole.] =cxx . . $ QByteArray#`operator=`(715145f812399bcb). "serviceId"; |
| 86 | roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.[cxx . . $ QHash#`operator[]`(bbd415b616967878).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::AuthenticationMethodRolecxx . . $ OnlineAccountsModule/AccountModel#AuthenticationMethodRole.] =cxx . . $ QByteArray#`operator=`(715145f812399bcb). "authenticationMethod"; |
| 87 | roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.[cxx . . $ QHash#`operator[]`(bbd415b616967878).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::SettingsRolecxx . . $ OnlineAccountsModule/AccountModel#SettingsRole.] =cxx . . $ QByteArray#`operator=`(715145f812399bcb). "settings"; |
| 88 | roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.[cxx . . $ QHash#`operator[]`(bbd415b616967878).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::AccountRolecxx . . $ OnlineAccountsModule/AccountModel#AccountRole.] =cxx . . $ QByteArray#`operator=`(715145f812399bcb). "account"; |
| 89 | roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.[cxx . . $ QHash#`operator[]`(bbd415b616967878).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::ServiceRolecxx . . $ OnlineAccountsModule/AccountModel#ServiceRole.] =cxx . . $ QByteArray#`operator=`(715145f812399bcb). "service"; |
| 90 | } |
| 91 | |
| 92 | void AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::queueUpdatecxx . . $ OnlineAccountsModule/AccountModelPrivate#queueUpdate(49f6e7a06ebc5aa8).() |
| 93 | { |
| 94 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(AccountModel); |
| 95 | |
| 96 | if (m_updateQueuedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_updateQueued.) return; |
| 97 | |
| 98 | m_updateQueuedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_updateQueued. = true; |
| 99 | QMetaObjectcxx . . $ QMetaObject#::invokeMethodcxx . . $ QMetaObject#invokeMethod(e68f8f4d8ced89c3).(this, "update", Qtcxx . . $ Qt/::QueuedConnectioncxx . . $ Qt/QueuedConnection.); |
| 100 | |
| 101 | if (m_isReadycxx . . $ OnlineAccountsModule/AccountModelPrivate#m_isReady.) { |
| 102 | m_isReadycxx . . $ OnlineAccountsModule/AccountModelPrivate#m_isReady. = false; |
| 103 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! q->isReadyChangedcxx . . $ OnlineAccountsModule/AccountModel#isReadyChanged(49f6e7a06ebc5aa8).(); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::updateAccountListcxx . . $ OnlineAccountsModule/AccountModelPrivate#updateAccountList(49f6e7a06ebc5aa8).() |
| 108 | { |
| 109 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(AccountModel); |
| 110 | |
| 111 | m_serviceIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceIdChanged. = false; |
| 112 | auto accountObjects = m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager.->availableAccountscxx . . $ OnlineAccounts/Manager#availableAccounts(18c39168d70e83cc).(m_serviceIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceId.); |
| 113 | q->beginResetModelcxx . . $ QAbstractItemModel#beginResetModel(49f6e7a06ebc5aa8).(); |
| 114 | m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..clearcxx . . $ QList#clear(49f6e7a06ebc5aa8).(); |
| 115 | Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(OnlineAccounts::Account *account, accountObjects) { |
| 116 | handleAccountcxx . . $ OnlineAccountsModule/AccountModelPrivate#handleAccount(fddc04bfb7577e0e).(account); |
| 117 | } |
| 118 | q->endResetModelcxx . . $ QAbstractItemModel#endResetModel(49f6e7a06ebc5aa8).(); |
| 119 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! q->accountListChangedcxx . . $ OnlineAccountsModule/AccountModel#accountListChanged(49f6e7a06ebc5aa8).(); |
| 120 | |
| 121 | m_isReadycxx . . $ OnlineAccountsModule/AccountModelPrivate#m_isReady. = true; |
| 122 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! q->isReadyChangedcxx . . $ OnlineAccountsModule/AccountModel#isReadyChanged(49f6e7a06ebc5aa8).(); |
| 123 | } |
| 124 | |
| 125 | Accountcxx . . $ OnlineAccountsModule/Account# *AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::handleAccountcxx . . $ OnlineAccountsModule/AccountModelPrivate#handleAccount(fddc04bfb7577e0e).(OnlineAccountscxx . . $ OnlineAccounts/::Accountcxx . . $ OnlineAccounts/Account# *account) |
| 126 | { |
| 127 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(AccountModel); |
| 128 | |
| 129 | /* First, check if the account is already handled */ |
| 130 | Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(Account *a, m_accounts) { |
| 131 | if (account == a->internalObjectcxx . . $ OnlineAccountsModule/Account#internalObject(2cf67f3f9da842b4).()) { |
| 132 | return a; |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | QQmlEnginecxx . . $ QQmlEngine# *engine = qmlEnginecxx . . $ QtQml/qmlEngine(48d7b7cdcf102340).(q); |
| 137 | Accountcxx . . $ OnlineAccountsModule/Account# *a = new Accountcxx . . $ OnlineAccountsModule/Account#Account(401d2a618a30041e).(account, engine, this); |
| 138 | QQmlEnginecxx . . $ QQmlEngine#::setObjectOwnershipcxx . . $ QQmlEngine#setObjectOwnership(5a8be69107b68178).(a, QQmlEnginecxx . . $ QQmlEngine#::CppOwnershipcxx . . $ QQmlEngine#CppOwnership.); |
| 139 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(a, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(validChanged()), |
| 140 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onAccountValidChanged())); |
| 141 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(a, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(accountChanged()), |
| 142 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onAccountChanged())); |
| 143 | m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..appendcxx . . $ QList#append(77d9f17553126ecb).(a); |
| 144 | return a; |
| 145 | } |
| 146 | |
| 147 | void AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::updatecxx . . $ OnlineAccountsModule/AccountModelPrivate#update(49f6e7a06ebc5aa8).() |
| 148 | { |
| 149 | m_updateQueuedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_updateQueued. = false; |
| 150 | |
| 151 | if (m_applicationIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationId..isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) { |
| 152 | QStringListcxx . . $ QStringList# parts = QStringcxx . . $ QString#::fromUtf8cxx . . $ QString#fromUtf8(4e15edac36d215be).(qgetenvcxx . . $ qgetenv(531409eeffcde449).("APP_ID")).splitcxx . . $ QString#split(92030b8bf74e4227).('_'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 153 | if (parts.countcxx . . $ QList#count(455f465bc33b4cdf).() == 3) { |
| 154 | m_applicationIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationId. =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringListcxx . . $ QStringList#QStringList(6fe09f9fe6e0f503).(parts.midcxx . . $ QList#mid(45fc363cae6a3705).(0, 2)).joincxx . . $ QListSpecialMethods#join(227e33e1a3bf1f91).('_'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 155 | m_applicationIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationIdChanged. = true; |
| 156 | } else { |
| 157 | qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Lomiri.OnlineAccounts: No APP_ID defined " |
| 158 | "and no applicationId given!"; |
| 159 | return; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | if (m_applicationIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationIdChanged.) { |
| 164 | delete m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager.; |
| 165 | m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager. = new OnlineAccountscxx . . $ OnlineAccounts/::Managercxx . . $ OnlineAccounts/Manager#(m_applicationIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationId.); |
| 166 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager., SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(ready()), |
| 167 | this, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(updateAccountList())); |
| 168 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager., |
| 169 | SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(accountAvailable(OnlineAccounts::Account*)), |
| 170 | this, |
| 171 | SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onAccountAvailable(OnlineAccounts::Account*))); |
| 172 | m_applicationIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationIdChanged. = false; |
| 173 | } |
| 174 | |
| 175 | if (m_serviceIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceIdChanged. && m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager.->isReadycxx . . $ OnlineAccounts/Manager#isReady(50ce9a9e25b4a850).()) { |
| 176 | updateAccountListcxx . . $ OnlineAccountsModule/AccountModelPrivate#updateAccountList(49f6e7a06ebc5aa8).(); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | void AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::onAccountAvailablecxx . . $ OnlineAccountsModule/AccountModelPrivate#onAccountAvailable(992388887f278361).(OnlineAccountscxx . . $ OnlineAccounts/::Accountcxx . . $ OnlineAccounts/Account# *account) |
| 181 | { |
| 182 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(AccountModel); |
| 183 | |
| 184 | if (!m_serviceIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceId..isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() && account->serviceIdcxx . . $ OnlineAccounts/Account#serviceId(6ef7b6c27b00b43d).() !=cxx . . $ `operator!=`(5bc2975d2d751687). m_serviceIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceId.) { |
| 185 | // ignore this account |
| 186 | return; |
| 187 | } |
| 188 | |
| 189 | int index = m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 190 | q->beginInsertRowscxx . . $ QAbstractItemModel#beginInsertRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), index, index); |
| 191 | handleAccountcxx . . $ OnlineAccountsModule/AccountModelPrivate#handleAccount(fddc04bfb7577e0e).(account); |
| 192 | q->endInsertRowscxx . . $ QAbstractItemModel#endInsertRows(49f6e7a06ebc5aa8).(); |
| 193 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! q->accountListChangedcxx . . $ OnlineAccountsModule/AccountModel#accountListChanged(49f6e7a06ebc5aa8).(); |
| 194 | } |
| 195 | |
| 196 | void AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::onAccessRequestFinishedcxx . . $ OnlineAccountsModule/AccountModelPrivate#onAccessRequestFinished(49f6e7a06ebc5aa8).() |
| 197 | { |
| 198 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(AccountModel); |
| 199 | |
| 200 | auto watcher = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<OnlineAccountscxx . . $ OnlineAccounts/::PendingCallWatchercxx . . $ OnlineAccounts/PendingCallWatcher#*>(sendercxx . . $ QObject#sender(2dbb680a34285c44).()); |
| 201 | |
| 202 | OnlineAccountscxx . . $ OnlineAccounts/::RequestAccessReplycxx . . $ OnlineAccounts/RequestAccessReply# replycxx . . $ OnlineAccounts/RequestAccessReply#RequestAccessReply(8feb05cfa3fd417d).(*watcher); |
| 203 | QVariantMapcxx . . $ QVariantMap# accountDatacxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 204 | QVariantMapcxx . . $ QVariantMap# authenticationDatacxx . . $ QMap#QMap(ced63f7c635d850d).; |
| 205 | if (reply.hasErrorcxx . . $ OnlineAccounts/RequestAccessReply#hasError(50ce9a9e25b4a850).()) { |
| 206 | accountData[cxx . . $ QMap#`operator[]`(bbd415b616967878)."errorCode"cxx . . $ QString#QString(85c52e162fed56f9).] =cxx . . $ QVariant#`operator=`(79a68221451e88b7). replycxx . . $ QVariant#QVariant(d4f767463ce0a6b3)..errorcxx . . $ OnlineAccounts/RequestAccessReply#error(b1aaa45c8f119b6a).().codecxx . . $ OnlineAccounts/Error#code(89328546d36c98d).(); |
| 207 | accountData[cxx . . $ QMap#`operator[]`(bbd415b616967878)."errorText"cxx . . $ QString#QString(85c52e162fed56f9).] =cxx . . $ QVariant#`operator=`(79a68221451e88b7). replycxx . . $ QVariant#QVariant(3520e46b33348bf6)..errorcxx . . $ OnlineAccounts/RequestAccessReply#error(b1aaa45c8f119b6a).().textcxx . . $ OnlineAccounts/Error#text(6ef7b6c27b00b43d).(); |
| 208 | } else { |
| 209 | OnlineAccountscxx . . $ OnlineAccounts/::Accountcxx . . $ OnlineAccounts/Account# *account = reply.accountcxx . . $ OnlineAccounts/RequestAccessReply#account(1a34c49ae0727a36).(); |
| 210 | accountData[cxx . . $ QMap#`operator[]`(bbd415b616967878)."account"cxx . . $ QString#QString(85c52e162fed56f9).] =cxx . . $ QVariant#`operator=`(79a68221451e88b7). |
| 211 | QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(28ec88ac519b76da).<QObjectcxx . . $ QObject#*>(handleAccountcxx . . $ OnlineAccountsModule/AccountModelPrivate#handleAccount(fddc04bfb7577e0e).(account)); |
| 212 | authenticationData =cxx . . $ QMap#`operator=`(86243d55ea3d6313). replyToMapcxx . . $ replyToMap(259f5df199cf362f).(*watcher); |
| 213 | } |
| 214 | |
| 215 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! q->accessReplycxx . . $ OnlineAccountsModule/AccountModel#accessReply(381447dc75fa75e7).(accountData, authenticationData); |
| 216 | } |
| 217 | |
| 218 | void AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::onAccountValidChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#onAccountValidChanged(49f6e7a06ebc5aa8).() |
| 219 | { |
| 220 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(AccountModel); |
| 221 | |
| 222 | Accountcxx . . $ OnlineAccountsModule/Account# *account = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<Accountcxx . . $ OnlineAccountsModule/Account#*>(sendercxx . . $ QObject#sender(2dbb680a34285c44).()); |
| 223 | int i = m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..indexOfcxx . . $ QList#indexOf(fc79640c865a6596).(account); |
| 224 | if (Q_UNLIKELYcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:247:11`!(i < 0)) { |
| 225 | qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Got signal from unhandled account!"; |
| 226 | return; |
| 227 | } |
| 228 | |
| 229 | Q_ASSERTcxx . . $ `<external>/15045578679651060896/qglobal.h:859:13`!(!account->isValid()); |
| 230 | q->beginRemoveRowscxx . . $ QAbstractItemModel#beginRemoveRows(d1f44b3c3a3f9fa).(QModelIndexcxx . . $ QModelIndex#QModelIndex(ced63f7c635d850d).(), i, i); |
| 231 | QObjectcxx . . $ QObject#::disconnectcxx . . $ QObject#disconnect(cc30ff19c637f8ed).(account, 0, this, 0); |
| 232 | account->deleteLatercxx . . $ QObject#deleteLater(49f6e7a06ebc5aa8).(); |
| 233 | m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..removeAtcxx . . $ QList#removeAt(d4f767463ce0a6b3).(i); |
| 234 | q->endRemoveRowscxx . . $ QAbstractItemModel#endRemoveRows(49f6e7a06ebc5aa8).(); |
| 235 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! q->accountListChangedcxx . . $ OnlineAccountsModule/AccountModel#accountListChanged(49f6e7a06ebc5aa8).(); |
| 236 | } |
| 237 | |
| 238 | void AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#::onAccountChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#onAccountChanged(49f6e7a06ebc5aa8).() |
| 239 | { |
| 240 | Q_Qcxx . . $ `<external>/15045578679651060896/qglobal.h:1178:9`!(AccountModel); |
| 241 | |
| 242 | Accountcxx . . $ OnlineAccountsModule/Account# *account = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<Accountcxx . . $ OnlineAccountsModule/Account#*>(sendercxx . . $ QObject#sender(2dbb680a34285c44).()); |
| 243 | int i = m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..indexOfcxx . . $ QList#indexOf(fc79640c865a6596).(account); |
| 244 | if (Q_UNLIKELYcxx . . $ `<external>/4507883856836070869/qcompilerdetection.h:247:11`!(i < 0)) { |
| 245 | qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). "Got signal from unhandled account!"; |
| 246 | return; |
| 247 | } |
| 248 | |
| 249 | QModelIndexcxx . . $ QModelIndex# idx = q->indexcxx . . $ QAbstractListModel#index(37dbccf64c4e392).(i, 0); |
| 250 | q->dataChangedcxx . . $ QAbstractItemModel#dataChanged(ae8a85c811f0c28a).(idx, idx); |
| 251 | } |
| 252 | |
| 253 | /*! |
| 254 | * \qmltype AccountModel |
| 255 | * \inqmlmodule Lomiri.OnlineAccounts 2.0 |
| 256 | * \ingroup Lomiri |
| 257 | * \brief Model of available online accounts. |
| 258 | * |
| 259 | * The AccountModel lists all the accounts available to the application. |
| 260 | * \qml |
| 261 | * import QtQuick 2.0 |
| 262 | * import Lomiri.OnlineAccounts 2.0 |
| 263 | * |
| 264 | * ListView { |
| 265 | * model: AccountModel { |
| 266 | * applicationId: "myapp.developer_myapp" |
| 267 | * } |
| 268 | * delegate: Text { |
| 269 | * text: model.displayName |
| 270 | * } |
| 271 | * } |
| 272 | * \endqml |
| 273 | * |
| 274 | * The model defines the following roles: |
| 275 | * |
| 276 | * \list |
| 277 | * \li \c displayName is the name of the account (usually the user's login) |
| 278 | * \li \c accountId is a numeric ID for the account |
| 279 | * \li \c serviceId is a service identifier (e.g., "myapp.developer_myapp_google") |
| 280 | * \li \c authenticationMethod is the authentication method used on this |
| 281 | * account; \sa Account::authenticationMethod |
| 282 | * \li \c settings is a dictionary of the settings stored into the account |
| 283 | * \li \c account is the \l Account object |
| 284 | * \endlist |
| 285 | * |
| 286 | * \sa Account |
| 287 | */ |
| 288 | |
| 289 | AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::AccountModelcxx . . $ OnlineAccountsModule/AccountModel#AccountModel(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent): |
| 290 | QAbstractListModelcxx . . $ QAbstractListModel#(parent), |
| 291 | d_ptrcxx . . $ OnlineAccountsModule/AccountModel#d_ptr.(new AccountModelPrivatecxx . . $ OnlineAccountsModule/AccountModelPrivate#AccountModelPrivate(8cd954cafd0477da).(this)) |
| 292 | { |
| 293 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(modelReset()), |
| 294 | this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(countChanged())); |
| 295 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(rowsInserted(const QModelIndex &,int,int)), |
| 296 | this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(countChanged())); |
| 297 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(rowsRemoved(const QModelIndex &,int,int)), |
| 298 | this, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(countChanged())); |
| 299 | } |
| 300 | |
| 301 | AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::~cxx . . $ OnlineAccountsModule/AccountModel#`~AccountModel`(ced63f7c635d850d).AccountModelcxx . . $ OnlineAccountsModule/AccountModel#() |
| 302 | { |
| 303 | delete d_ptrcxx . . $ OnlineAccountsModule/AccountModel#d_ptr.; |
| 304 | } |
| 305 | |
| 306 | void AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::classBegincxx . . $ OnlineAccountsModule/AccountModel#classBegin(49f6e7a06ebc5aa8).() |
| 307 | { |
| 308 | } |
| 309 | |
| 310 | void AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::componentCompletecxx . . $ OnlineAccountsModule/AccountModel#componentComplete(49f6e7a06ebc5aa8).() |
| 311 | { |
| 312 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(AccountModel); |
| 313 | d->updatecxx . . $ OnlineAccountsModule/AccountModelPrivate#update(49f6e7a06ebc5aa8).(); |
| 314 | } |
| 315 | |
| 316 | /*! |
| 317 | * \qmlproperty bool AccountModel::ready |
| 318 | * |
| 319 | * Whether the model is up to date: retrieving the account list is an |
| 320 | * asynchronous operation, and therefore short delays are expected between |
| 321 | * changing one model parameter and receiving the updated account list. |
| 322 | * Applications should not rely on the model contents while this property is |
| 323 | * false. |
| 324 | */ |
| 325 | bool AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::isReadycxx . . $ OnlineAccountsModule/AccountModel#isReady(50ce9a9e25b4a850).() const |
| 326 | { |
| 327 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const AccountModel); |
| 328 | return d->m_isReadycxx . . $ OnlineAccountsModule/AccountModelPrivate#m_isReady.; |
| 329 | } |
| 330 | |
| 331 | /*! |
| 332 | * \qmlproperty string AccountModel::applicationId |
| 333 | * |
| 334 | * The short application identifier (that is, the \c APP_ID minus the version |
| 335 | * component) of the client. If not given, the identifier will be deduced from |
| 336 | * the APP_ID environment variable. |
| 337 | */ |
| 338 | void AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::setApplicationIdcxx . . $ OnlineAccountsModule/AccountModel#setApplicationId(3520e46b33348bf6).(const QStringcxx . . $ QString# &applicationId) |
| 339 | { |
| 340 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(AccountModel); |
| 341 | if (applicationId ==cxx . . $ `operator==`(5bc2975d2d751687). d->m_applicationIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationId.) return; |
| 342 | |
| 343 | d->m_applicationIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationId. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). applicationId; |
| 344 | d->m_applicationIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationIdChanged. = true; |
| 345 | d->queueUpdatecxx . . $ OnlineAccountsModule/AccountModelPrivate#queueUpdate(49f6e7a06ebc5aa8).(); |
| 346 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! applicationIdChangedcxx . . $ OnlineAccountsModule/AccountModel#applicationIdChanged(49f6e7a06ebc5aa8).(); |
| 347 | } |
| 348 | |
| 349 | QStringcxx . . $ QString# AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::applicationIdcxx . . $ OnlineAccountsModule/AccountModel#applicationId(6ef7b6c27b00b43d).() const |
| 350 | { |
| 351 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const AccountModel); |
| 352 | return dcxx . . $ QString#QString(132dd6869045752b).->m_applicationIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_applicationId.; |
| 353 | } |
| 354 | |
| 355 | /*! |
| 356 | * \qmlproperty string AccountModel::serviceId |
| 357 | * |
| 358 | * If this property is set, only accounts providing the given service will be |
| 359 | * returned. |
| 360 | */ |
| 361 | void AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::setServiceIdcxx . . $ OnlineAccountsModule/AccountModel#setServiceId(3520e46b33348bf6).(const QStringcxx . . $ QString# &serviceId) |
| 362 | { |
| 363 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(AccountModel); |
| 364 | if (serviceId ==cxx . . $ `operator==`(5bc2975d2d751687). d->m_serviceIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceId.) return; |
| 365 | |
| 366 | d->m_serviceIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceId. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). serviceId; |
| 367 | d->m_serviceIdChangedcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceIdChanged. = true; |
| 368 | d->queueUpdatecxx . . $ OnlineAccountsModule/AccountModelPrivate#queueUpdate(49f6e7a06ebc5aa8).(); |
| 369 | Q_EMITcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:95:10`! serviceIdChangedcxx . . $ OnlineAccountsModule/AccountModel#serviceIdChanged(49f6e7a06ebc5aa8).(); |
| 370 | } |
| 371 | |
| 372 | QStringcxx . . $ QString# AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::serviceIdcxx . . $ OnlineAccountsModule/AccountModel#serviceId(6ef7b6c27b00b43d).() const |
| 373 | { |
| 374 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const AccountModel); |
| 375 | return dcxx . . $ QString#QString(132dd6869045752b).->m_serviceIdcxx . . $ OnlineAccountsModule/AccountModelPrivate#m_serviceId.; |
| 376 | } |
| 377 | |
| 378 | /*! |
| 379 | * \qmlproperty list<Account> AccountModel::accountList |
| 380 | * |
| 381 | * List of accounts in the model. This list has exactly the same contents as |
| 382 | * the model data, and is provided as a property just as a convenience for |
| 383 | * those cases when a model is not required. |
| 384 | */ |
| 385 | QListcxx . . $ QList#<QObjectcxx . . $ QObject#*> AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::accountListcxx . . $ OnlineAccountsModule/AccountModel#accountList(adb747650fc59aad).() const |
| 386 | { |
| 387 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const AccountModel); |
| 388 | QListcxx . . $ QList#<QObjectcxx . . $ QObject#*> objectscxx . . $ QList#QList(ced63f7c635d850d).; |
| 389 | Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(Account *a, d->m_accounts) { |
| 390 | objects.appendcxx . . $ QList#append(77d9f17553126ecb).(a); |
| 391 | } |
| 392 | return objectscxx . . $ QList#QList(88d75cd4b19cb2d1).; |
| 393 | } |
| 394 | |
| 395 | QJSValuecxx . . $ QJSValue# AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::serviceListcxx . . $ OnlineAccountsModule/AccountModel#serviceList(cedfddd5dbefb84d).() const |
| 396 | { |
| 397 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const AccountModel); |
| 398 | QJSEnginecxx . . $ QJSEngine# *engine = qmlEnginecxx . . $ QtQml/qmlEngine(48d7b7cdcf102340).(this); |
| 399 | QJSValuecxx . . $ QJSValue# ret = engine->newArraycxx . . $ QJSEngine#newArray(3c8cb55ea242c97f).(); |
| 400 | if (!d->m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager.) return retcxx . . $ QJSValue#QJSValue(cffeadb2e55ad1c4).; |
| 401 | int i = 0; |
| 402 | Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(const auto &service, d->m_manager->availableServices()) { |
| 403 | #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= QT_VERSION_CHECKcxx . . $ `<external>/15045578679651060896/qglobal.h:61:9`!(5, 5, 0) |
| 404 | QJSValuecxx . . $ QJSValue# v = engine->toScriptValuecxx . . $ QJSEngine#toScriptValue(1062736fde553e42).(service); |
| 405 | #else |
| 406 | QJSValue v = engine->toScriptValue(service.toMap()); |
| 407 | #endif |
| 408 | ret.setPropertycxx . . $ QJSValue#setProperty(94e34475f8a966d9).(i++, v); |
| 409 | } |
| 410 | return retcxx . . $ QJSValue#QJSValue(cffeadb2e55ad1c4).; |
| 411 | } |
| 412 | |
| 413 | /*! |
| 414 | * \qmlsignal AccountModel::accessReply(jsobject reply, jsobject authenticationData) |
| 415 | * |
| 416 | * Emitted when the request initiated with \l AccountModel::requestAccess() |
| 417 | * completes. The \a reply object contains the access reply: |
| 418 | * \list |
| 419 | * \li \c account if access to an account was granted, this property will hold |
| 420 | * an \l Account object |
| 421 | * \li \c errorCode \l {errorCode} {error code}, if an error occurred |
| 422 | * \li \c errorText is a textual description of the error, not meant for the |
| 423 | * end-user; it can be used for debugging purposes |
| 424 | * \endlist |
| 425 | * |
| 426 | * The second parameter, the \a authenticationData object, will contain the |
| 427 | * authentication reply. |
| 428 | */ |
| 429 | |
| 430 | /*! |
| 431 | * \qmlmethod void AccountModel::requestAccess(string serviceId, |
| 432 | * jsobject parameters) |
| 433 | * |
| 434 | * Requests the user to grant this application access to an account providing |
| 435 | * the given service. The user will be asked whether this application should be |
| 436 | * given access to the desired account; if no such accounts are currently |
| 437 | * registered in the system, the user will be guided to create a new one. |
| 438 | * |
| 439 | * It should be noted that account authorizations persist across application |
| 440 | * restart; therefore, this method should be called only when the application |
| 441 | * needs a new account to appear in the model. |
| 442 | * |
| 443 | * Each call to this method will cause the \l accessReply signal to be |
| 444 | * emitted at some time later. Note that the operation will involve |
| 445 | * interactions with the end-user, so don't expect a reply to be emitted |
| 446 | * immediately. |
| 447 | * |
| 448 | * The \a parameters parameter can be used to pass authentication data |
| 449 | * (similarly to how the \l Account::authenticate() method works), if it's |
| 450 | * desired to perform the authentication at the same time. |
| 451 | * |
| 452 | * \sa accessReply |
| 453 | */ |
| 454 | void AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::requestAccesscxx . . $ OnlineAccountsModule/AccountModel#requestAccess(dac83e64e8e6a438).(const QStringcxx . . $ QString# &service, |
| 455 | const QVariantMapcxx . . $ QVariantMap# ¶meters) |
| 456 | { |
| 457 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(AccountModel); |
| 458 | OnlineAccountscxx . . $ OnlineAccounts/::PendingCallcxx . . $ OnlineAccounts/PendingCall# call = |
| 459 | d->m_managercxx . . $ OnlineAccountsModule/AccountModelPrivate#m_manager.->requestAccesscxx . . $ OnlineAccounts/Manager#requestAccess(3453d0b76040b37b).(service, |
| 460 | authenticationDataFromMapcxx . . $ authenticationDataFromMap(451eacff083bcf72).(parameters)); |
| 461 | OnlineAccountscxx . . $ OnlineAccounts/::PendingCallWatchercxx . . $ OnlineAccounts/PendingCallWatcher# *watcher = |
| 462 | new OnlineAccountscxx . . $ OnlineAccounts/::PendingCallWatchercxx . . $ OnlineAccounts/PendingCallWatcher#(call, this); |
| 463 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(watcher, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(finished()), |
| 464 | d, SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(onAccessRequestFinished())); |
| 465 | } |
| 466 | |
| 467 | /*! |
| 468 | * \qmlmethod variant AccountModel::get(int row, string roleName) |
| 469 | * |
| 470 | * Returns the data at \a row for the role \a roleName. |
| 471 | */ |
| 472 | QVariantcxx . . $ QVariant# AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::getcxx . . $ OnlineAccountsModule/AccountModel#get(2d155939dc996343).(int row, const QStringcxx . . $ QString# &roleName) const |
| 473 | { |
| 474 | int role = roleNamescxx . . $ OnlineAccountsModule/AccountModel#roleNames(404e830a028de8a7).().keycxx . . $ QHash#key(dd8c0696c30c0a31).(roleName.toLatin1cxx . . $ QString#toLatin1(ef52b713090bc85a).(), -1); |
| 475 | return datacxx . . $ OnlineAccountsModule/AccountModel#data(69b5b18a001c0029).(indexcxx . . $ QAbstractListModel#index(37dbccf64c4e392).(row), role); |
| 476 | } |
| 477 | |
| 478 | int AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::rowCountcxx . . $ OnlineAccountsModule/AccountModel#rowCount(e3878d4d6cd9529c).(const QModelIndexcxx . . $ QModelIndex# &parent) const |
| 479 | { |
| 480 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const AccountModel); |
| 481 | Q_UNUSEDcxx . . $ `<external>/15045578679651060896/qglobal.h:117:9`!(parent); |
| 482 | return d->m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..countcxx . . $ QList#count(455f465bc33b4cdf).(); |
| 483 | } |
| 484 | |
| 485 | QVariantcxx . . $ QVariant# AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::datacxx . . $ OnlineAccountsModule/AccountModel#data(69b5b18a001c0029).(const QModelIndexcxx . . $ QModelIndex# &index, int role) const |
| 486 | { |
| 487 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const AccountModel); |
| 488 | |
| 489 | int i = index.rowcxx . . $ QModelIndex#row(ea6fe5115c70a13f).(); |
| 490 | if (i < 0 || i >= d->m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..countcxx . . $ QList#count(455f465bc33b4cdf).()) return QVariantcxx . . $ QVariant#QVariant(ced63f7c635d850d).(); |
| 491 | |
| 492 | Accountcxx . . $ OnlineAccountsModule/Account# *account = d->m_accountscxx . . $ OnlineAccountsModule/AccountModelPrivate#m_accounts..atcxx . . $ QList#at(e2681f9bb6b2f357).(i); |
| 493 | QVariantcxx . . $ QVariant# retcxx . . $ QVariant#QVariant(ced63f7c635d850d).; |
| 494 | |
| 495 | switch (role) { |
| 496 | case Qtcxx . . $ Qt/::DisplayRolecxx . . $ Qt/DisplayRole.: |
| 497 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). QStringcxx . . $ QVariant#QVariant(3520e46b33348bf6).("%1 - %2"). |
| 498 | argcxx . . $ QString#arg(bc823072288cbbb5).(account->displayNamecxx . . $ OnlineAccountsModule/Account#displayName(6ef7b6c27b00b43d).()). |
| 499 | argcxx . . $ QString#arg(bc823072288cbbb5).(account->serviceIdcxx . . $ OnlineAccountsModule/Account#serviceId(6ef7b6c27b00b43d).()); |
| 500 | break; |
| 501 | case DisplayNameRolecxx . . $ OnlineAccountsModule/AccountModel#DisplayNameRole.: |
| 502 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). accountcxx . . $ QVariant#QVariant(3520e46b33348bf6).->displayNamecxx . . $ OnlineAccountsModule/Account#displayName(6ef7b6c27b00b43d).(); |
| 503 | break; |
| 504 | case ValidRolecxx . . $ OnlineAccountsModule/AccountModel#ValidRole.: |
| 505 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). accountcxx . . $ QVariant#QVariant(b45ddcbc8423892c).->isValidcxx . . $ OnlineAccountsModule/Account#isValid(50ce9a9e25b4a850).(); |
| 506 | break; |
| 507 | case AccountIdRolecxx . . $ OnlineAccountsModule/AccountModel#AccountIdRole.: |
| 508 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). accountcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).->accountIdcxx . . $ OnlineAccountsModule/Account#accountId(455f465bc33b4cdf).(); |
| 509 | break; |
| 510 | case ServiceIdRolecxx . . $ OnlineAccountsModule/AccountModel#ServiceIdRole.: |
| 511 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). accountcxx . . $ QVariant#QVariant(3520e46b33348bf6).->serviceIdcxx . . $ OnlineAccountsModule/Account#serviceId(6ef7b6c27b00b43d).(); |
| 512 | break; |
| 513 | case AuthenticationMethodRolecxx . . $ OnlineAccountsModule/AccountModel#AuthenticationMethodRole.: |
| 514 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). accountcxx . . $ QVariant#QVariant(d4f767463ce0a6b3).->authenticationMethodcxx . . $ OnlineAccountsModule/Account#authenticationMethod(5a498decbd4374ed).(); |
| 515 | break; |
| 516 | case SettingsRolecxx . . $ OnlineAccountsModule/AccountModel#SettingsRole.: |
| 517 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). accountcxx . . $ QVariant#QVariant(3e95df3e31f2cce8).->settingscxx . . $ OnlineAccountsModule/Account#settings(87f780dbe64191c4).(); |
| 518 | break; |
| 519 | case AccountRolecxx . . $ OnlineAccountsModule/AccountModel#AccountRole.: |
| 520 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(28ec88ac519b76da).<QObjectcxx . . $ QObject#*>(account); |
| 521 | break; |
| 522 | case ServiceRolecxx . . $ OnlineAccountsModule/AccountModel#ServiceRole.: |
| 523 | ret =cxx . . $ QVariant#`operator=`(79a68221451e88b7). QVariantcxx . . $ QVariant#::fromValuecxx . . $ QVariant#fromValue(28ec88ac519b76da).(account->servicecxx . . $ OnlineAccountsModule/Account#service(cedfddd5dbefb84d).()); |
| 524 | break; |
| 525 | } |
| 526 | |
| 527 | return retcxx . . $ QVariant#QVariant(2a36e1ab31ea8e36).; |
| 528 | } |
| 529 | |
| 530 | QHashcxx . . $ QHash#<int, QByteArraycxx . . $ QByteArray#> AccountModelcxx . . $ OnlineAccountsModule/AccountModel#::roleNamescxx . . $ OnlineAccountsModule/AccountModel#roleNames(404e830a028de8a7).() const |
| 531 | { |
| 532 | Q_Dcxx . . $ `<external>/15045578679651060896/qglobal.h:1177:9`!(const AccountModel); |
| 533 | return dcxx . . $ QHash#QHash(e5cdf25c487927b6).->roleNamescxx . . $ OnlineAccountsModule/AccountModelPrivate#roleNames.; |
| 534 | } |
| 535 | |
| 536 | #include "account_model.moc"cxx . . $ `<file>/build/online-accounts/lib/qml/Lomiri/OnlineAccounts/LomiriOnlineAccountsQML_autogen/include/account_model.moc`/ |