From bf039428e22a10887e8d85a95ff5f38dc17e7ec2 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 14 Mar 2016 20:41:35 +0100 Subject: Multi-Account support in the folderview --- framework/domain/accountsmodel.h | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 framework/domain/accountsmodel.h (limited to 'framework/domain/accountsmodel.h') 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 @@ +/* + Copyright (c) 2016 Christian Mollekopf + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#pragma once + +#include +#include +#include +#include + +class AccountsModel : public QAbstractListModel +{ + Q_OBJECT + +public: + AccountsModel(QObject *parent = Q_NULLPTR); + ~AccountsModel(); + + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + + enum Roles { + Name = Qt::UserRole + 1, + Icon, + AccountId + }; + Q_ENUMS(Roles) + + QHash roleNames() const Q_DECL_OVERRIDE; +private: + QStringList mAccounts; +}; -- cgit v1.2.3