a singleton
will be used to assign engines for items
This commit is contained in:
parent
cf0e31442e
commit
691b22dbab
@ -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"));
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user