summaryrefslogtreecommitdiffstats
path: root/framework/domain/folderlistmodel.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-04 12:19:27 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-04 12:19:27 +0200
commit268eb7207b955bb92e4ae2572996877e7f837325 (patch)
treecac5dbbdf98afcc8d3f7c595a7bbbe1a993e2028 /framework/domain/folderlistmodel.cpp
parentdd060cc5e3b336a77f8e5e76df4bc76a58e22cd4 (diff)
downloadkube-268eb7207b955bb92e4ae2572996877e7f837325.tar.gz
kube-268eb7207b955bb92e4ae2572996877e7f837325.zip
Less namespaces improve readability
Diffstat (limited to 'framework/domain/folderlistmodel.cpp')
-rw-r--r--framework/domain/folderlistmodel.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/framework/domain/folderlistmodel.cpp b/framework/domain/folderlistmodel.cpp
index 98453ce9..e852288f 100644
--- a/framework/domain/folderlistmodel.cpp
+++ b/framework/domain/folderlistmodel.cpp
@@ -22,9 +22,12 @@
22#include <sink/store.h> 22#include <sink/store.h>
23#include <settings/settings.h> 23#include <settings/settings.h>
24 24
25using namespace Sink;
26using namespace Sink::ApplicationDomain;
27
25FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() 28FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel()
26{ 29{
27 Sink::Query query; 30 Query query;
28 query.liveQuery = true; 31 query.liveQuery = true;
29 query.requestedProperties << "name" << "icon" << "parent"; 32 query.requestedProperties << "name" << "icon" << "parent";
30 query.parentProperty = "parent"; 33 query.parentProperty = "parent";
@@ -57,26 +60,25 @@ QVariant FolderListModel::data(const QModelIndex &idx, int role) const
57 case Icon: 60 case Icon:
58 return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString(); 61 return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString();
59 case Id: 62 case Id:
60 return srcIdx.data(Sink::Store::DomainObjectBaseRole).value<Sink::ApplicationDomain::ApplicationDomainType::Ptr>()->identifier(); 63 return srcIdx.data(Store::DomainObjectBaseRole).value<ApplicationDomainType::Ptr>()->identifier();
61 case DomainObject: 64 case DomainObject:
62 return srcIdx.data(Sink::Store::DomainObjectRole); 65 return srcIdx.data(Store::DomainObjectRole);
63 } 66 }
64 return QIdentityProxyModel::data(idx, role); 67 return QIdentityProxyModel::data(idx, role);
65} 68}
66 69
67void FolderListModel::runQuery(const Sink::Query &query) 70void FolderListModel::runQuery(const Query &query)
68{ 71{
69 mModel = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); 72 mModel = Store::loadModel<Folder>(query);
70 setSourceModel(mModel.data()); 73 setSourceModel(mModel.data());
71} 74}
72 75
73void FolderListModel::setAccountId(const QVariant &accountId) 76void FolderListModel::setAccountId(const QVariant &accountId)
74{ 77{
75 using namespace Sink::ApplicationDomain;
76 const auto account = accountId.toString().toUtf8(); 78 const auto account = accountId.toString().toUtf8();
77 79
78 //Get all folders of an account 80 //Get all folders of an account
79 auto query = Sink::Query(); 81 auto query = Query();
80 query.filter(SinkAccount(account)); 82 query.filter(SinkAccount(account));
81 query.liveQuery = true; 83 query.liveQuery = true;
82 query.request<Folder::Name>() 84 query.request<Folder::Name>()