PolicyKit: Branch 'master' - 2 commits
David Zeuthen
david at kemper.freedesktop.org
Tue Jun 2 09:28:07 PDT 2009
docs/polkit/polkit-1-sections.txt | 2 -
src/nullbackend/polkitbackendnullauthority.c | 4 +--
src/polkit/polkitactiondescription.c | 30 ++----------------------
src/polkit/polkitactiondescription.h | 2 -
src/polkitbackend/polkitbackendlocalauthority.c | 8 ------
src/programs/polkit.c | 13 +++-------
6 files changed, 12 insertions(+), 47 deletions(-)
New commits:
commit 048b42073c096064904148deeaeb2ef7764225de
Author: David Zeuthen <davidz at redhat.com>
Date: Tue Jun 2 12:25:17 2009 -0400
Return the icon name instead of a GIcon in PolkitActionDescription
diff --git a/docs/polkit/polkit-1-sections.txt b/docs/polkit/polkit-1-sections.txt
index 42da5d3..46eedbb 100644
--- a/docs/polkit/polkit-1-sections.txt
+++ b/docs/polkit/polkit-1-sections.txt
@@ -225,7 +225,7 @@ polkit_action_description_get_description
polkit_action_description_get_message
polkit_action_description_get_vendor_name
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_inactive
polkit_action_description_get_implicit_active
diff --git a/src/polkit/polkitactiondescription.c b/src/polkit/polkitactiondescription.c
index 44e14a1..f022114 100644
--- a/src/polkit/polkitactiondescription.c
+++ b/src/polkit/polkitactiondescription.c
@@ -45,8 +45,6 @@ struct _PolkitActionDescription
_PolkitActionDescription *real;
gchar **annotation_keys;
-
- GIcon *icon;
};
struct _PolkitActionDescriptionClass
@@ -72,9 +70,6 @@ polkit_action_description_finalize (GObject *object)
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)
G_OBJECT_CLASS (polkit_action_description_parent_class)->finalize (object);
}
@@ -153,29 +148,10 @@ polkit_action_description_get_implicit_active (PolkitActionDescription *action_d
}
-GIcon *
-polkit_action_description_get_icon (PolkitActionDescription *action_description)
+const gchar *
+polkit_action_description_get_icon_name (PolkitActionDescription *action_description)
{
- const gchar *icon_name;
- 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;
+ return _polkit_action_description_get_icon_name (action_description->real);
}
const gchar *
diff --git a/src/polkit/polkitactiondescription.h b/src/polkit/polkitactiondescription.h
index 57734af..c900624 100644
--- a/src/polkit/polkitactiondescription.h
+++ b/src/polkit/polkitactiondescription.h
@@ -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_vendor_name (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_inactive (PolkitActionDescription *action_description);
diff --git a/src/polkitbackend/polkitbackendlocalauthority.c b/src/polkitbackend/polkitbackendlocalauthority.c
index 28021d6..42b6d30 100644
--- a/src/polkitbackend/polkitbackendlocalauthority.c
+++ b/src/polkitbackend/polkitbackendlocalauthority.c
@@ -1614,13 +1614,7 @@ get_localized_data_for_challenge (PolkitBackendLocalAuthority *authority,
}
if (icon_name == NULL)
{
- GIcon *icon;
- icon = polkit_action_description_get_icon (action_desc);
- if (icon != NULL)
- {
- icon_name = g_icon_to_string (icon);
- //g_object_unref (icon);
- }
+ icon_name = g_strdup (polkit_action_description_get_icon_name (action_desc));
}
diff --git a/src/programs/polkit.c b/src/programs/polkit.c
index bff32b5..88d4c63 100644
--- a/src/programs/polkit.c
+++ b/src/programs/polkit.c
@@ -372,13 +372,13 @@ print_action (PolkitActionDescription *action)
{
const gchar *vendor;
const gchar *vendor_url;
- GIcon *icon;
+ const gchar *icon_name;
const gchar * const *annotation_keys;
guint n;
vendor = polkit_action_description_get_vendor_name (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 (" description: %s\n", polkit_action_description_get_description (action));
@@ -388,13 +388,8 @@ print_action (PolkitActionDescription *action)
if (vendor_url != NULL)
g_print (" vendor_url: %s\n", vendor_url);
- if (icon != NULL)
- {
- gchar *s;
- s = g_icon_to_string (icon);
- g_print (" icon: %s\n", s);
- g_free (s);
- }
+ if (icon_name != NULL)
+ g_print (" icon: %s\n", icon_name);
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)));
commit 0d3aef69722d615a76f9e2b69215e905193db202
Author: David Zeuthen <davidz at redhat.com>
Date: Tue Jun 2 12:24:48 2009 -0400
nullbackend: Catch up with latest API changes
diff --git a/src/nullbackend/polkitbackendnullauthority.c b/src/nullbackend/polkitbackendnullauthority.c
index 5e65010..ae91331 100644
--- a/src/nullbackend/polkitbackendnullauthority.c
+++ b/src/nullbackend/polkitbackendnullauthority.c
@@ -42,7 +42,7 @@ static void authority_check_authorization (PolkitBackendAuthority *author
PolkitSubject *caller,
PolkitSubject *subject,
const gchar *action_id,
- GHashTable *details,
+ PolkitDetails *details,
PolkitCheckAuthorizationFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -137,7 +137,7 @@ authority_check_authorization (PolkitBackendAuthority *authority,
PolkitSubject *caller,
PolkitSubject *subject,
const gchar *action_id,
- GHashTable *details,
+ PolkitDetails *details,
PolkitCheckAuthorizationFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
More information about the hal-commit
mailing list