[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:06:35 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=44b04ed
The following commit has been merged in the master branch:
commit 44b04ed15462ef0a47cf062ea7d3aca126d3a348
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Sun Mar 10 04:33:52 2013 +0000
Sort filtering plugins by X-KDE-PluginInfo-Weight
BUG: 299292
REVIEW: 109383
---
KTp/message-processor.cpp | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/KTp/message-processor.cpp b/KTp/message-processor.cpp
index 10e299a..2e252f9 100644
--- a/KTp/message-processor.cpp
+++ b/KTp/message-processor.cpp
@@ -47,11 +47,30 @@ class MessageProcessor::Private
MessageProcessor *q;
};
+bool pluginWeightLessThan(const KPluginInfo &p1, const KPluginInfo &p2)
+{
+ bool ok;
+ int weight1 = p1.service()->property(QLatin1String("X-KDE-PluginInfo-Weight"), QVariant::Int).toInt(&ok);
+ if (!ok) {
+ weight1 = 100;
+ }
+ int weight2 = p2.service()->property(QLatin1String("X-KDE-PluginInfo-Weight"), QVariant::Int).toInt(&ok);
+ if (!ok) {
+ weight2 = 100;
+ }
+
+ return weight1 < weight2;
+}
+
void MessageProcessor::Private::loadFilters()
{
kDebug() << "Starting loading filters...";
- Q_FOREACH (const KPluginInfo &plugin, MessageFilterConfigManager::self()->enabledPlugins()) {
+ KPluginInfo::List plugins = MessageFilterConfigManager::self()->enabledPlugins();
+
+ qSort(plugins.begin(), plugins.end(), pluginWeightLessThan);
+
+ Q_FOREACH (const KPluginInfo &plugin, plugins) {
KService::Ptr service = plugin.service();
KPluginFactory *factory = KPluginLoader(service->library()).factory();
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list