user-controls: Tweak the API of an internal helper function
Make it take a `MctUserControls` rather than a member of it. This introduces no functional changes, but will make some upcoming refactoring easier. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
608444891f
commit
3519ac2dc1
|
@ -145,11 +145,11 @@ static const gchar * const oars_categories[] =
|
||||||
/* Auxiliary methods */
|
/* Auxiliary methods */
|
||||||
|
|
||||||
static GsContentRatingSystem
|
static GsContentRatingSystem
|
||||||
get_content_rating_system (ActUser *user)
|
get_content_rating_system (MctUserControls *self)
|
||||||
{
|
{
|
||||||
const gchar *user_language;
|
const gchar *user_language;
|
||||||
|
|
||||||
user_language = act_user_get_language (user);
|
user_language = act_user_get_language (self->user);
|
||||||
|
|
||||||
return gs_utils_content_rating_system_from_locale (user_language);
|
return gs_utils_content_rating_system_from_locale (user_language);
|
||||||
}
|
}
|
||||||
|
@ -244,7 +244,7 @@ update_categories_from_language (MctUserControls *self)
|
||||||
gsize i;
|
gsize i;
|
||||||
g_autofree gchar *disabled_action = NULL;
|
g_autofree gchar *disabled_action = NULL;
|
||||||
|
|
||||||
rating_system = get_content_rating_system (self->user);
|
rating_system = get_content_rating_system (self);
|
||||||
rating_system_str = gs_content_rating_system_to_str (rating_system);
|
rating_system_str = gs_content_rating_system_to_str (rating_system);
|
||||||
|
|
||||||
g_debug ("Using rating system %s", rating_system_str);
|
g_debug ("Using rating system %s", rating_system_str);
|
||||||
|
@ -324,7 +324,7 @@ update_oars_level (MctUserControls *self)
|
||||||
g_debug ("Effective age for this user: %u; %s", maximum_age,
|
g_debug ("Effective age for this user: %u; %s", maximum_age,
|
||||||
all_categories_unset ? "all categories unset" : "some categories set");
|
all_categories_unset ? "all categories unset" : "some categories set");
|
||||||
|
|
||||||
rating_system = get_content_rating_system (self->user);
|
rating_system = get_content_rating_system (self);
|
||||||
rating_age_category = gs_utils_content_rating_age_to_str (rating_system, maximum_age);
|
rating_age_category = gs_utils_content_rating_age_to_str (rating_system, maximum_age);
|
||||||
|
|
||||||
/* Unrestricted? */
|
/* Unrestricted? */
|
||||||
|
@ -616,7 +616,7 @@ on_set_age_action_activated (GSimpleAction *action,
|
||||||
self = MCT_USER_CONTROLS (user_data);
|
self = MCT_USER_CONTROLS (user_data);
|
||||||
age = g_variant_get_uint32 (param);
|
age = g_variant_get_uint32 (param);
|
||||||
|
|
||||||
rating_system = get_content_rating_system (self->user);
|
rating_system = get_content_rating_system (self);
|
||||||
entries = gs_utils_content_rating_get_values (rating_system);
|
entries = gs_utils_content_rating_get_values (rating_system);
|
||||||
ages = gs_utils_content_rating_get_ages (rating_system);
|
ages = gs_utils_content_rating_get_ages (rating_system);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue