From be511a719851c14c5ea5c1479ed2d814fbd3a8e6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 20 May 2017 12:03:33 +0200 Subject: Get the folder name in the status bar --- framework/src/domain/folderlistmodel.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'framework/src/domain/folderlistmodel.cpp') diff --git a/framework/src/domain/folderlistmodel.cpp b/framework/src/domain/folderlistmodel.cpp index 4437e75b..1ef6f761 100644 --- a/framework/src/domain/folderlistmodel.cpp +++ b/framework/src/domain/folderlistmodel.cpp @@ -105,7 +105,6 @@ void FolderListModel::setAccountId(const QVariant &accountId) auto query = Query(); query.resourceFilter(account); query.setFlags(Sink::Query::LiveQuery | Sink::Query::UpdateStatus); - query.requestTree(); query.request() .request() .request() @@ -115,6 +114,11 @@ void FolderListModel::setAccountId(const QVariant &accountId) runQuery(query); } +QVariant FolderListModel::accountId() const +{ + return {}; +} + static int getPriority(const Sink::ApplicationDomain::Folder &folder) { auto specialPurpose = folder.getSpecialPurpose(); @@ -144,8 +148,22 @@ bool FolderListModel::lessThan(const QModelIndex &left, const QModelIndex &right return leftPriority < rightPriority; } -QVariant FolderListModel::accountId() const +void FolderListModel::setFolderId(const QVariant &folderId) { - return QVariant(); + const auto folder = folderId.toString().toUtf8(); + + //Get all folders of an account + auto query = Query(); + query.filter(folder); + query.request() + .request() + .request() + .request(); + query.setId("folder" + folder); + runQuery(query); } +QVariant FolderListModel::folderId() const +{ + return {}; +} -- cgit v1.2.3