summaryrefslogtreecommitdiffstats
path: root/framework/settings/resourcelistmodel.cpp
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2016-09-07 14:01:22 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2016-09-07 14:01:22 +0200
commitf179abbb71ece440805cb5fd57b971c0feefc3eb (patch)
tree687175d68b5cc53bda1908ae9474ce9eb385bd87 /framework/settings/resourcelistmodel.cpp
parent145c65d5f3dc43a97cec86c2d6f8c3bab7f039ba (diff)
downloadkube-f179abbb71ece440805cb5fd57b971c0feefc3eb.tar.gz
kube-f179abbb71ece440805cb5fd57b971c0feefc3eb.zip
remove obsolete code from settings
Diffstat (limited to 'framework/settings/resourcelistmodel.cpp')
-rw-r--r--framework/settings/resourcelistmodel.cpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/framework/settings/resourcelistmodel.cpp b/framework/settings/resourcelistmodel.cpp
deleted file mode 100644
index 27063ebc..00000000
--- a/framework/settings/resourcelistmodel.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
1#include "resourcelistmodel.h"
2
3#include <sink/store.h>
4
5ResourceListModel::ResourceListModel(QObject *parent) : QIdentityProxyModel()
6{
7 Sink::Query query;
8 query.syncOnDemand = false;
9 query.processAll = false;
10 query.liveQuery = true;
11 query.requestedProperties << "type";
12 m_model = Sink::Store::loadModel<Sink::ApplicationDomain::SinkResource>(query);
13}
14
15ResourceListModel::~ResourceListModel()
16{
17
18}
19
20QHash< int, QByteArray > ResourceListModel::roleNames() const
21{
22 QHash<int, QByteArray> roles;
23
24 roles[Type] = "type";
25 roles[Id] = "id";
26
27 return roles;
28}
29
30QVariant ResourceListModel::data(const QModelIndex& index, int role) const
31{
32 auto srcIdx = mapToSource(index);
33 switch (role) {
34 case Id:
35 return srcIdx.data(Sink::Store::DomainObjectBaseRole).value<Sink::ApplicationDomain::ApplicationDomainType::Ptr>()->identifier();
36 case Type:
37 return srcIdx.sibling(srcIdx.row(), 0).data(Qt::DisplayRole).toString();
38 }
39
40 return QIdentityProxyModel::data(index, role);
41}
42