[gnome-builder/wip/gtk4-port: 875/1774] libide/gui: use new scope helper




commit a797c27bdfaa5724009823cfe43ad2450551c431
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 5 16:57:37 2022 -0700

    libide/gui: use new scope helper

 src/libide/gui/ide-shortcut-bundle.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/libide/gui/ide-shortcut-bundle.c b/src/libide/gui/ide-shortcut-bundle.c
index 080592d6f..3c5d223d8 100644
--- a/src/libide/gui/ide-shortcut-bundle.c
+++ b/src/libide/gui/ide-shortcut-bundle.c
@@ -100,11 +100,10 @@ set_object (TmplScope  *scope,
             GType       type,
             gpointer    object)
 {
-  g_auto(GValue) value = G_VALUE_INIT;
-
-  g_value_init (&value, type);
-  g_value_set_object (&value, object);
-  tmpl_scope_set_value (scope, name, &value);
+  if (object != NULL)
+    tmpl_scope_set_object (scope, name, object);
+  else
+    tmpl_scope_set_null (scope, name);
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]