Commit 048b4207 authored by David Zeuthen's avatar David Zeuthen

Return the icon name instead of a GIcon in PolkitActionDescription

parent 0d3aef69
...@@ -225,7 +225,7 @@ polkit_action_description_get_description ...@@ -225,7 +225,7 @@ polkit_action_description_get_description
polkit_action_description_get_message polkit_action_description_get_message
polkit_action_description_get_vendor_name polkit_action_description_get_vendor_name
polkit_action_description_get_vendor_url polkit_action_description_get_vendor_url
polkit_action_description_get_icon polkit_action_description_get_icon_name
polkit_action_description_get_implicit_any polkit_action_description_get_implicit_any
polkit_action_description_get_implicit_inactive polkit_action_description_get_implicit_inactive
polkit_action_description_get_implicit_active polkit_action_description_get_implicit_active
......
...@@ -45,8 +45,6 @@ struct _PolkitActionDescription ...@@ -45,8 +45,6 @@ struct _PolkitActionDescription
_PolkitActionDescription *real; _PolkitActionDescription *real;
gchar **annotation_keys; gchar **annotation_keys;
GIcon *icon;
}; };
struct _PolkitActionDescriptionClass struct _PolkitActionDescriptionClass
...@@ -72,9 +70,6 @@ polkit_action_description_finalize (GObject *object) ...@@ -72,9 +70,6 @@ polkit_action_description_finalize (GObject *object)
g_strfreev (action_description->annotation_keys); g_strfreev (action_description->annotation_keys);
if (action_description->icon != NULL)
g_object_unref (action_description->icon);
if (G_OBJECT_CLASS (polkit_action_description_parent_class)->finalize != NULL) if (G_OBJECT_CLASS (polkit_action_description_parent_class)->finalize != NULL)
G_OBJECT_CLASS (polkit_action_description_parent_class)->finalize (object); G_OBJECT_CLASS (polkit_action_description_parent_class)->finalize (object);
} }
...@@ -153,29 +148,10 @@ polkit_action_description_get_implicit_active (PolkitActionDescription *action_d ...@@ -153,29 +148,10 @@ polkit_action_description_get_implicit_active (PolkitActionDescription *action_d
} }
GIcon * const gchar *
polkit_action_description_get_icon (PolkitActionDescription *action_description) polkit_action_description_get_icon_name (PolkitActionDescription *action_description)
{ {
const gchar *icon_name; return _polkit_action_description_get_icon_name (action_description->real);
GError *error;
if (action_description->icon != NULL)
goto out;
icon_name = _polkit_action_description_get_icon_name (action_description->real);
if (icon_name == NULL || strlen (icon_name) == 0)
goto out;
error = NULL;
action_description->icon = g_icon_new_for_string (icon_name, &error);
if (action_description->icon == NULL)
{
g_warning ("polkit_action_description_get_icon: %s", error->message);
g_error_free (error);
}
out:
return action_description->icon;
} }
const gchar * const gchar *
......
...@@ -50,7 +50,7 @@ const gchar *polkit_action_description_get_description (PolkitActi ...@@ -50,7 +50,7 @@ const gchar *polkit_action_description_get_description (PolkitActi
const gchar *polkit_action_description_get_message (PolkitActionDescription *action_description); const gchar *polkit_action_description_get_message (PolkitActionDescription *action_description);
const gchar *polkit_action_description_get_vendor_name (PolkitActionDescription *action_description); const gchar *polkit_action_description_get_vendor_name (PolkitActionDescription *action_description);
const gchar *polkit_action_description_get_vendor_url (PolkitActionDescription *action_description); const gchar *polkit_action_description_get_vendor_url (PolkitActionDescription *action_description);
GIcon *polkit_action_description_get_icon (PolkitActionDescription *action_description); const gchar *polkit_action_description_get_icon_name (PolkitActionDescription *action_description);
PolkitImplicitAuthorization polkit_action_description_get_implicit_any (PolkitActionDescription *action_description); PolkitImplicitAuthorization polkit_action_description_get_implicit_any (PolkitActionDescription *action_description);
PolkitImplicitAuthorization polkit_action_description_get_implicit_inactive (PolkitActionDescription *action_description); PolkitImplicitAuthorization polkit_action_description_get_implicit_inactive (PolkitActionDescription *action_description);
......
...@@ -1614,13 +1614,7 @@ get_localized_data_for_challenge (PolkitBackendLocalAuthority *authority, ...@@ -1614,13 +1614,7 @@ get_localized_data_for_challenge (PolkitBackendLocalAuthority *authority,
} }
if (icon_name == NULL) if (icon_name == NULL)
{ {
GIcon *icon; icon_name = g_strdup (polkit_action_description_get_icon_name (action_desc));
icon = polkit_action_description_get_icon (action_desc);
if (icon != NULL)
{
icon_name = g_icon_to_string (icon);
//g_object_unref (icon);
}
} }
......
...@@ -372,13 +372,13 @@ print_action (PolkitActionDescription *action) ...@@ -372,13 +372,13 @@ print_action (PolkitActionDescription *action)
{ {
const gchar *vendor; const gchar *vendor;
const gchar *vendor_url; const gchar *vendor_url;
GIcon *icon; const gchar *icon_name;
const gchar * const *annotation_keys; const gchar * const *annotation_keys;
guint n; guint n;
vendor = polkit_action_description_get_vendor_name (action); vendor = polkit_action_description_get_vendor_name (action);
vendor_url = polkit_action_description_get_vendor_url (action); vendor_url = polkit_action_description_get_vendor_url (action);
icon = polkit_action_description_get_icon (action); icon_name = polkit_action_description_get_icon_name (action);
g_print ("%s:\n", polkit_action_description_get_action_id (action)); g_print ("%s:\n", polkit_action_description_get_action_id (action));
g_print (" description: %s\n", polkit_action_description_get_description (action)); g_print (" description: %s\n", polkit_action_description_get_description (action));
...@@ -388,13 +388,8 @@ print_action (PolkitActionDescription *action) ...@@ -388,13 +388,8 @@ print_action (PolkitActionDescription *action)
if (vendor_url != NULL) if (vendor_url != NULL)
g_print (" vendor_url: %s\n", vendor_url); g_print (" vendor_url: %s\n", vendor_url);
if (icon != NULL) if (icon_name != NULL)
{ g_print (" icon: %s\n", icon_name);
gchar *s;
s = g_icon_to_string (icon);
g_print (" icon: %s\n", s);
g_free (s);
}
g_print (" implicit any: %s\n", polkit_implicit_authorization_to_string (polkit_action_description_get_implicit_any (action))); g_print (" implicit any: %s\n", polkit_implicit_authorization_to_string (polkit_action_description_get_implicit_any (action)));
g_print (" implicit inactive: %s\n", polkit_implicit_authorization_to_string (polkit_action_description_get_implicit_inactive (action))); g_print (" implicit inactive: %s\n", polkit_implicit_authorization_to_string (polkit_action_description_get_implicit_inactive (action)));
......
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