[SCM] ktp-contact-runner packaging branch, master, updated. debian/15.12.1-2-244-g38a1f58
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 17:50:24 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-runner.git;a=commitdiff;h=39edc1f
The following commit has been merged in the master branch:
commit 39edc1f72e4c5238377b7d26ab8c9db9fbce0ae8
Author: Dan Vrátil <dan at progdan.cz>
Date: Sun Mar 11 21:33:33 2012 +0100
Set match relevance by presence status of the contact, prefer online
---
contactrunner.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/contactrunner.cpp b/contactrunner.cpp
index 65d6742..95d5485 100644
--- a/contactrunner.cpp
+++ b/contactrunner.cpp
@@ -194,6 +194,7 @@ void ContactRunner::match(Plasma::RunnerContext& context)
for (int j = 0; (j < contactsCount) && context.isValid(); j++) {
Plasma::QueryMatch match(this);
+ qreal relevance = 0.1;
QModelIndex contactIndex = m_proxyModel->index(j, 0, accountIndex);
@@ -213,22 +214,28 @@ void ContactRunner::match(Plasma::RunnerContext& context)
switch (contactIndex.data(AccountsModel::PresenceTypeRole).toInt()) {
case Tp::ConnectionPresenceTypeAvailable:
iconName = "im-user";
+ relevance *= 10;
break;
case Tp::ConnectionPresenceTypeBusy:
iconName = "im-user-busy";
+ relevance *= 8;
break;
case Tp::ConnectionPresenceTypeAway:
case Tp::ConnectionPresenceTypeExtendedAway:
iconName = "im-user-away";
+ relevance *= 6;
break;
case Tp::ConnectionPresenceTypeHidden:
iconName = "im-invisible-user";
+ relevance *= 4;
break;
case Tp::ConnectionPresenceTypeOffline:
iconName = "im-user-offline";
+ relevance *= 1;
break;
default:
iconName = "im-user-offline";
+ relevance *= 1;
break;
}
@@ -246,8 +253,8 @@ void ContactRunner::match(Plasma::RunnerContext& context)
match.setSubtext(status.replace(0, 1, status.left(1).toUpper()));
match.setSelectedAction(defaultAction);
-
match.setData(qVariantFromValue(contactIndex));
+ match.setRelevance(relevance);
context.addMatch(term, match);
}
--
ktp-contact-runner packaging
More information about the pkg-kde-commits
mailing list