core: Get week start day from GcalContext
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/822>
This commit is contained in:
@@ -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:
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user