Changeset View
Changeset View
Standalone View
Standalone View
src/declarative/kaccountsdeclarativeplugin.cpp
1 | /************************************************************************************* | 1 | /************************************************************************************* | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2015 by Aleix Pol <aleixpol@kde.org> * | 2 | * Copyright (C) 2015 by Aleix Pol <aleixpol@kde.org> * | ||
3 | * Copyright (C) 2020 by Dan Leinir Turthra Jensen <admin@leinir.dk> * | ||||
3 | * * | 4 | * * | ||
4 | * This program is free software; you can redistribute it and/or * | 5 | * This program is free software; you can redistribute it and/or * | ||
5 | * modify it under the terms of the GNU General Public License * | 6 | * modify it under the terms of the GNU General Public License * | ||
6 | * as published by the Free Software Foundation; either version 2 * | 7 | * as published by the Free Software Foundation; either version 2 * | ||
7 | * of the License, or (at your option) any later version. * | 8 | * of the License, or (at your option) any later version. * | ||
8 | * * | 9 | * * | ||
9 | * This program is distributed in the hope that it will be useful, * | 10 | * This program is distributed in the hope that it will be useful, * | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
12 | * GNU General Public License for more details. * | 13 | * GNU General Public License for more details. * | ||
13 | * * | 14 | * * | ||
14 | * You should have received a copy of the GNU General Public License * | 15 | * You should have received a copy of the GNU General Public License * | ||
15 | * along with this program; if not, write to the Free Software * | 16 | * along with this program; if not, write to the Free Software * | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * | ||
17 | *************************************************************************************/ | 18 | *************************************************************************************/ | ||
18 | 19 | | |||
19 | #include "kaccountsdeclarativeplugin.h" | 20 | #include "kaccountsdeclarativeplugin.h" | ||
20 | #include "createaccountjob.h" | 21 | | ||
22 | #include "accountsmodel.h" | ||||
23 | #include "servicesmodel.h" | ||||
24 | #include "providersmodel.h" | ||||
25 | | ||||
21 | #include "accountservicetogglejob.h" | 26 | #include "accountservicetogglejob.h" | ||
27 | #include "changeaccountdisplaynamejob.h" | ||||
28 | #include "createaccountjob.h" | ||||
29 | #include "removeaccountjob.h" | ||||
30 | | ||||
22 | #include <qqml.h> | 31 | #include <qqml.h> | ||
23 | 32 | | |||
24 | void KAccountsDeclarativePlugin::registerTypes(const char* uri) | 33 | void KAccountsDeclarativePlugin::registerTypes(const char* uri) | ||
25 | { | 34 | { | ||
26 | qmlRegisterType<CreateAccountJob>(uri, 1, 0, "CreateAccountJob"); | 35 | // Version 1.0 | ||
27 | qmlRegisterType<AccountServiceToggleJob>(uri, 1, 1, "AccountServiceToggleJob"); | 36 | // Consider this registration deprecated - use the one named ...Job below instead | ||
37 | qmlRegisterType<CreateAccountJob>( uri, 1, 0, "CreateAccount"); | ||||
38 | | ||||
39 | // Version 1.1 | ||||
40 | // Consider this registration deprecated - use the one named ...Job below instead | ||||
41 | qmlRegisterType<AccountServiceToggleJob>( uri, 1, 1, "AccountServiceToggle"); | ||||
42 | | ||||
43 | // Version 1.2 | ||||
44 | qmlRegisterType<AccountsModel>( uri, 1, 2, "AccountsModel"); | ||||
45 | qmlRegisterType<ProvidersModel>( uri, 1, 2, "ProvidersModel"); | ||||
46 | qmlRegisterType<ServicesModel>( uri, 1, 2, "ServicesModel"); | ||||
47 | | ||||
48 | qmlRegisterType<AccountServiceToggleJob>( uri, 1, 2, "AccountServiceToggleJob"); | ||||
49 | qmlRegisterType<ChangeAccountDisplayNameJob>( uri, 1, 2, "ChangeAccountDisplayNameJob"); | ||||
50 | qmlRegisterType<CreateAccountJob>( uri, 1, 2, "CreateAccountJob"); | ||||
51 | qmlRegisterType<RemoveAccountJob>( uri, 1, 2, "RemoveAccountJob"); | ||||
28 | } | 52 | } |