Message info
 
To:kde-commits@kde.org From:Bernhard Beschow Subject:[marble] /: PluginManager: no need to inherit QObject Date:Sun, 18 Mar 2012 16:09:09 +0100 (CET)
 

Git commit 63609d360c719088b985810ed2900940681cde56 by Bernhard Beschow.
Committed on 18/03/2012 at 14:11.
Pushed by beschow into branch 'master'.

PluginManager: no need to inherit QObject

M +2 -5 src/lib/PluginManager.cpp
M +3 -5 src/lib/PluginManager.h
M +8 -6 tests/PluginManagerTest.cpp

http://commits.kde.org/marble/63609d360c719088b985810ed2900940681cde56

diff --git a/src/lib/PluginManager.cpp b/src/lib/PluginManager.cpp
index 5e7c740..b3a6a7f 100644
--- a/src/lib/PluginManager.cpp
+++ b/src/lib/PluginManager.cpp
@@ -54,9 +54,8 @@ PluginManagerPrivate::~PluginManagerPrivate()
// nothing to do
}

-PluginManager::PluginManager( QObject *parent )
- : QObject(parent),
- d( new PluginManagerPrivate() )
+PluginManager::PluginManager()
+ : d( new PluginManagerPrivate() )
{
}

@@ -171,5 +170,3 @@ void PluginManagerPrivate::loadPlugins()
}

}
-
-#include "PluginManager.moc"
diff --git a/src/lib/PluginManager.h b/src/lib/PluginManager.h
index 0582142..50036f9 100644
--- a/src/lib/PluginManager.h
+++ b/src/lib/PluginManager.h
@@ -13,7 +13,6 @@
#define MARBLE_PLUGINMANAGER_H

#include <QtCore/QList>
-#include <QtCore/QObject>
#include "marble_export.h"


@@ -40,12 +39,11 @@ class RunnerPlugin;
*
*/

-class MARBLE_EXPORT PluginManager : public QObject
+class MARBLE_EXPORT PluginManager
{
- Q_OBJECT
-
public:
- explicit PluginManager( QObject *parent = 0 );
+ explicit PluginManager();
+
~PluginManager();

/**
diff --git a/tests/PluginManagerTest.cpp b/tests/PluginManagerTest.cpp
index d7c969c..beada5a 100644
--- a/tests/PluginManagerTest.cpp
+++ b/tests/PluginManagerTest.cpp
@@ -28,12 +28,14 @@ void PluginManagerTest::loadPlugins()
MarbleDirs::setMarbleDataPath( DATA_PATH );
MarbleDirs::setMarblePluginPath( PLUGIN_PATH );

- int pluginNumber = MarbleDirs::pluginEntryList( "", QDir::Files ).size();
- PluginManager *pm = new PluginManager( 0 );
- int renderPlugins = pm->createRenderPlugins().size();
- int networkPlugins = pm->createNetworkPlugins().size();
- int positionPlugins = pm->createPositionProviderPlugins().size();
- int runnerPlugins = pm->runnerPlugins().size();
+ const int pluginNumber = MarbleDirs::pluginEntryList( "", QDir::Files ).size();
+
+ PluginManager pm;
+ const int renderPlugins = pm.createRenderPlugins().size();
+ const int networkPlugins = pm.createNetworkPlugins().size();
+ const int positionPlugins = pm.createPositionProviderPlugins().size();
+ const int runnerPlugins = pm.runnerPlugins().size();
+
QCOMPARE( renderPlugins + networkPlugins + positionPlugins + runnerPlugins, pluginNumber );
}