summaryrefslogtreecommitdiff
path: root/applets/clock/calendar-window.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-11-28 13:19:58 +0100
committerLuke from DC <[email protected]>2021-12-16 06:52:11 +0000
commit6fbabd51619c92bcd8584e1bb2f12f2b52904ea6 (patch)
tree540229310cf7f6d6b60e82fcd2952a6caec31a4a /applets/clock/calendar-window.c
parent94f3ec8c654363cd6a245eb9dca7c54f1b8f5649 (diff)
downloadmate-panel-6fbabd51619c92bcd8584e1bb2f12f2b52904ea6.tar.bz2
mate-panel-6fbabd51619c92bcd8584e1bb2f12f2b52904ea6.tar.xz
Use g_clear_pointer() and g_clear_object()
Diffstat (limited to 'applets/clock/calendar-window.c')
-rw-r--r--applets/clock/calendar-window.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/applets/clock/calendar-window.c b/applets/clock/calendar-window.c
index 8fe2c77c..11003d28 100644
--- a/applets/clock/calendar-window.c
+++ b/applets/clock/calendar-window.c
@@ -617,17 +617,15 @@ calendar_window_set_prefs_path (CalendarWindow *calwin,
!strcmp (calwin->priv->prefs_path, prefs_path))
return;
- if (calwin->priv->prefs_path)
- g_free (calwin->priv->prefs_path);
- calwin->priv->prefs_path = NULL;
-
+ g_free (calwin->priv->prefs_path);
if (prefs_path && prefs_path [0])
calwin->priv->prefs_path = g_strdup (prefs_path);
+ else
+ calwin->priv->prefs_path = NULL;
g_object_notify (G_OBJECT (calwin), "prefs-path");
if (calwin->priv->settings)
g_object_unref (calwin->priv->settings);
-
calwin->priv->settings = g_settings_new_with_path (CLOCK_SCHEMA, calwin->priv->prefs_path);
}