[gnome-builder] libide/core: handle G_SETTINGS_BIND_DEFAULT



commit 47e25db075a55657553d6ea86f23d54c69faa7a7
Author: Christian Hergert <chergert redhat com>
Date:   Fri Aug 12 17:09:13 2022 -0700

    libide/core: handle G_SETTINGS_BIND_DEFAULT
    
    We need to synthetically insert BIND_GET/BIND_SET for the cases where the
    default bindability was used.

 src/libide/core/ide-layered-settings.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/libide/core/ide-layered-settings.c b/src/libide/core/ide-layered-settings.c
index 2bad077ff..c8032490e 100644
--- a/src/libide/core/ide-layered-settings.c
+++ b/src/libide/core/ide-layered-settings.c
@@ -473,11 +473,17 @@ ide_layered_settings_bind_with_mapping (IdeLayeredSettings      *self,
                                         gpointer                 user_data,
                                         GDestroyNotify           destroy)
 {
+  static const GSettingsBindFlags default_flags = G_SETTINGS_BIND_GET|G_SETTINGS_BIND_SET;
+
   g_return_if_fail (IDE_IS_LAYERED_SETTINGS (self));
   g_return_if_fail (key != NULL);
   g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (property != NULL);
 
+  /* Make sure we have GET|SET flags if DEFAULT was specified */
+  if ((flags & default_flags) == 0)
+    flags |= default_flags;
+
   /*
    * Our memory backend/settings are compiling the values from all of the
    * layers. Therefore, we only want to map reads from the memory backend. We


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