Commit 4c19b0bb authored by Guido Günther's avatar Guido Günther

HdyComboRow: Don't use g_autoptr for GEnumClass

g_autoptr for GEnumClass was added post 2.56, so using it makes it
harder for people to package for distros. Not using g_autoptr there
doesn't make the code much less readable.
parent a8fdc9c9
Pipeline #3397 passed with stage
in 3 minutes and 19 seconds
......@@ -479,15 +479,18 @@ hdy_combo_row_set_for_enum (HdyComboRow *self,
GDestroyNotify user_data_free_func)
{
g_autoptr (GListStore) store = g_list_store_new (HDY_TYPE_ENUM_VALUE_OBJECT);
g_autoptr (GEnumClass) enum_class = g_type_class_ref (enum_type);
/* g_autoptr for GEnumClass would require glib > 2.56 */
GEnumClass *enum_class = NULL;
gsize i;
g_return_if_fail (HDY_IS_COMBO_ROW (self));
enum_class = g_type_class_ref (enum_type);
for (i = 0; i < enum_class->n_values; i++)
g_list_store_append (store, hdy_enum_value_object_new (&enum_class->values[i]));
hdy_combo_row_bind_name_model (self, G_LIST_MODEL (store), (HdyComboRowGetNameFunc) get_name_func, user_data, user_data_free_func);
g_type_class_unref (enum_class);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment