add/remove associations plugin/engine
This commit is contained in:
parent
691b22dbab
commit
b566382d48
@ -47,12 +47,32 @@ EngineBookKeeping *EngineBookKeeping::self()
|
|||||||
return &privateBKSelf->self;
|
return &privateBKSelf->self;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDeclarativeEngine *engineFor(QDeclarativeItem *item) const
|
QDeclarativeEngine *EngineBookKeeping::engineFor(QDeclarativeItem *item) const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EngineBookKeeping::insertPlugin(PlasmaComponentsPlugin *plugin, QDeclarativeEngine *engine)
|
||||||
|
{
|
||||||
|
m_engines.insert(plugin, engine);
|
||||||
|
}
|
||||||
|
|
||||||
|
void EngineBookKeeping::removePlugin(PlasmaComponentsPlugin *plugin)
|
||||||
|
{
|
||||||
|
m_engines.remove(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PlasmaComponentsPlugin::~PlasmaComponentsPlugin()
|
||||||
|
{
|
||||||
|
EngineBookKeeping::self()->removePlugin(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlasmaComponentsPlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri)
|
||||||
|
{
|
||||||
|
QDeclarativeExtensionPlugin::initializeEngine(engine, uri);
|
||||||
|
EngineBookKeeping::self()->insertPlugin(this, engine);
|
||||||
|
}
|
||||||
|
|
||||||
void PlasmaComponentsPlugin::registerTypes(const char *uri)
|
void PlasmaComponentsPlugin::registerTypes(const char *uri)
|
||||||
{
|
{
|
||||||
|
@ -33,6 +33,8 @@ public:
|
|||||||
EngineBookKeeping();
|
EngineBookKeeping();
|
||||||
static EngineBookKeeping *self();
|
static EngineBookKeeping *self();
|
||||||
|
|
||||||
|
void insertPlugin(PlasmaComponentsPlugin *plugin, QDeclarativeEngine *engine);
|
||||||
|
void removePlugin(PlasmaComponentsPlugin *plugin);
|
||||||
QDeclarativeEngine *engineFor(QDeclarativeItem *item) const;
|
QDeclarativeEngine *engineFor(QDeclarativeItem *item) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -44,6 +46,8 @@ class PlasmaComponentsPlugin : public QDeclarativeExtensionPlugin
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
~PlasmaComponentsPlugin();
|
||||||
|
void initializeEngine(QDeclarativeEngine *engine, const char *uri);
|
||||||
void registerTypes(const char *uri);
|
void registerTypes(const char *uri);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user