core: Get week start day from GcalContext

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
This commit is contained in:
mindonwarp
2026-09-26 17:21:59 +00:00
committed by Marge Bot
parent c874bde622
commit 059d72499f
2 changed files with 26 additions and 0 deletions
+23
View File
@@ -509,6 +509,29 @@ gcal_context_get_time_format (GcalContext *self)
return self->time_format;
}
/**
* gcal_context_get_week_start_day:
* @self: a #GcalContext instance
*
* Retrieves the current value of "week-start-day" desktop setting.
* Note that this value is synced with the source setting through
* the appropriate portal and if you want to be notified of changes
* you should register a callback on #GcalContext:week-start-day property.
*
* When the desktop setting is set to 'G_DESKTOP_WEEKDAY_DEFAULT'
* we fall back to 'get_first_weekday_iso()' function from 'gcal-utils.h'
* to find the actual day of the week from current locale.
*
* Returns: the currently set #GDesktopWeekday value
*/
GDesktopWeekday
gcal_context_get_week_start_day (GcalContext *self)
{
g_return_val_if_fail (GCAL_IS_CONTEXT (self), get_first_weekday ());
return self->week_start_day;
}
/**
* gcal_context_get_timezone:
*
+3
View File
@@ -24,6 +24,7 @@
#include "gcal-enums.h"
#include "gcal-manager.h"
#include "gcal-search-engine.h"
#include "gdesktop-enums.h"
#include "weather/gcal-weather-service.h"
#include <glib-object.h>
@@ -45,6 +46,8 @@ GSettings* gcal_context_get_settings (GcalContext
GcalTimeFormat gcal_context_get_time_format (GcalContext *self);
GDesktopWeekday gcal_context_get_week_start_day (GcalContext *self);
GTimeZone* gcal_context_get_timezone (GcalContext *self);
GcalWeatherService* gcal_context_get_weather_service (GcalContext *self);