summaryrefslogtreecommitdiffstats
path: root/sigtools
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-03-26 15:25:21 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-03-26 15:25:21 -0400
commit7d8d711df4630e10d96e349952e8b54fced3de18 (patch)
tree18d1dc78d3ceb61dd92b8c01371f7ddf13af5069 /sigtools
parent19608f15378cec3804cbf642564c461865dabdbd (diff)
downloadsigen-7d8d711df4630e10d96e349952e8b54fced3de18.tar.gz
sigen-7d8d711df4630e10d96e349952e8b54fced3de18.tar.xz
sigen-7d8d711df4630e10d96e349952e8b54fced3de18.zip
Make members protected
Diffstat (limited to 'sigtools')
-rw-r--r--sigtools/PluginLoader.cpp13
-rw-r--r--sigtools/PluginLoader_p.h3
2 files changed, 13 insertions, 3 deletions
diff --git a/sigtools/PluginLoader.cpp b/sigtools/PluginLoader.cpp
index 44662a0e..c48076dc 100644
--- a/sigtools/PluginLoader.cpp
+++ b/sigtools/PluginLoader.cpp
@@ -37,9 +37,9 @@ K_GLOBAL_STATIC(PluginLoader::Private, loader)
QStringList PluginLoader::availablePlugins(const QString& type, const bool forceLookup)
{
- if (forceLookup || !loader->m_available.contains(type))
+ if (forceLookup)
loader->refresh(type);
- return loader->m_available[type].keys();
+ return loader->services(type);
}
KService::Ptr PluginLoader::service(const QString& type, const QString& name)
@@ -110,6 +110,15 @@ void PluginLoader::Private::refresh(const QString& type)
}
}
+QStringList PluginLoader::Private::services(const QString& type)
+{
+ if (!m_available.contains(type))
+ refresh(type);
+ if (m_available.contains(type))
+ return m_available[type].keys();
+ return QStringList();
+}
+
KService::Ptr PluginLoader::Private::service(const QString& type, const QString& name)
{
if (!m_available.contains(type))
diff --git a/sigtools/PluginLoader_p.h b/sigtools/PluginLoader_p.h
index acd3125e..fa11988d 100644
--- a/sigtools/PluginLoader_p.h
+++ b/sigtools/PluginLoader_p.h
@@ -47,9 +47,10 @@ class SIGTOOLS_NO_EXPORT Private : public QObject
public:
void refresh(const QString& type);
+ QStringList services(const QString& type);
KService::Ptr service(const QString& type, const QString& name);
Sigencore::Plugins::PluginBase* factory(const QString& type, const QString& name);
-
+ protected:
typedef QPair<KService::Ptr, Sigencore::Plugins::PluginBase*> Service;
typedef QMap<QString, Service> PluginList;
QMap<QString, PluginList> m_available;