|
@@ -175,7 +175,7 @@ bool ctkPluginContext::ungetService(const ctkServiceReference& reference)
|
|
}
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
-bool ctkPluginContext::connectPluginListener(const QObject* receiver, const char* method,
|
|
|
|
|
|
+bool ctkPluginContext::connectPluginListener(const QObject* receiver, const char* slot,
|
|
Qt::ConnectionType type)
|
|
Qt::ConnectionType type)
|
|
{
|
|
{
|
|
Q_D(ctkPluginContext);
|
|
Q_D(ctkPluginContext);
|
|
@@ -183,11 +183,11 @@ bool ctkPluginContext::connectPluginListener(const QObject* receiver, const char
|
|
// TODO check permissions for a direct connection
|
|
// TODO check permissions for a direct connection
|
|
if (type == Qt::DirectConnection || type == Qt::BlockingQueuedConnection)
|
|
if (type == Qt::DirectConnection || type == Qt::BlockingQueuedConnection)
|
|
{
|
|
{
|
|
- return receiver->connect(&(d->plugin->fwCtx->listeners), SIGNAL(pluginChangedDirect(ctkPluginEvent)), method, type);
|
|
|
|
|
|
+ return receiver->connect(&(d->plugin->fwCtx->listeners), SIGNAL(pluginChangedDirect(ctkPluginEvent)), slot, type);
|
|
}
|
|
}
|
|
else if (type == Qt::QueuedConnection)
|
|
else if (type == Qt::QueuedConnection)
|
|
{
|
|
{
|
|
- return receiver->connect(&(d->plugin->fwCtx->listeners), SIGNAL(pluginChangedQueued(ctkPluginEvent)), method, type);
|
|
|
|
|
|
+ return receiver->connect(&(d->plugin->fwCtx->listeners), SIGNAL(pluginChangedQueued(ctkPluginEvent)), slot, type);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -196,12 +196,31 @@ bool ctkPluginContext::connectPluginListener(const QObject* receiver, const char
|
|
}
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|
|
-bool ctkPluginContext::connectFrameworkListener(const QObject* receiver, const char* method, Qt::ConnectionType type)
|
|
|
|
|
|
+void ctkPluginContext::disconnectPluginListener(const QObject *receiver, const char* slot)
|
|
|
|
+{
|
|
|
|
+ Q_D(ctkPluginContext);
|
|
|
|
+ d->isPluginContextValid();
|
|
|
|
+
|
|
|
|
+ QObject::disconnect(&(d->plugin->fwCtx->listeners), SIGNAL(pluginChangedDirect(ctkPluginEvent)), receiver, slot);
|
|
|
|
+ QObject::disconnect(&(d->plugin->fwCtx->listeners), SIGNAL(pluginChangedQueued(ctkPluginEvent)), receiver, slot);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
|
+bool ctkPluginContext::connectFrameworkListener(const QObject* receiver, const char* slot, Qt::ConnectionType type)
|
|
{
|
|
{
|
|
Q_D(ctkPluginContext);
|
|
Q_D(ctkPluginContext);
|
|
d->isPluginContextValid();
|
|
d->isPluginContextValid();
|
|
// TODO check permissions for a direct connection
|
|
// TODO check permissions for a direct connection
|
|
- return receiver->connect(&(d->plugin->fwCtx->listeners), SIGNAL(frameworkEvent(ctkPluginFrameworkEvent)), method, type);
|
|
|
|
|
|
+ return receiver->connect(&(d->plugin->fwCtx->listeners), SIGNAL(frameworkEvent(ctkPluginFrameworkEvent)), slot, type);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//----------------------------------------------------------------------------
|
|
|
|
+void ctkPluginContext::disconnectFrameworkListener(const QObject *receiver, const char* slot)
|
|
|
|
+{
|
|
|
|
+ Q_D(ctkPluginContext);
|
|
|
|
+ d->isPluginContextValid();
|
|
|
|
+
|
|
|
|
+ QObject::disconnect(&(d->plugin->fwCtx->listeners), SIGNAL(frameworkEvent(ctkPluginFrameworkEvent)), receiver, slot);
|
|
}
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
//----------------------------------------------------------------------------
|