power: Move variant_lookup_string() helper function
This commit is contained in:
parent
eda473f0d6
commit
05997b424c
1 changed files with 12 additions and 12 deletions
|
@ -1343,6 +1343,18 @@ setup_power_saving (CcPowerPanel *self)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
variant_lookup_string (GVariant *dict,
|
||||||
|
const char *key)
|
||||||
|
{
|
||||||
|
GVariant *variant;
|
||||||
|
|
||||||
|
variant = g_variant_lookup_value (dict, key, G_VARIANT_TYPE_STRING);
|
||||||
|
if (!variant)
|
||||||
|
return NULL;
|
||||||
|
return g_variant_get_string (variant, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
performance_profile_set_active (CcPowerPanel *self,
|
performance_profile_set_active (CcPowerPanel *self,
|
||||||
const char *profile_str)
|
const char *profile_str)
|
||||||
|
@ -1427,18 +1439,6 @@ perf_profile_list_box_sort (GtkListBoxRow *row1,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
|
||||||
variant_lookup_string (GVariant *dict,
|
|
||||||
const char *key)
|
|
||||||
{
|
|
||||||
GVariant *variant;
|
|
||||||
|
|
||||||
variant = g_variant_lookup_value (dict, key, G_VARIANT_TYPE_STRING);
|
|
||||||
if (!variant)
|
|
||||||
return NULL;
|
|
||||||
return g_variant_get_string (variant, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
power_profiles_properties_changed_cb (CcPowerPanel *self,
|
power_profiles_properties_changed_cb (CcPowerPanel *self,
|
||||||
GVariant *changed_properties,
|
GVariant *changed_properties,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue