a singleton

will be used to assign engines for items
This commit is contained in:
Marco Martin 2012-01-09 11:04:40 +01:00
parent cf0e31442e
commit 691b22dbab
2 changed files with 40 additions and 0 deletions

View File

@ -31,6 +31,29 @@
#include "qmenuitem.h"
#include "kdialogproxy.h"
class BKSingleton
{
public:
EngineBookKeeping self;
};
K_GLOBAL_STATIC(BKSingleton, privateBKSelf)
EngineBookKeeping::EngineBookKeeping()
{
}
EngineBookKeeping *EngineBookKeeping::self()
{
return &privateBKSelf->self;
}
QDeclarativeEngine *engineFor(QDeclarativeItem *item) const
{
return 0;
}
void PlasmaComponentsPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.components"));

View File

@ -21,6 +21,23 @@
#define PLASMACOMPONENTSPLUGIN_H
#include <QDeclarativeExtensionPlugin>
#include <QHash>
class QDeclarativeEngine;
class QDeclarativeItem;
class PlasmaComponentsPlugin;
class EngineBookKeeping
{
public:
EngineBookKeeping();
static EngineBookKeeping *self();
QDeclarativeEngine *engineFor(QDeclarativeItem *item) const;
private:
QHash <PlasmaComponentsPlugin*, QDeclarativeEngine*> m_engines;
};
class PlasmaComponentsPlugin : public QDeclarativeExtensionPlugin
{