[gnome-packagekit/gnome-2-30] Ensure gpk_dbus_task_get_package_for_exec() returns a package name rather than a package_id
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit/gnome-2-30] Ensure gpk_dbus_task_get_package_for_exec() returns a package name rather than a package_id
- Date: Wed, 7 Apr 2010 08:59:32 +0000 (UTC)
commit d4e38e574ad7e1e405eeddbdd9cae9a773f83226
Author: Richard Hughes <richard hughsie com>
Date: Tue Apr 6 16:38:13 2010 +0100
Ensure gpk_dbus_task_get_package_for_exec() returns a package name rather than a package_id
src/gpk-dbus-task.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/gpk-dbus-task.c b/src/gpk-dbus-task.c
index 6dc9101..45440b7 100644
--- a/src/gpk-dbus-task.c
+++ b/src/gpk-dbus-task.c
@@ -2898,12 +2898,14 @@ out:
static gchar *
gpk_dbus_task_get_package_for_exec (GpkDbusTask *dtask, const gchar *exec)
{
+ const gchar *package_id;
gchar *package = NULL;
GError *error = NULL;
GPtrArray *array = NULL;
PkPackage *item;
PkResults *results = NULL;
gchar **values = NULL;
+ gchar **split = NULL;
/* find the package name */
values = g_strsplit (exec, "&", -1);
@@ -2930,12 +2932,13 @@ gpk_dbus_task_get_package_for_exec (GpkDbusTask *dtask, const gchar *exec)
/* copy name */
item = g_ptr_array_index (array, 0);
- g_object_get (item,
- "package-id", &package,
- NULL);
+ package_id = pk_package_get_id (item);
+ split = pk_package_id_split (package_id);
+ package = g_strdup (split[0]);
egg_debug ("got package %s", package);
out:
g_strfreev (values);
+ g_strfreev (split);
if (array != NULL)
g_ptr_array_unref (array);
if (results != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]