[gnome-builder] plugins/flatpak: use ide_set_string()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/flatpak: use ide_set_string()
- Date: Fri, 30 Sep 2022 00:53:53 +0000 (UTC)
commit 0964cef245dbb4d08eb2513b51e3dab365bbf109
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]