[gnome-builder] libide/editor: handle IdeEditorPageAddin which are GActionGroup
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide/editor: handle IdeEditorPageAddin which are GActionGroup
- Date: Thu, 15 Sep 2022 21:22:12 +0000 (UTC)
commit eb0e01299c711b1a48b4f943b36b9fcb3466e66a
Author: Christian Hergert <chergert redhat com>
Date: Thu Sep 15 14:18:50 2022 -0700
libide/editor: handle IdeEditorPageAddin which are GActionGroup
This just simplifies implementing the addins since you can use
IDE_DEFINE_ACTION_GROUP() to implement the action group directly on the
addin object.
src/libide/editor/ide-editor-page-addin.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/src/libide/editor/ide-editor-page-addin.c b/src/libide/editor/ide-editor-page-addin.c
index 2347295e1..4b13eb7fa 100644
--- a/src/libide/editor/ide-editor-page-addin.c
+++ b/src/libide/editor/ide-editor-page-addin.c
@@ -29,9 +29,19 @@
G_DEFINE_INTERFACE (IdeEditorPageAddin, ide_editor_page_addin, G_TYPE_OBJECT)
+static GActionGroup *
+ide_editor_page_addin_real_ref_action_group (IdeEditorPageAddin *addin)
+{
+ if (G_IS_ACTION_GROUP (addin))
+ return g_object_ref (G_ACTION_GROUP (addin));
+
+ return NULL;
+}
+
static void
ide_editor_page_addin_default_init (IdeEditorPageAddinInterface *iface)
{
+ iface->ref_action_group = ide_editor_page_addin_real_ref_action_group;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]