[gnome-builder/wip/chergert/pipeline-merge] flatpak: check sdk property before overwriting



commit 1fdfd6b4ee4c81da959bd21ec5de792d5be3d405
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 9 18:35:28 2017 -0800

    flatpak: check sdk property before overwriting
    
    We want to avoid unnecessary property notification as well as ensure that
    sdk and self->sdk are not the same pointers.

 plugins/flatpak/gbp-flatpak-configuration.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/plugins/flatpak/gbp-flatpak-configuration.c b/plugins/flatpak/gbp-flatpak-configuration.c
index 6929709..22db4c5 100644
--- a/plugins/flatpak/gbp-flatpak-configuration.c
+++ b/plugins/flatpak/gbp-flatpak-configuration.c
@@ -183,9 +183,12 @@ gbp_flatpak_configuration_set_sdk (GbpFlatpakConfiguration *self,
 {
   g_return_if_fail (GBP_IS_FLATPAK_CONFIGURATION (self));
 
-  g_free (self->sdk);
-  self->sdk = g_strdup (sdk);
-  g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SDK]);
+  if (g_strcmp0 (self->sdk, sdk) != 0)
+    {
+      g_free (self->sdk);
+      self->sdk = g_strdup (sdk);
+      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_SDK]);
+    }
 }
 
 static void


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