summaryrefslogtreecommitdiffstats
path: root/sigtools
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-03-28 15:02:35 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-03-28 15:02:35 -0400
commit642213842745411f6abc753307d35711759aee5d (patch)
tree18ffeb57541a0409190a151d4246f735575dfb06 /sigtools
parent24ad4f774f08e4c739b0cb31aa0f07ec8fc67192 (diff)
downloadsigen-642213842745411f6abc753307d35711759aee5d.tar.gz
sigen-642213842745411f6abc753307d35711759aee5d.tar.xz
sigen-642213842745411f6abc753307d35711759aee5d.zip
Move the detection of classes left at deletion to PluginBase
Diffstat (limited to 'sigtools')
-rw-r--r--sigtools/PluginLoader.cpp7
-rw-r--r--sigtools/PluginLoader_p.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/sigtools/PluginLoader.cpp b/sigtools/PluginLoader.cpp
index 37eb9bc6..8c6f00ad 100644
--- a/sigtools/PluginLoader.cpp
+++ b/sigtools/PluginLoader.cpp
@@ -34,7 +34,6 @@
#include <KStandardDirs>
// Qt includes
-#include <QtCore/QtDebug>
#include <QtCore/QFile>
using namespace Sigmod;
@@ -231,18 +230,16 @@ QSharedPointer<Game> PluginLoader::Private::game(const QString& name)
return QSharedPointer<Game>();
}
-void PluginLoader::Private::clean(const QString& type, const bool errorOnExtra)
+void PluginLoader::Private::clean(const QString& type, const bool forceDeletion)
{
QMutableListIterator<PluginBase*> i(m_plugins[type]);
while (i.hasNext())
{
i.next();
- if (!i.value()->classesUsedCount())
+ if (forceDeletion || !i.value()->classesUsedCount())
{
delete i.value();
i.remove();
}
- else if (errorOnExtra)
- qCritical() << "There are still" << i.value()->classesUsedCount() << "classes in use by a plugin of type" << type;
}
}
diff --git a/sigtools/PluginLoader_p.h b/sigtools/PluginLoader_p.h
index ec2e9750..95caa92d 100644
--- a/sigtools/PluginLoader_p.h
+++ b/sigtools/PluginLoader_p.h
@@ -60,7 +60,7 @@ class SIGTOOLS_NO_EXPORT Private : public QObject
Sigencore::Plugins::PluginBase* factory(const QString& type, const QString& name);
QSharedPointer<Sigmod::Game> game(const QString& name);
protected:
- void clean(const QString& type, const bool errorOnExtra = false);
+ void clean(const QString& type, const bool forceDeletion = false);
typedef QPair<KService::Ptr, Sigencore::Plugins::PluginBase*> Service;
typedef QMap<QString, Service> PluginList;