summaryrefslogtreecommitdiffstats
path: root/framework/domain/accountsmodel.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-14 20:41:35 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-14 20:41:35 +0100
commitbf039428e22a10887e8d85a95ff5f38dc17e7ec2 (patch)
tree981390fff4d561760edaf1b7c8e3bbcb750ade09 /framework/domain/accountsmodel.h
parent68f95cf68c3a8d29c2cc81929287eabb3a6d7682 (diff)
downloadkube-bf039428e22a10887e8d85a95ff5f38dc17e7ec2.tar.gz
kube-bf039428e22a10887e8d85a95ff5f38dc17e7ec2.zip
Multi-Account support in the folderview
Diffstat (limited to 'framework/domain/accountsmodel.h')
-rw-r--r--framework/domain/accountsmodel.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/framework/domain/accountsmodel.h b/framework/domain/accountsmodel.h
new file mode 100644
index 00000000..a50c2e4a
--- /dev/null
+++ b/framework/domain/accountsmodel.h
@@ -0,0 +1,48 @@
1/*
2 Copyright (c) 2016 Christian Mollekopf <mollekopf@kolabsys.com>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#pragma once
21
22#include <QObject>
23#include <QAbstractListModel>
24#include <QSharedPointer>
25#include <QStringList>
26
27class AccountsModel : public QAbstractListModel
28{
29 Q_OBJECT
30
31public:
32 AccountsModel(QObject *parent = Q_NULLPTR);
33 ~AccountsModel();
34
35 int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
36 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
37
38 enum Roles {
39 Name = Qt::UserRole + 1,
40 Icon,
41 AccountId
42 };
43 Q_ENUMS(Roles)
44
45 QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
46private:
47 QStringList mAccounts;
48};