[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kactivities-stats] src: Properly sending the resource linked event
From: Ivan Čukić <ivan.cukic () kde ! org>
Date: 2016-11-06 11:13:21
Message-ID: E1c3LO5-0007Ki-Do () code ! kde ! org
[Download RAW message or body]
Git commit 26d6598e937daf99a7cbb56d8e45a01b96ea53a2 by Ivan Čukić.
Committed on 06/11/2016 at 11:13.
Pushed by ivan into branch 'master'.
Properly sending the resource linked event
M +4 -9 src/resultmodel.cpp
M +1 -1 src/resultwatcher.cpp
http://commits.kde.org/kactivities-stats/26d6598e937daf99a7cbb56d8e45a01b96ea53a2
diff --git a/src/resultmodel.cpp b/src/resultmodel.cpp
index f576034..1cdfef6 100644
--- a/src/resultmodel.cpp
+++ b/src/resultmodel.cpp
@@ -785,15 +785,8 @@ public:
{
const auto result = cache.find(resource);
- if (!result) return;
-
- if (query.selection() == Terms::LinkedResources) {
+ if (query.selection() != Terms::UsedResources) {
onResultScoreUpdated(resource, 0, 0, 0);
-
- } else if (query.selection() == Terms::AllResources) {
- result->setLinkStatus(ResultSet::Result::Linked);
- repositionResult(result, destinationFor(*result));
-
}
}
@@ -915,7 +908,9 @@ QVariant ResultModel::data(const QModelIndex &item, int role) const
{
const auto row = item.row();
- if (row < 0 || row >= d->cache.size()) return QVariant();
+ if (row < 0 || row >= d->cache.size()) {
+ return QVariant();
+ }
const auto &result = d->cache[row];
diff --git a/src/resultwatcher.cpp b/src/resultwatcher.cpp
index 29dbea2..1475e4e 100644
--- a/src/resultwatcher.cpp
+++ b/src/resultwatcher.cpp
@@ -202,7 +202,7 @@ public:
const QString &activity)
{
#if DEBUG_MATCHERS
- qDebug() << "Resource linked: " << agent << resource << activity;
+ qDebug() << "Resource has been linked: " << agent << resource << activity;
#endif
// The used resources do not really care about the linked ones
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic