diff options
author | Victor Kareh <[email protected]> | 2025-08-01 20:46:48 -0400 |
---|---|---|
committer | Oz Tiram <[email protected]> | 2025-08-03 15:39:12 +0200 |
commit | 29a8742080dab02afbe6f7e453a7525c54be946e (patch) | |
tree | ab42a3f0726a3b6107ce62b850ebb7835966cb2f | |
parent | bf07a6614e91646ecea248db003a576c3d85ad95 (diff) | |
download | mate-panel-29a8742080dab02afbe6f7e453a7525c54be946e.tar.bz2 mate-panel-29a8742080dab02afbe6f7e453a7525c54be946e.tar.xz |
clock: Provide fallback preferences path
Provide a fallback preferences path in case the applet doesn't provide
one. This happens when running outside the actual panel, like in the
case of mate-panel-test-applets.
-rw-r--r-- | applets/clock/clock.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/applets/clock/clock.c b/applets/clock/clock.c index 41bb49b0..4b7920c1 100644 --- a/applets/clock/clock.c +++ b/applets/clock/clock.c @@ -863,8 +863,19 @@ create_calendar (ClockData *cd) { GtkWidget *window; char *prefs_path; + char *fallback_path = NULL; prefs_path = mate_panel_applet_get_preferences_path (MATE_PANEL_APPLET (cd->applet)); + + /* Provide a fallback preferences path in case the applet doesn't + * provide one. This happens when running outside the actual panel, + * like in mate-panel-test-applets */ + if (!prefs_path || !prefs_path[0]) { + fallback_path = g_strdup ("/org/mate/panel/applets/clock/"); + g_free (prefs_path); + prefs_path = fallback_path; + } + window = calendar_window_new (&cd->current_time, prefs_path, cd->orient == MATE_PANEL_APPLET_ORIENT_UP, |