[gnome-builder] plugins: use ide_extension_new and ide_extension_set_new
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins: use ide_extension_new and ide_extension_set_new
- Date: Sat, 11 Mar 2017 10:09:20 +0000 (UTC)
commit 48f0e18fdfb1587f7320cafdf311edb6e6e20549
Author: Christian Hergert <chergert redhat com>
Date: Sat Mar 11 01:48:06 2017 -0800
plugins: use ide_extension_new and ide_extension_set_new
Instead of using peas for creating the extension sets, use our wrapper so
that we can handle the case where the property comes from the
pre-requisite class instead of the interface.
https://bugzilla.gnome.org/show_bug.cgi?id=779891
libide/plugins/ide-extension-adapter.c | 18 +++++++++---------
libide/plugins/ide-extension-set-adapter.c | 17 ++++++++++++-----
2 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/libide/plugins/ide-extension-adapter.c b/libide/plugins/ide-extension-adapter.c
index 34b6c6e..c7bfc8e 100644
--- a/libide/plugins/ide-extension-adapter.c
+++ b/libide/plugins/ide-extension-adapter.c
@@ -162,16 +162,16 @@ ide_extension_adapter_reload (IdeExtensionAdapter *self)
IdeContext *context = ide_object_get_context (IDE_OBJECT (self));
if (g_type_is_a (self->interface_type, IDE_TYPE_OBJECT))
- extension = peas_engine_create_extension (self->engine,
- best_match,
- self->interface_type,
- "context", context,
- NULL);
+ extension = ide_extension_new (self->engine,
+ best_match,
+ self->interface_type,
+ "context", context,
+ NULL);
else
- extension = peas_engine_create_extension (self->engine,
- best_match,
- self->interface_type,
- NULL);
+ extension = ide_extension_new (self->engine,
+ best_match,
+ self->interface_type,
+ NULL);
}
ide_extension_adapter_set_extension (self, best_match, extension);
diff --git a/libide/plugins/ide-extension-set-adapter.c b/libide/plugins/ide-extension-set-adapter.c
index e09aed2..143a127 100644
--- a/libide/plugins/ide-extension-set-adapter.c
+++ b/libide/plugins/ide-extension-set-adapter.c
@@ -176,11 +176,18 @@ ide_extension_set_adapter_reload (IdeExtensionSetAdapter *self)
{
PeasExtension *exten;
- exten = peas_engine_create_extension (self->engine,
- plugin_info,
- self->interface_type,
- "context", context,
- NULL);
+ if (g_type_is_a (self->interface_type, IDE_TYPE_OBJECT))
+ exten = ide_extension_new (self->engine,
+ plugin_info,
+ self->interface_type,
+ "context", context,
+ NULL);
+ else
+ exten = ide_extension_new (self->engine,
+ plugin_info,
+ self->interface_type,
+ NULL);
+
add_extension (self, plugin_info, exten);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]