Commit 70cf9a93 authored by Christian Hergert's avatar Christian Hergert
Browse files

plugins: try harder to set IdeObject:context property

If we create a plugin whose interface does not require IdeObject but
plugin inherits from IdeObject, ensure we set the context property.
parent b4f719b0
......@@ -168,10 +168,19 @@ ide_extension_adapter_reload (IdeExtensionAdapter *self)
"context", context,
NULL);
else
extension = ide_extension_new (self->engine,
best_match,
self->interface_type,
NULL);
{
extension = ide_extension_new (self->engine,
best_match,
self->interface_type,
NULL);
/*
* If the plugin object turned out to have IdeObject
* as a base, try to set it now (even though we couldn't
* do it at construction time).
*/
if (IDE_IS_OBJECT (extension))
ide_object_set_context (IDE_OBJECT (extension), context);
}
}
ide_extension_adapter_set_extension (self, best_match, extension);
......
......@@ -183,10 +183,19 @@ ide_extension_set_adapter_reload (IdeExtensionSetAdapter *self)
"context", context,
NULL);
else
exten = ide_extension_new (self->engine,
plugin_info,
self->interface_type,
NULL);
{
exten = ide_extension_new (self->engine,
plugin_info,
self->interface_type,
NULL);
/*
* If the plugin object turned out to have IdeObject
* as a base, try to set it now (even though we couldn't
* do it at construction time).
*/
if (IDE_IS_OBJECT (exten))
ide_object_set_context (IDE_OBJECT (exten), context);
}
add_extension (self, plugin_info, exten);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment