From 268eb7207b955bb92e4ae2572996877e7f837325 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 4 Oct 2016 12:19:27 +0200 Subject: Less namespaces improve readability --- framework/domain/folderlistmodel.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'framework/domain/folderlistmodel.cpp') 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 @@ #include #include +using namespace Sink; +using namespace Sink::ApplicationDomain; + FolderListModel::FolderListModel(QObject *parent) : QIdentityProxyModel() { - Sink::Query query; + Query query; query.liveQuery = true; query.requestedProperties << "name" << "icon" << "parent"; query.parentProperty = "parent"; @@ -57,26 +60,25 @@ QVariant FolderListModel::data(const QModelIndex &idx, int role) const case Icon: return srcIdx.sibling(srcIdx.row(), 1).data(Qt::DisplayRole).toString(); case Id: - return srcIdx.data(Sink::Store::DomainObjectBaseRole).value()->identifier(); + return srcIdx.data(Store::DomainObjectBaseRole).value()->identifier(); case DomainObject: - return srcIdx.data(Sink::Store::DomainObjectRole); + return srcIdx.data(Store::DomainObjectRole); } return QIdentityProxyModel::data(idx, role); } -void FolderListModel::runQuery(const Sink::Query &query) +void FolderListModel::runQuery(const Query &query) { - mModel = Sink::Store::loadModel(query); + mModel = Store::loadModel(query); setSourceModel(mModel.data()); } void FolderListModel::setAccountId(const QVariant &accountId) { - using namespace Sink::ApplicationDomain; const auto account = accountId.toString().toUtf8(); //Get all folders of an account - auto query = Sink::Query(); + auto query = Query(); query.filter(SinkAccount(account)); query.liveQuery = true; query.request() -- cgit v1.2.3