summaryrefslogtreecommitdiffstats
path: root/common/modelresult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/modelresult.cpp')
-rw-r--r--common/modelresult.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/common/modelresult.cpp b/common/modelresult.cpp
index 3edbec7..26d4f82 100644
--- a/common/modelresult.cpp
+++ b/common/modelresult.cpp
@@ -53,7 +53,9 @@ ModelResult<T, Ptr>::ModelResult(const Sink::Query &query, const QList<QByteArra
53 : QAbstractItemModel(), mLogCtx(ctx.subContext("modelresult")), mPropertyColumns(propertyColumns), mQuery(query) 53 : QAbstractItemModel(), mLogCtx(ctx.subContext("modelresult")), mPropertyColumns(propertyColumns), mQuery(query)
54{ 54{
55 if (query.flags().testFlag(Sink::Query::UpdateStatus)) { 55 if (query.flags().testFlag(Sink::Query::UpdateStatus)) {
56 mNotifier.reset(new Sink::Notifier{query}); 56 Sink::Query resourceQuery;
57 resourceQuery.setFilter(query.getResourceFilter());
58 mNotifier.reset(new Sink::Notifier{resourceQuery});
57 mNotifier->registerHandler([this](const Notification &notification) { 59 mNotifier->registerHandler([this](const Notification &notification) {
58 switch (notification.type) { 60 switch (notification.type) {
59 case Notification::Status: 61 case Notification::Status:
@@ -120,8 +122,10 @@ ModelResult<T, Ptr>::ModelResult(const Sink::Query &query, const QList<QByteArra
120 changedRoles << WarningRole; 122 changedRoles << WarningRole;
121 } 123 }
122 124
123 const auto idx = createIndexFromId(id); 125 if (!changedRoles.isEmpty()) {
124 emit dataChanged(idx, idx, changedRoles); 126 const auto idx = createIndexFromId(id);
127 emit dataChanged(idx, idx, changedRoles);
128 }
125 } 129 }
126 }); 130 });
127 } 131 }