[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:22:18 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=b60be9d
The following commit has been merged in the master branch:
commit b60be9db823e5e95e99fce468597f07fbdf3fe07
Author: Lasath Fernando <kde at lasath.org>
Date: Sat Jul 14 22:24:11 2012 +1000
Remove plugin management from MesssageProcessor
It no longer deals with plugins or their configurations anymore. It now
simply gets a list of plugins from PluginConfigManager and loads them.
Also renames loadPlugins to loadFilters to make it clear that this class
is to deal with Filters rather than plugins.
---
lib/message-processor.cpp | 47 ++++++++++++++++-------------------------------
lib/message-processor.h | 6 +-----
2 files changed, 17 insertions(+), 36 deletions(-)
diff --git a/lib/message-processor.cpp b/lib/message-processor.cpp
index e89ecf0..41213c8 100644
--- a/lib/message-processor.cpp
+++ b/lib/message-processor.cpp
@@ -19,6 +19,7 @@
#include "message-processor.h"
#include "filters.h"
+#include "plugin-config-manager.h"
#include <QMutex>
@@ -52,7 +53,7 @@ MessageProcessor::MessageProcessor()
m_filters.append(new EscapeFilter(this));
m_filters.append(new UrlFilter(this));
- loadPlugins();
+ loadFilters();
}
@@ -79,39 +80,23 @@ Message MessageProcessor::processOutgoingMessage(const Tp::Message &sentMessage)
return message;
}
-void MessageProcessor::loadPlugins() {
+void MessageProcessor::loadFilters() {
kDebug() << "Starting loading filters...";
- KPluginInfo::List plugins = pluginList();
- for (KPluginInfo::List::Iterator i = plugins.begin(); i != plugins.end(); i++) {
- KPluginInfo &plugin = *i;
- kDebug() << "found filter :" << plugin.pluginName();
-
- plugin.load();
- if (plugin.isPluginEnabled()) {
- kDebug() << "it is enabled";
- KService::Ptr service = plugin.service();
-
- KPluginFactory *factory = KPluginLoader(service->library()).factory();
- if(factory) {
- kDebug() << "loaded factory :" << factory;
- AbstractMessageFilter *filter = factory->create<AbstractMessageFilter>(this);
-
- if(filter) {
- kDebug() << "loaded message filter : " << filter;
- m_filters.append(filter);
- }
- } else {
- kError() << "error loading plugin :" << service->library();
+ Q_FOREACH (const KPluginInfo &plugin, PluginConfigManager::self()->enabledPlugins()) {
+ KService::Ptr service = plugin.service();
+
+ KPluginFactory *factory = KPluginLoader(service->library()).factory();
+ if(factory) {
+ kDebug() << "loaded factory :" << factory;
+ AbstractMessageFilter *filter = factory->create<AbstractMessageFilter>(this);
+
+ if(filter) {
+ kDebug() << "loaded message filter : " << filter;
+ m_filters.append(filter);
}
+ } else {
+ kError() << "error loading plugin :" << service->library();
}
}
}
-
-KPluginInfo::List MessageProcessor::pluginList()
-{
- KService::List offers = KServiceTypeTrader::self()->query(serviceType);
- KConfigGroup config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"))->group("Plugins");
-
- return KPluginInfo::fromServices(offers, config);
-}
diff --git a/lib/message-processor.h b/lib/message-processor.h
index c6d2b12..2b070bd 100644
--- a/lib/message-processor.h
+++ b/lib/message-processor.h
@@ -48,17 +48,13 @@ public:
Message processIncomingMessage(const Tp::ReceivedMessage &message);
Message processOutgoingMessage(const Tp::Message &message);
- static KPluginInfo::List pluginList();
- static KSharedConfig::Ptr defaultConfig();
-
protected:
explicit MessageProcessor();
private:
- void loadPlugins();
+ void loadFilters();
static MessageProcessor* s_instance;
QList<AbstractMessageFilter*> m_filters;
-
};
#endif // MESSAGE_PROCESSOR_H
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list