From 7d8d711df4630e10d96e349952e8b54fced3de18 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 26 Mar 2009 15:25:21 -0400 Subject: Make members protected --- sigtools/PluginLoader.cpp | 13 +++++++++++-- sigtools/PluginLoader_p.h | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'sigtools') 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 Service; typedef QMap PluginList; QMap m_available; -- cgit