Debian Codegraph @

Dekko/stores/Accounts/AccountStore.qml

raw
1 /* Copyright (C) 2016 - 2017 Dan Chapman <[email protected]>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 pragma Singleton
19 import QtQuick 2.4
20 import QuickFlux 1.0
21 import Dekko.Mail.Accounts 1.0
22 import Dekko.Mail.API 1.0
23
24 AppListener {
25 id: accountStore
26
27 /** type:Accounts Enabled accounts object */
28 property alias enabledAccounts: enabledAccounts
29 /** type:QAbstractListModel enabled accounts model */
30 property alias enabledAccountsModel: enabledAccounts.model
31 /** type:Accounts Receive accounts object */
32 property alias recieveAccounts: recieveAccounts
33 /** type:QAbstractListModel receiving accounts model */
34 property alias receiveAccountsModel: recieveAccounts.model
35 /** type:Accounts Sending accounts object */
36 property alias sendAccounts: sendAccounts
37 /** type:QAbstractListModel sending accounts model */
38 property alias sendAccountsModel: sendAccounts.model
39 /** type:Identities account identities interface */
40 property alias identities: identities
41
42 // List of all enabled accounts. (IMAP/POP/SMTP)
43 Accounts {
44 id: enabledAccounts
45 filter: Accounts.Enabled
46 }
47
48 // List of enabled accounts that receive mail. (IMAP/POP)
49 Accounts{
50 id: recieveAccounts
51 filter: Accounts.CanReceive
52 }
53
54 // List of enabled accounts that send mail. (SMTP)
55 Accounts {
56 id: sendAccounts
57 filter: Accounts.CanSend
58 }
59
60 Identities {
61 id: identities
62 onError: {
63 Log.logError("AccountsStore::Identities", errorString)
64 }
65 }
66
67 Filter {
68 type: ViewKeys.reloadAccountBasedModels
69 onDispatched: {
70 enabledAccounts.reset()
71 recieveAccounts.reset()
72 sendAccounts.reset()
73 }
74 }
75 }