[gnome-builder/gnome-builder-43] plugins/flatpak: use ide_set_string()



commit 7d07a8d3dc385c2368788b242ee4d7efde89f8e7
Author: Christian Hergert <chergert redhat com>
Date:   Thu Sep 29 17:48:42 2022 -0700

    plugins/flatpak: use ide_set_string()

 src/plugins/flatpak/gbp-flatpak-runtime.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-runtime.c b/src/plugins/flatpak/gbp-flatpak-runtime.c
index 052d64df1..91b379f8d 100644
--- a/src/plugins/flatpak/gbp-flatpak-runtime.c
+++ b/src/plugins/flatpak/gbp-flatpak-runtime.c
@@ -652,12 +652,8 @@ gbp_flatpak_runtime_set_branch (GbpFlatpakRuntime *self,
 {
   g_return_if_fail (GBP_IS_FLATPAK_RUNTIME (self));
 
-  if (g_strcmp0 (branch, self->branch) != 0)
-    {
-      g_free (self->branch);
-      self->branch = g_strdup (branch);
-      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_BRANCH]);
-    }
+  if (ide_set_string (&self->branch, branch))
+    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_BRANCH]);
 }
 
 const char *
@@ -674,9 +670,8 @@ gbp_flatpak_runtime_set_platform (GbpFlatpakRuntime *self,
 {
   g_return_if_fail (GBP_IS_FLATPAK_RUNTIME (self));
 
-  g_free (self->platform);
-  self->platform = g_strdup (platform);
-  g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_PLATFORM]);
+  if (ide_set_string (&self->platform, platform))
+    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_PLATFORM]);
 }
 
 const char *


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