mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 18:52:09 +01:00
GSettingsSchemaKey: getters for type and default
Add getters for the type of the key and the default value.
This commit is contained in:
parent
3d7eb20726
commit
0395710814
@ -2412,6 +2412,10 @@ g_settings_schema_get_key
|
||||
g_settings_schema_key_ref
|
||||
g_settings_schema_key_unref
|
||||
|
||||
<SUBSECTION>
|
||||
g_settings_schema_key_get_value_type
|
||||
g_settings_schema_key_get_default_value
|
||||
|
||||
<SUBSECTION>
|
||||
g_settings_schema_key_get_summary
|
||||
g_settings_schema_key_get_description
|
||||
|
@ -1497,3 +1497,38 @@ g_settings_schema_key_get_description (GSettingsSchemaKey *key)
|
||||
|
||||
return descriptions ? g_hash_table_lookup (descriptions, key->name) : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_settings_schema_key_get_value_type:
|
||||
* @key: a #GSettingsSchemaKey
|
||||
*
|
||||
* Gets the #GVariantType of @key.
|
||||
*
|
||||
* Returns: (transfer none): the type of @key
|
||||
*
|
||||
* Since: 2.40
|
||||
**/
|
||||
const GVariantType *
|
||||
g_settings_schema_key_get_value_type (GSettingsSchemaKey *key)
|
||||
{
|
||||
return g_variant_get_type (key->default_value);
|
||||
}
|
||||
|
||||
/**
|
||||
* g_settings_schema_key_get_default_value:
|
||||
* @key: a #GSettingsSchemaKey
|
||||
*
|
||||
* Gets the default value for @key.
|
||||
*
|
||||
* Note that this is the default value according to the schema. System
|
||||
* administrator defaults and lockdown are not visible via this API.
|
||||
*
|
||||
* Returns: (transfer none): the default value for the key
|
||||
*
|
||||
* Since: 2.40
|
||||
**/
|
||||
GVariant *
|
||||
g_settings_schema_key_get_default_value (GSettingsSchemaKey *key)
|
||||
{
|
||||
return key->default_value;
|
||||
}
|
||||
|
@ -77,6 +77,11 @@ GSettingsSchemaKey * g_settings_schema_key_ref (GSettin
|
||||
GLIB_AVAILABLE_IN_2_40
|
||||
void g_settings_schema_key_unref (GSettingsSchemaKey *key);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_40
|
||||
const GVariantType * g_settings_schema_key_get_value_type (GSettingsSchemaKey *key);
|
||||
GLIB_AVAILABLE_IN_2_40
|
||||
GVariant * g_settings_schema_key_get_default_value (GSettingsSchemaKey *key);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_40
|
||||
const gchar * g_settings_schema_key_get_summary (GSettingsSchemaKey *key);
|
||||
GLIB_AVAILABLE_IN_2_40
|
||||
|
Loading…
x
Reference in New Issue
Block a user