g_object_unref (main_icon);
}
+ else
+ icon = NULL;
g_variant_iter_free (emblems);
g_variant_unref (icon_data);
return icon;
}
+/**
+ * g_icon_deserialize:
+ * @value: a #GVariant created with g_icon_serialize()
+ *
+ * Deserializes a #GIcon previously serialized using g_icon_serialize().
+ *
+ * Returns: (transfer full): a #GIcon, or %NULL when deserialization fails.
+ *
+ * Since: 2.38
+ */
GIcon *
g_icon_deserialize (GVariant *value)
{
return icon;
}
+/**
+ * g_icon_serialize:
+ * @icon: a #GIcon
+ *
+ * Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved
+ * back by calling g_icon_deserialize() on the returned value.
+ * As serialization will avoid using raw icon data when possible, it only
+ * makes sense to transfer the #GVariant between processes on the same machine,
+ * (as opposed to over the network), and within the same file system namespace.
+ *
+ * Returns: (transfer full): a #GVariant, or %NULL when serialization fails.
+ *
+ * Since: 2.38
+ */
GVariant *
g_icon_serialize (GIcon *icon)
{
if (!iface->serialize)
{
- g_critical ("g_icon_serialize() on icon type `%s' is not implemented", G_OBJECT_TYPE_NAME (icon));
+ g_critical ("g_icon_serialize() on icon type '%s' is not implemented", G_OBJECT_TYPE_NAME (icon));
return NULL;
}
if (!g_variant_is_of_type (result, G_VARIANT_TYPE ("(sv)")))
{
- g_critical ("g_icon_serialize() on icon type `%s' returned GVariant of type `%s' but it must return "
- "one with type `(sv)'", G_OBJECT_TYPE_NAME (icon), g_variant_get_type_string (result));
+ g_critical ("g_icon_serialize() on icon type '%s' returned GVariant of type '%s' but it must return "
+ "one with type '(sv)'", G_OBJECT_TYPE_NAME (icon), g_variant_get_type_string (result));
g_variant_unref (result);
result = NULL;
}