From ec48ea0cf01d306c0a9283e485f8c37d7d4d1ebd Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 16 Apr 2017 22:18:02 +0200 Subject: Hide trash from non-trash conversations. ...and indicate in the conversation view if a mail has been sent or is a draft. --- framework/src/domain/folderlistmodel.cpp | 6 ++++++ framework/src/domain/folderlistmodel.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'framework/src/domain') diff --git a/framework/src/domain/folderlistmodel.cpp b/framework/src/domain/folderlistmodel.cpp index 14405beb..4437e75b 100644 --- a/framework/src/domain/folderlistmodel.cpp +++ b/framework/src/domain/folderlistmodel.cpp @@ -53,6 +53,7 @@ QHash< int, QByteArray > FolderListModel::roleNames() const roles[Id] = "id"; roles[DomainObject] = "domainObject"; roles[Status] = "status"; + roles[Trash] = "trash"; return roles; } @@ -81,6 +82,11 @@ QVariant FolderListModel::data(const QModelIndex &idx, int role) const } return NoStatus; } + case Trash: + if (folder) { + return folder->getSpecialPurpose().contains(Sink::ApplicationDomain::SpecialPurpose::Mail::trash); + } + return false; } return QSortFilterProxyModel::data(idx, role); } diff --git a/framework/src/domain/folderlistmodel.h b/framework/src/domain/folderlistmodel.h index 17645bb5..8f157ca2 100644 --- a/framework/src/domain/folderlistmodel.h +++ b/framework/src/domain/folderlistmodel.h @@ -54,7 +54,8 @@ public: Icon, Id, DomainObject, - Status + Status, + Trash }; Q_ENUMS(Roles) -- cgit v1.2.3