[gnome-packagekit/glib2: 3/79] Mo



commit dc82b2eb5606929a828d26f6fc059251c247ac5d
Author: Richard Hughes <richard hughsie com>
Date:   Wed Sep 9 17:07:41 2009 +0100

    Mo

 src/gpk-application.c           |   30 ++++++--------
 src/gpk-check-update.c          |   40 ++++++++-----------
 src/gpk-common.c                |   80 +++++----------------------------------
 src/gpk-common.h                |    1 -
 src/gpk-dbus-task.c             |   56 +++++++++++----------------
 src/gpk-firmware.c              |    7 +--
 src/gpk-hardware.c              |    4 +-
 src/gpk-helper-chooser.c        |   10 ++---
 src/gpk-helper-deps-install.c   |    8 +--
 src/gpk-helper-deps-remove.c    |    6 +--
 src/gpk-helper-deps-update.c    |   13 ++----
 src/gpk-helper-eula.c           |    9 ++--
 src/gpk-helper-repo-signature.c |    5 +--
 src/gpk-helper-run.c            |    5 +--
 src/gpk-log.c                   |   17 +++-----
 src/gpk-modal-dialog.c          |   28 +++++++-------
 src/gpk-service-pack.c          |    8 +--
 src/gpk-update-viewer.c         |   21 +++++-----
 src/gpk-watch.c                 |   22 ++++------
 19 files changed, 131 insertions(+), 239 deletions(-)
---
diff --git a/src/gpk-application.c b/src/gpk-application.c
index eea03b7..b491b95 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -995,7 +995,7 @@ gpk_application_add_obj_to_results (GpkApplication *application, const PkItemPac
 
 	/* are we in the package list? */
 	in_queue = pk_package_list_contains (application->priv->package_list, obj->package_id);
-	installed = (obj->info == PK_INFO_ENUM_INSTALLED) || (obj->info == PK_INFO_ENUM_COLLECTION_INSTALLED);
+	installed = (obj->info_enum == PK_INFO_ENUM_INSTALLED) || (obj->info == PK_INFO_ENUM_COLLECTION_INSTALLED);
 
 	if (installed)
 		pk_bitfield_add (state, GPK_STATE_INSTALLED);
@@ -1003,11 +1003,11 @@ gpk_application_add_obj_to_results (GpkApplication *application, const PkItemPac
 		pk_bitfield_add (state, GPK_STATE_IN_LIST);
 
 	/* special icon */
-	if (obj->info == PK_INFO_ENUM_COLLECTION_INSTALLED || obj->info == PK_INFO_ENUM_COLLECTION_AVAILABLE)
+	if (obj->info_enum == PK_INFO_ENUM_COLLECTION_INSTALLED || obj->info == PK_INFO_ENUM_COLLECTION_AVAILABLE)
 		pk_bitfield_add (state, GPK_STATE_COLLECTION);
 
 	/* use the application icon if available */
-	icon = gpk_desktop_guess_icon_name (application->priv->desktop, obj->package_id->name);
+	icon = gpk_desktop_guess_icon_name (application->priv->desktop, obj->package_id->namexxxneedtosplitxxx);
 	if (icon == NULL)
 		icon = gpk_application_state_get_icon (state);
 
@@ -1050,7 +1050,7 @@ gpk_application_package_cb (PkClient *client, const PkItemPackage *obj, GpkAppli
 
 	g_return_if_fail (GPK_IS_APPLICATION (application));
 
-	egg_debug ("package = %s:%s:%s", pk_info_enum_to_text (obj->info), obj->package_id->name, obj->summary);
+	egg_debug ("package = %s:%s:%s", pk_info_enum_to_text (obj->info_enum), obj->package_id->namexxxneedtosplitxxx, obj->summary);
 
 	/* ignore not search data */
 #if PK_CHECK_VERSION(0,5,1)
@@ -1066,8 +1066,8 @@ gpk_application_package_cb (PkClient *client, const PkItemPackage *obj, GpkAppli
 		return;
 
 	/* ignore progress */
-	if (obj->info != PK_INFO_ENUM_INSTALLED && obj->info != PK_INFO_ENUM_AVAILABLE &&
-	    obj->info != PK_INFO_ENUM_COLLECTION_INSTALLED && obj->info != PK_INFO_ENUM_COLLECTION_AVAILABLE)
+	if (obj->info_enum != PK_INFO_ENUM_INSTALLED && obj->info != PK_INFO_ENUM_AVAILABLE &&
+	    obj->info_enum != PK_INFO_ENUM_COLLECTION_INSTALLED && obj->info != PK_INFO_ENUM_COLLECTION_AVAILABLE)
 		return;
 
 	/* add to list */
@@ -1154,7 +1154,6 @@ gpk_application_finished_get_depends (GpkApplication *application, GPtrArray *li
 	gchar *title = NULL;
 	gchar *message = NULL;
 	gchar **package_ids = NULL;
-	guint length;
 	GtkWidget *dialog;
 	gchar *package_id_selected = NULL;
 	gboolean ret;
@@ -1168,7 +1167,7 @@ gpk_application_finished_get_depends (GpkApplication *application, GPtrArray *li
 
 	/* empty list */
 	window = GTK_WINDOW (gtk_builder_get_object (application->priv->builder, "window_manager"));
-	if (xxxarray- (list) == 0) {
+	if (list->len == 0) {
 		gpk_error_dialog_modal (window,
 					/* TRANSLATORS: no packages returned */
 					_("No packages"),
@@ -1177,18 +1176,17 @@ gpk_application_finished_get_depends (GpkApplication *application, GPtrArray *li
 		goto out;
 	}
 
-	length = xxxarray- (list);
 	package_ids = pk_package_ids_from_id (package_id_selected);
 	name = gpk_dialog_package_id_name_join_locale (package_ids);
 	/* TRANSLATORS: title: show the number of other packages we depend on */
 	title = g_strdup_printf (ngettext ("%i additional package is required for %s",
 					   "%i additional packages are required for %s",
-					   length), length, name);
+					   list->len), list->len, name);
 
 	/* TRANSLATORS: message: show the list of dependant packages for this package */
 	message = g_strdup_printf (ngettext ("Packages listed below are required for %s to function correctly.",
 					     "Packages listed below are required for %s to function correctly.",
-					     length), name);
+					     list->len), name);
 
 	dialog = gtk_message_dialog_new (window, GTK_DIALOG_DESTROY_WITH_PARENT,
 					 GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", title);
@@ -1216,7 +1214,6 @@ gpk_application_finished_get_requires (GpkApplication *application, GPtrArray *l
 	gchar *title = NULL;
 	gchar *message = NULL;
 	gchar **package_ids = NULL;
-	guint length;
 	GtkWidget *dialog;
 	gchar *package_id_selected = NULL;
 	gboolean ret;
@@ -1230,7 +1227,7 @@ gpk_application_finished_get_requires (GpkApplication *application, GPtrArray *l
 
 	/* empty list */
 	window = GTK_WINDOW (gtk_builder_get_object (application->priv->builder, "window_manager"));
-	if (xxxarray- (list) == 0) {
+	if (list->len == 0) {
 		gpk_error_dialog_modal (window,
 					/* TRANSLATORS: no packages returned */
 					_("No packages"),
@@ -1239,18 +1236,17 @@ gpk_application_finished_get_requires (GpkApplication *application, GPtrArray *l
 		goto out;
 	}
 
-	length = xxxarray- (list);
 	package_ids = pk_package_ids_from_id (package_id_selected);
 	name = gpk_dialog_package_id_name_join_locale (package_ids);
 	/* TRANSLATORS: title: how many packages require this package */
 	title = g_strdup_printf (ngettext ("%i package requires %s",
 					   "%i packages require %s",
-					   length), length, name);
+					   list->len), length, name);
 
 	/* TRANSLATORS: show a list of packages for the package */
 	message = g_strdup_printf (ngettext ("Packages listed below require %s to function correctly.",
 					     "Packages listed below require %s to function correctly.",
-					     length), name);
+					     list->len), name);
 
 	dialog = gtk_message_dialog_new (window, GTK_DIALOG_DESTROY_WITH_PARENT,
 					 GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "%s", title);
@@ -1347,7 +1343,7 @@ gpk_application_run_installed (GpkApplication *application)
 	len = PK_OBJ_LIST (list)->len;
 	for (i=0; i<len; i++) {
 		obj = g_ptr_array_index (list, i);
-		if (obj->info == PK_INFO_ENUM_INSTALLING)
+		if (obj->info_enum == PK_INFO_ENUM_INSTALLING)
 			g_ptr_array_add (array, g_strdup (obj->package_id));
 	}
 
diff --git a/src/gpk-check-update.c b/src/gpk-check-update.c
index e6c723d..e63d766 100644
--- a/src/gpk-check-update.c
+++ b/src/gpk-check-update.c
@@ -553,26 +553,24 @@ static PkBitfield
 gpk_check_update_client_info_to_bitfield (GpkCheckUpdate *cupdate, GPtrArray *list)
 {
 	guint i;
-	guint length;
 	PkBitfield infos = 0;
 	const PkItemPackage *obj;
 
 	g_return_val_if_fail (GPK_IS_CHECK_UPDATE (cupdate), PK_INFO_ENUM_UNKNOWN);
 
 	/* shortcut */
-	length = xxxarray- (list);
-	if (length == 0)
+	if (list->len == 0)
 		return PK_INFO_ENUM_UNKNOWN;
 
 	/* add each status to a list */
-	for (i=0; i<length; i++) {
+	for (i=0; i<list->len; i++) {
 		obj = g_ptr_array_index (list, i);
 		if (obj == NULL) {
 			egg_warning ("not found obj %i", i);
 			break;
 		}
-		egg_debug ("%s %s", obj->package_id->name, pk_info_enum_to_text (obj->info));
-		pk_bitfield_add (infos, obj->info);
+		egg_debug ("%s %s", obj->package_id->namexxxneedtosplitxxx, pk_info_enum_to_text (obj->info_enum));
+		pk_bitfield_add (infos, obj->info_enum);
 	}
 	return infos;
 }
@@ -773,7 +771,6 @@ static gboolean
 gpk_check_update_process_updates (GpkCheckUpdate *cupdate, GPtrArray *list, gboolean policy_action)
 {
 	const PkItemPackage *obj;
-	guint length;
 	guint i;
 	guint more;
 	guint showing = 0;
@@ -802,20 +799,19 @@ gpk_check_update_process_updates (GpkCheckUpdate *cupdate, GPtrArray *list, gboo
 	security_array = g_ptr_array_new ();
 
 	/* find packages */
-	length = xxxarray- (list);
-	egg_debug ("length=%i", length);
+	egg_debug ("length=%i", list->len);
 
 	/* we have no updates */
-	if (length == 0) {
+	if (list->len == 0) {
 		egg_debug ("no updates");
 		gpk_check_update_set_icon_name (cupdate, NULL);
 		goto out;
 	}
 
 	/* find the security updates first */
-	for (i=0; i<length; i++) {
+	for (i=0; i<list->len; i++) {
 		obj = g_ptr_array_index (list, i);
-		if (obj->info == PK_INFO_ENUM_SECURITY) {
+		if (obj->info_enum == PK_INFO_ENUM_SECURITY) {
 			/* add to array */
 			g_ptr_array_add (security_array, g_strdup (obj->package_id));
 		}
@@ -824,12 +820,12 @@ gpk_check_update_process_updates (GpkCheckUpdate *cupdate, GPtrArray *list, gboo
 	/* get the security update text */
 	for (i=0; i<length; i++) {
 		obj = g_ptr_array_index (list, i);
-		if (obj->info != PK_INFO_ENUM_SECURITY)
+		if (obj->info_enum != PK_INFO_ENUM_SECURITY)
 			continue;
 
 		/* don't use a huge notification that won't fit on the screen */
 		g_string_append_printf (status_security, "<b>%s</b> - %s\n",
-					obj->package_id->name, obj->summary);
+					obj->package_id->namexxxneedtosplitxxx, obj->summary);
 		if (++showing == GPK_CHECK_UPDATE_MAX_NUMBER_SECURITY_ENTRIES) {
 			more = security_array->len - showing;
 			/* TRANSLATORS: we have a notification that won't fit, so append on how many other we are not showing */
@@ -1297,7 +1293,6 @@ gpk_check_update_finished_notify (GpkCheckUpdate *cupdate, PkClient *client)
 	NotifyNotification *notification;
 	PkRestartEnum restart;
 	guint i;
-	guint length;
 	GPtrArray *list;
 	const PkItemPackage *obj;
 	GString *message_text;
@@ -1306,9 +1301,8 @@ gpk_check_update_finished_notify (GpkCheckUpdate *cupdate, PkClient *client)
 
 	/* check we got some packages */
 	list = pk_client_get_package_list (client);
-	length = xxxarray- (list);
-	egg_debug ("length=%i", length);
-	if (length == 0) {
+	egg_debug ("length=%i", list->len);
+	if (list->len == 0) {
 		egg_debug ("no updates");
 		return;
 	}
@@ -1316,14 +1310,14 @@ gpk_check_update_finished_notify (GpkCheckUpdate *cupdate, PkClient *client)
 	message_text = g_string_new ("");
 
 	/* find any we skipped */
-	for (i=0; i<length; i++) {
+	for (i=0; i<list->len; i++) {
 		obj = g_ptr_array_index (list, i);
-		egg_debug ("%s, %s, %s", pk_info_enum_to_text (obj->info),
-			  obj->package_id->name, obj->summary);
-		if (obj->info == PK_INFO_ENUM_BLOCKED) {
+		egg_debug ("%s, %s, %s", pk_info_enum_to_text (obj->info_enum),
+			  obj->package_id->namexxxneedtosplitxxx, obj->summary);
+		if (obj->info_enum == PK_INFO_ENUM_BLOCKED) {
 			skipped_number++;
 			g_string_append_printf (message_text, "<b>%s</b> - %s\n",
-						obj->package_id->name, obj->summary);
+						obj->package_id->namexxxneedtosplitxxx, obj->summary);
 		}
 	}
 	g_object_unref (list);
diff --git a/src/gpk-common.c b/src/gpk-common.c
index ed073a7..0302530 100644
--- a/src/gpk-common.c
+++ b/src/gpk-common.c
@@ -347,27 +347,6 @@ gpk_package_id_name_version (const gchar *id)
 }
 
 /**
- * pk_package_id_get_name:
- **/
-gchar *
-gpk_package_get_name (const gchar *package_id)
-{
-	gchar *package = NULL;
-	gchar *id;
-
-	/* xxxnotneededanymore can't accept NULL */
-	if (package_id == NULL)
-		return NULL;
-	id = xxxnotneededanymore (package_id);
-	if (id == NULL)
-		package = g_strdup (package_id);
-	else
-		package = g_strdup (id->name);
-	g_free (id);
-	return package;
-}
-
-/**
  * gpk_check_privileged_user
  **/
 gboolean
@@ -622,7 +601,6 @@ gpk_package_entry_completion_model_new (void)
 {
 	GPtrArray *list;
 	guint i;
-	guint length;
 	gboolean ret;
 	const PkItemPackage *obj;
 	GHashTable *hash;
@@ -639,20 +617,19 @@ gpk_package_entry_completion_model_new (void)
 		return NULL;
 	}
 
-	length = xxxarray- (list);
-	egg_debug ("loading %i autocomplete items", length);
-	for (i=0; i<length; i++) {
+	egg_debug ("loading %i autocomplete items", list->len);
+	for (i=0; i<list->len; i++) {
 		obj = g_ptr_array_index (list, i);
-		if (obj == NULL || obj->package_id == NULL || obj->package_id->name == NULL) {
+		if (obj == NULL || obj->package_id == NULL || obj->package_id->namexxxneedtosplitxxx == NULL) {
 			egg_warning ("obj invalid!");
 			break;
 		}
-		data = g_hash_table_lookup (hash, (gpointer) obj->package_id->name);
+		data = g_hash_table_lookup (hash, (gpointer) obj->package_id->namexxxneedtosplitxxx);
 		if (data == NULL) {
 			/* append just the name */
-			g_hash_table_insert (hash, g_strdup (obj->package_id->name), GINT_TO_POINTER (1));
+			g_hash_table_insert (hash, g_strdup (obj->package_id->namexxxneedtosplitxxx), GINT_TO_POINTER (1));
 			gtk_list_store_append (store, &iter);
-			gtk_list_store_set (store, &iter, 0, obj->package_id->name, -1);
+			gtk_list_store_set (store, &iter, 0, obj->package_id->namexxxneedtosplitxxx, -1);
 		}
 	}
 	g_hash_table_unref (hash);
@@ -730,7 +707,6 @@ void
 gpk_common_test (gpointer data)
 {
 	gchar *text;
-	gchar *id;
 	EggTest *test = (EggTest *) data;
 
 	if (!egg_test_start (test, "GpkCommon"))
@@ -840,38 +816,8 @@ gpk_common_test (gpointer data)
 	/************************************************************
 	 ****************     package name text        **************
 	 ************************************************************/
-	egg_test_title (test, "get name null");
-	text = gpk_package_get_name (NULL);
-	if (text == NULL)
-		egg_test_success (test, NULL);
-	else
-		egg_test_failed (test, "failed, got %s", text);
-
-	/************************************************************/
-	egg_test_title (test, "get name not id");
-	text = gpk_package_get_name ("ania");
-	if (text != NULL && strcmp (text, "ania") == 0)
-		egg_test_success (test, NULL);
-	else
-		egg_test_failed (test, "failed, got %s", text);
-	g_free (text);
-
-	/************************************************************/
-	egg_test_title (test, "get name just id");
-	text = gpk_package_get_name ("simon;1.0.0;i386;moo");
-	if (text != NULL && strcmp (text, "simon") == 0)
-		egg_test_success (test, NULL);
-	else
-		egg_test_failed (test, "failed, got %s", text);
-	g_free (text);
-
-	/************************************************************
-	 ****************     package name text        **************
-	 ************************************************************/
 	egg_test_title (test, "package id pretty valid package id, no summary");
-	id = xxxnotneededanymore ("simon;0.0.1;i386;data");
-	text = gpk_package_id_format_twoline (id, NULL);
-	g_free (id);
+	text = gpk_package_id_format_twoline ("simon;0.0.1;i386;data", NULL);
 	if (text != NULL && strcmp (text, "simon-0.0.1 (i386)") == 0)
 		egg_test_success (test, NULL);
 	else
@@ -880,9 +826,7 @@ gpk_common_test (gpointer data)
 
 	/************************************************************/
 	egg_test_title (test, "package id pretty valid package id, no summary 2");
-	id = xxxnotneededanymore ("simon;0.0.1;;data");
-	text = gpk_package_id_format_twoline (id, NULL);
-	g_free (id);
+	text = gpk_package_id_format_twoline ("simon;0.0.1;;data", NULL);
 	if (text != NULL && strcmp (text, "simon-0.0.1") == 0)
 		egg_test_success (test, NULL);
 	else
@@ -891,9 +835,7 @@ gpk_common_test (gpointer data)
 
 	/************************************************************/
 	egg_test_title (test, "package id pretty valid package id, no summary 3");
-	id = xxxnotneededanymore ("simon;;;data");
-	text = gpk_package_id_format_twoline (id, NULL);
-	g_free (id);
+	text = gpk_package_id_format_twoline ("simon;;;data", NULL);
 	if (text != NULL && strcmp (text, "simon") == 0)
 		egg_test_success (test, NULL);
 	else
@@ -902,9 +844,7 @@ gpk_common_test (gpointer data)
 
 	/************************************************************/
 	egg_test_title (test, "package id pretty valid package id, no summary 4");
-	id = xxxnotneededanymore ("simon;0.0.1;;data");
-	text = gpk_package_id_format_twoline (id, "dude");
-	g_free (id);
+	text = gpk_package_id_format_twoline ("simon;0.0.1;;data", "dude");
 	if (text != NULL && strcmp (text, "<b>dude</b>\nsimon-0.0.1") == 0)
 		egg_test_success (test, NULL);
 	else
diff --git a/src/gpk-common.h b/src/gpk-common.h
index dad1fe8..af98791 100644
--- a/src/gpk-common.h
+++ b/src/gpk-common.h
@@ -93,7 +93,6 @@ void		 gpk_common_test			(gpointer	 data);
 void		 gtk_text_buffer_insert_markup		(GtkTextBuffer	*buffer,
 							 GtkTextIter	*iter,
 							 const gchar	*markup);
-gchar		*gpk_package_get_name			(const gchar	*package_id);
 gchar		*gpk_package_id_format_twoline		(const gchar *id,
 							 const gchar	*summary);
 gchar		*gpk_package_id_format_oneline		(const gchar *id,
diff --git a/src/gpk-dbus-task.c b/src/gpk-dbus-task.c
index 46f9976..a94db71 100644
--- a/src/gpk-dbus-task.c
+++ b/src/gpk-dbus-task.c
@@ -703,8 +703,7 @@ gpk_dbus_task_finished_cb (PkClient *client, PkExitEnum exit_enum, guint runtime
 
 		/* found nothing? */
 		list = pk_client_get_package_list (task->priv->client_primary);
-		len = xxxarray- (list);
-		if (len == 0) {
+		if (list->len == 0) {
 			if (task->priv->show_warning) {
 				info_url = gpk_vendor_get_not_found_url (task->priv->vendor, GPK_VENDOR_URL_TYPE_MIME);
 				/* only show the "more info" button if there is a valid link */
@@ -740,8 +739,7 @@ gpk_dbus_task_finished_cb (PkClient *client, PkExitEnum exit_enum, guint runtime
 	    role == PK_ROLE_ENUM_SEARCH_FILE) {
 		/* found nothing? */
 		list = pk_client_get_package_list (task->priv->client_primary);
-		len = xxxarray- (list);
-		if (len == 0) {
+		if (list->len == 0) {
 			if (task->priv->show_warning) {
 				info_url = gpk_vendor_get_not_found_url (task->priv->vendor, GPK_VENDOR_URL_TYPE_DEFAULT);
 				/* only show the "more info" button if there is a valid link */
@@ -770,11 +768,11 @@ gpk_dbus_task_finished_cb (PkClient *client, PkExitEnum exit_enum, guint runtime
 		/* see what we've got already */
 		for (i=0; i<len; i++) {
 			obj = g_ptr_array_index (list, i);
-			if (obj->info == PK_INFO_ENUM_INSTALLED) {
+			if (obj->info_enum == PK_INFO_ENUM_INSTALLED) {
 				already_installed = TRUE;
 				id = obj->package_id;
-			} else if (obj->info == PK_INFO_ENUM_AVAILABLE) {
-				egg_debug ("package '%s' resolved to:", obj->package_id->name);
+			} else if (obj->info_enum == PK_INFO_ENUM_AVAILABLE) {
+				egg_debug ("package '%s' resolved to:", obj->package_id->namexxxneedtosplitxxx);
 				id = obj->package_id;
 			}
 		}
@@ -817,14 +815,13 @@ gpk_dbus_task_finished_cb (PkClient *client, PkExitEnum exit_enum, guint runtime
 		/* these are the new packages */
 		list = pk_client_get_package_list (task->priv->client_primary);
 		new = g_ptr_array_new_with_free_func_xxx ();
-		len = xxxarray- (list);
-		for (i=0; i<len; i++) {
+		for (i=0; i<list->len; i++) {
 			obj = g_ptr_array_index (list, i);
 
 #if PK_CHECK_VERSION(0,5,2)
 			/* not interesting */
-			if (obj->info != PK_INFO_ENUM_UPDATING &&
-			    obj->info != PK_INFO_ENUM_INSTALLING)
+			if (obj->info_enum != PK_INFO_ENUM_UPDATING &&
+			    obj->info_enum != PK_INFO_ENUM_INSTALLING)
 				continue;
 #endif
 
@@ -832,12 +829,11 @@ gpk_dbus_task_finished_cb (PkClient *client, PkExitEnum exit_enum, guint runtime
 			if (g_strcmp0 (obj->package_id->data, "local") == 0)
 				continue;
 
-			g_ptr_array_add_xxxwithrecount (new, obj->info, obj->package_id, obj->summary);
+			g_ptr_array_add_xxxwithrecount (new, obj->info_enum, obj->package_id, obj->summary);
 		}
 
 		/* these are the new packages */
-		len = xxxarray- (new);
-		if (len == 0) {
+		if (new->len == 0) {
 			egg_debug ("no deps");
 			goto skip_checks;
 		}
@@ -904,7 +900,7 @@ skip_checks:
 			/* filter out installed */
 			for (i=0; i<PK_OBJ_LIST(list)->len; i++) {
 				obj = pk_obj_list_index (PK_OBJ_LIST (list), i);
-				if (obj->info != PK_INFO_ENUM_INSTALLING) {
+				if (obj->info_enum != PK_INFO_ENUM_INSTALLING) {
 					pk_obj_list_remove_index (PK_OBJ_LIST (list), i);
 					i--;
 				}
@@ -952,8 +948,7 @@ skip_checks:
 
 		/* found nothing? */
 		list = pk_client_get_package_list (task->priv->client_primary);
-		len = xxxarray- (list);
-		if (len == 0) {
+		if (list->len == 0) {
 			if (task->priv->show_warning) {
 				//FIXME: shows package_id in UI
 				/* TRANSLATORS: couldn't resolve name to package */
@@ -985,10 +980,10 @@ skip_checks:
 		/* see what we've got already */
 		for (i=0; i<len; i++) {
 			obj = g_ptr_array_index (list, i);
-			if (obj->info == PK_INFO_ENUM_INSTALLED) {
+			if (obj->info_enum == PK_INFO_ENUM_INSTALLED) {
 				already_installed = TRUE;
-			} else if (obj->info == PK_INFO_ENUM_AVAILABLE) {
-				egg_debug ("package '%s' resolved", obj->package_id->name);
+			} else if (obj->info_enum == PK_INFO_ENUM_AVAILABLE) {
+				egg_debug ("package '%s' resolved", obj->package_id->namexxxneedtosplitxxx);
 				id = obj->package_id;
 				//TODO: we need to list these in a gpk-dbus_task-chooser
 			}
@@ -1081,7 +1076,7 @@ gpk_dbus_task_set_status (GpkDbusTask *task, PkStatusEnum status)
 
 	/* spin */
 	if (status == PK_STATUS_ENUM_WAIT)
-		gpk_modal_dialog_set_percentage (task->priv->dialog, PK_CLIENT_PERCENTAGE_INVALID);
+		gpk_modal_dialog_set_percentage (task->priv->dialog, -1);
 
 	/* do visual stuff when finished */
 	if (status == PK_STATUS_ENUM_FINISHED) {
@@ -2297,16 +2292,15 @@ gpk_dbus_task_install_gstreamer_codec_part (GpkDbusTask *task, const gchar *code
 		return NULL;
 
 	list = pk_client_get_package_list (task->priv->client_primary);
-	len = xxxarray- (list);
 
 	/* found nothing? */
-	if (len == 0) {
+	if (list->len == 0) {
 		*error = g_error_new (GPK_DBUS_ERROR, GPK_DBUS_ERROR_NO_PACKAGES_FOUND, "failed to find: %s", codec_desc);
 		goto out;
 	}
 
 	/* gstreamer-ffmpeg and gstreamer-plugins-ugly both provide mp3 playback, choose one */
-	if (len > 1)
+	if (list->len > 1)
 		egg_warning ("choosing one of the provides as more than one match");
 
 	/* always use the first one */
@@ -2901,8 +2895,7 @@ skip_checks:
 	}
 
 	/* found nothing? */
-	len = xxxarray- (list);
-	if (len == 0) {
+	if (list->len == 0) {
 		if (task->priv->show_warning) {
 			info_url = gpk_vendor_get_not_found_url (task->priv->vendor, GPK_VENDOR_URL_TYPE_FONT);
 			/* TRANSLATORS: title: cannot find in sources */
@@ -3056,8 +3049,7 @@ skip_checks:
 	g_object_unref (catalog);
 
 	/* nothing to do? */
-	len = xxxarray- (list);
-	if (len == 0) {
+	if (list->len == 0) {
 		/* show UI */
 		if (task->priv->show_warning) {
 			/* TRANSLATORS: title: we've already got all these packages installed */
@@ -3118,7 +3110,6 @@ gpk_dbus_task_get_package_for_exec (GpkDbusTask *task, const gchar *exec)
 	gchar *package = NULL;
 	gboolean ret;
 	GError *error = NULL;
-	guint length;
 	GPtrArray *list = NULL;
 	const PkItemPackage *obj;
 
@@ -3135,21 +3126,20 @@ gpk_dbus_task_get_package_for_exec (GpkDbusTask *task, const gchar *exec)
 
 	/* get the list of packages */
 	list = pk_client_get_package_list (task->priv->client_primary);
-	length = xxxarray- (list);
 
 	/* nothing found */
-	if (length == 0) {
+	if (list->len == 0) {
 		egg_debug ("cannot find installed package that provides : %s", exec);
 		goto out;
 	}
 
 	/* check we have one */
-	if (length != 1)
+	if (list->len != 1)
 		egg_warning ("not one return, using first");
 
 	/* copy name */
 	obj = g_ptr_array_index (list, 0);
-	package = g_strdup (obj->package_id->name);
+	package = g_strdup (obj->package_id->namexxxneedtosplitxxx);
 	egg_debug ("got package %s", package);
 
 out:
diff --git a/src/gpk-firmware.c b/src/gpk-firmware.c
index 34cd520..00d49eb 100644
--- a/src/gpk-firmware.c
+++ b/src/gpk-firmware.c
@@ -355,10 +355,9 @@ gpk_firmware_check_available (GpkFirmware *firmware, const gchar *filename)
 
 	/* make sure we have one package */
 	list = pk_client_get_package_list (firmware->priv->client_primary);
-	length = xxxarray- (list);
-	if (length == 0)
+	if (list->len == 0)
 		egg_debug ("no package providing %s found", filename);
-	else if (length != 1)
+	else if (list->len != 1)
 		egg_warning ("not one package providing %s found (%i)", filename, length);
 	else
 		obj = pk_package_obj_copy (g_ptr_array_index (list, 0));
@@ -401,7 +400,7 @@ gpk_firmware_timeout_cb (gpointer data)
 	}
 
 	/* nothing to do */
-	if (xxxarray- (firmware->priv->packages_found) == 0) {
+	if (firmware->priv->packages_found->len == 0) {
 		egg_debug ("no packages providing any of the missing firmware");
 		goto out;
 	}
diff --git a/src/gpk-hardware.c b/src/gpk-hardware.c
index 749bf42..65b873a 100644
--- a/src/gpk-hardware.c
+++ b/src/gpk-hardware.c
@@ -119,7 +119,6 @@ static void
 gpk_hardware_check_for_driver_available (GpkHardware *hardware, const gchar *udi)
 {
 	gboolean ret;
-	guint length;
 	gchar *message = NULL;
 	gchar *body = NULL;
 	NotifyNotification *notification;
@@ -141,8 +140,7 @@ gpk_hardware_check_for_driver_available (GpkHardware *hardware, const gchar *udi
 
 	/* If there are no driver packages available just return */
 	list = pk_client_get_package_list (client);
-	length = xxxarray- (list);
-	if (length == 0) {
+	if (list->len == 0) {
 		egg_debug ("no drivers available");
 		goto out;
 	}
diff --git a/src/gpk-helper-chooser.c b/src/gpk-helper-chooser.c
index 51ba4a8..e4869c9 100644
--- a/src/gpk-helper-chooser.c
+++ b/src/gpk-helper-chooser.c
@@ -164,7 +164,6 @@ gpk_helper_chooser_show (GpkHelperChooser *helper, GPtrArray *list)
 	GtkWidget *widget;
 	gchar *text;
 	const gchar *icon_name;
-	guint len;
 	guint i;
 	const PkItemPackage *obj;
 	GtkTreeIter iter;
@@ -173,19 +172,18 @@ gpk_helper_chooser_show (GpkHelperChooser *helper, GPtrArray *list)
 	g_return_val_if_fail (list != NULL, FALSE);
 
 	/* see what we've got already */
-	len = xxxarray- (list);
-	for (i=0; i<len; i++) {
+	for (i=0; i<list->len; i++) {
 		obj = g_ptr_array_index (list, i);
-		egg_debug ("package '%s' got:", obj->package_id->name);
+		egg_debug ("package '%s' got:", obj->package_id->namexxxneedtosplitxxx);
 
 		/* put formatted text into treeview */
 		gtk_list_store_append (helper->priv->list_store, &iter);
 		text = gpk_package_id_format_twoline (obj->package_id, obj->summary);
 
 		/* get the icon */
-		icon_name = gpk_desktop_guess_icon_name (helper->priv->desktop, obj->package_id->name);
+		icon_name = gpk_desktop_guess_icon_name (helper->priv->desktop, obj->package_id->namexxxneedtosplitxxx);
 		if (icon_name == NULL)
-			icon_name = gpk_info_enum_to_icon_name (obj->info);
+			icon_name = gpk_info_enum_to_icon_name (obj->info_enum);
 
 		gtk_list_store_set (helper->priv->list_store, &iter,
 				    GPK_CHOOSER_COLUMN_TEXT, text,
diff --git a/src/gpk-helper-deps-install.c b/src/gpk-helper-deps-install.c
index dbc547a..4fb8736 100644
--- a/src/gpk-helper-deps-install.c
+++ b/src/gpk-helper-deps-install.c
@@ -63,14 +63,12 @@ gpk_helper_deps_install_show (GpkHelperDepsInstall *helper, GPtrArray *packages,
 	gchar *title = NULL;
 	gchar *message = NULL;
 	gchar **package_ids = NULL;
-	guint length;
 	gboolean ret;
 	GtkWidget *dialog;
 	GtkResponseType response;
 
 	/* empty list */
-	length = xxxarray- (deps_list);
-	if (length == 0) {
+	if (deps_list->len == 0) {
 		g_signal_emit (helper, signals [GPK_HELPER_DEPS_INSTALL_EVENT], 0, GTK_RESPONSE_YES);
 		goto out;
 	}
@@ -86,7 +84,7 @@ gpk_helper_deps_install_show (GpkHelperDepsInstall *helper, GPtrArray *packages,
 	/* TRANSLATORS: title: tell the user we have to install additional packages */
 	title = g_strdup_printf (ngettext ("%i additional package also has to be installed",
 					   "%i additional packages also have to be installed",
-					   length), length);
+					   deps_list->len), deps_list->len);
 
 	package_ids = pk_package_list_to_strv (packages);
 	name = gpk_dialog_package_id_name_join_locale (package_ids);
@@ -94,7 +92,7 @@ gpk_helper_deps_install_show (GpkHelperDepsInstall *helper, GPtrArray *packages,
 	/* TRANSLATORS: message: describe in detail why it must happen */
 	message = g_strdup_printf (ngettext ("To install %s, an additional package also has to be downloaded.",
 					     "To install %s, additional packages also have to be downloaded.",
-					     length), name);
+					     deps_list->len), name);
 
 	dialog = gtk_message_dialog_new (helper->priv->window, GTK_DIALOG_DESTROY_WITH_PARENT,
 					 GTK_MESSAGE_INFO, GTK_BUTTONS_CANCEL, "%s", title);
diff --git a/src/gpk-helper-deps-remove.c b/src/gpk-helper-deps-remove.c
index 16820b3..95a642d 100644
--- a/src/gpk-helper-deps-remove.c
+++ b/src/gpk-helper-deps-remove.c
@@ -61,13 +61,11 @@ gpk_helper_deps_remove_show (GpkHelperDepsRemove *helper, GPtrArray *packages, G
 	gchar *title = NULL;
 	gchar *message = NULL;
 	gchar **package_ids = NULL;
-	guint length;
 	GtkWidget *dialog;
 	GtkResponseType response;
 
 	/* empty list */
-	length = xxxarray- (deps_list);
-	if (length == 0) {
+	if (deps_list->len == 0) {
 		g_signal_emit (helper, signals [GPK_HELPER_DEPS_REMOVE_EVENT], 0, GTK_RESPONSE_YES);
 		goto out;
 	}
@@ -75,7 +73,7 @@ gpk_helper_deps_remove_show (GpkHelperDepsRemove *helper, GPtrArray *packages, G
 	/* TRANSLATORS: title: show the number of other packages we depend on */
 	title = g_strdup_printf (ngettext ("%i additional package also has to be removed",
 					   "%i additional packages also have to be removed",
-					   length), length);
+					   deps_list->len), deps_list->len);
 
 	package_ids = pk_package_list_to_strv (packages);
 	name = gpk_dialog_package_id_name_join_locale (package_ids);
diff --git a/src/gpk-helper-deps-update.c b/src/gpk-helper-deps-update.c
index 13023fb..1f0cb6c 100644
--- a/src/gpk-helper-deps-update.c
+++ b/src/gpk-helper-deps-update.c
@@ -62,7 +62,6 @@ gpk_helper_deps_update_show (GpkHelperDepsUpdate *helper, GPtrArray *deps_list)
 {
 	gchar *title = NULL;
 	const gchar *message = NULL;
-	guint length;
 	gboolean ret;
 	GtkWidget *dialog;
 	GtkResponseType response;
@@ -75,17 +74,15 @@ gpk_helper_deps_update_show (GpkHelperDepsUpdate *helper, GPtrArray *deps_list)
 	helper->priv->list = g_ptr_array_new_with_free_func_xxx ();;
 
 	/* copy only installing, updating etc */
-	length = xxxarray- (deps_list);
-	for (i=0; i<length; i++) {
+	for (i=0; i<deps_list->len; i++) {
 		obj = g_ptr_array_index (deps_list, i);
-		if (obj->info == PK_INFO_ENUM_INSTALLING ||
-		    obj->info == PK_INFO_ENUM_UPDATING)
-			g_ptr_array_add_xxxwithrecount (helper->priv->list, obj->info, obj->package_id, obj->summary);
+		if (obj->info_enum == PK_INFO_ENUM_INSTALLING ||
+		    obj->info_enum == PK_INFO_ENUM_UPDATING)
+			g_ptr_array_add_xxxwithrecount (helper->priv->list, obj->info_enum, obj->package_id, obj->summary);
 	}
 
 	/* empty list */
-	length = xxxarray- (helper->priv->list);
-	if (length == 0) {
+	if (helper->priv->list->len == 0) {
 		g_signal_emit (helper, signals [GPK_HELPER_DEPS_UPDATE_EVENT], 0, GTK_RESPONSE_YES, helper->priv->list);
 		goto out;
 	}
diff --git a/src/gpk-helper-eula.c b/src/gpk-helper-eula.c
index e895a06..799e032 100644
--- a/src/gpk-helper-eula.c
+++ b/src/gpk-helper-eula.c
@@ -93,7 +93,7 @@ gpk_helper_eula_show (GpkHelperEula *helper, const gchar *eula_id, const gchar *
 	GtkWidget *widget;
 	GtkTextBuffer *buffer;
 	gchar *text;
-	gchar *ident;
+	gchar **split;
 
 	g_return_val_if_fail (GPK_IS_HELPER_EULA (helper), FALSE);
 	g_return_val_if_fail (eula_id != NULL, FALSE);
@@ -104,10 +104,10 @@ gpk_helper_eula_show (GpkHelperEula *helper, const gchar *eula_id, const gchar *
 
 	/* title */
 	widget = GTK_WIDGET (gtk_builder_get_object (helper->priv->builder, "label_title"));
-	ident = xxxnotneededanymore (package_id);
-	text = g_strdup_printf ("<b><big>License required for %s by %s</big></b>", ident->name, vendor_name);
+
+	split = pk_package_id_split (package_id);
+	text = g_strdup_printf ("<b><big>License required for %s by %s</big></b>", split[0], vendor_name);
 	gtk_label_set_label (GTK_LABEL (widget), text);
-	g_free (ident);
 	g_free (text);
 
 	buffer = gtk_text_buffer_new (NULL);
@@ -123,6 +123,7 @@ gpk_helper_eula_show (GpkHelperEula *helper, const gchar *eula_id, const gchar *
 	gtk_widget_show (widget);
 
 	g_object_unref (buffer);
+	g_strfreev (split);
 
 	return TRUE;
 }
diff --git a/src/gpk-helper-repo-signature.c b/src/gpk-helper-repo-signature.c
index 29f7937..aaf362d 100644
--- a/src/gpk-helper-repo-signature.c
+++ b/src/gpk-helper-repo-signature.c
@@ -96,7 +96,6 @@ gpk_helper_repo_signature_show (GpkHelperRepoSignature *helper, const gchar *pac
 				const gchar *key_fingerprint, const gchar *key_timestamp)
 {
 	GtkWidget *widget;
-	gchar *id;
 	gchar *text;
 
 	g_return_val_if_fail (GPK_IS_HELPER_REPO_SIGNATURE (helper), FALSE);
@@ -119,14 +118,12 @@ gpk_helper_repo_signature_show (GpkHelperRepoSignature *helper, const gchar *pac
 	gtk_label_set_label (GTK_LABEL (widget), key_id);
 
 	/* TODO: pass this as a struct from the PkClient signal */
-	id = xxxnotneededanymore (package_id);
-	text = gpk_package_id_name_version (id);
+	text = gpk_package_id_name_version (package_id);
 
 	widget = GTK_WIDGET (gtk_builder_get_object (helper->priv->builder, "label_package"));
 	gtk_label_set_label (GTK_LABEL (widget), text);
 
 	g_free (text);
-	g_free (id);
 
 	/* show window */
 	widget = GTK_WIDGET (gtk_builder_get_object (helper->priv->builder, "dialog_gpg"));
diff --git a/src/gpk-helper-run.c b/src/gpk-helper-run.c
index 0da5ad5..e4afdb2 100644
--- a/src/gpk-helper-run.c
+++ b/src/gpk-helper-run.c
@@ -212,7 +212,6 @@ gpk_helper_run_add_desktop_file (GpkHelperRun *helper, const gchar *package_id,
 	gchar *menu_path = NULL;
 	GtkTreeIter iter;
 	GKeyFile *file = NULL;
-	gchar *id;
 	gint weight;
 	gboolean hidden;
 
@@ -287,15 +286,13 @@ gpk_helper_run_add_desktop_file (GpkHelperRun *helper, const gchar *package_id,
 	/* put formatted text into treeview */
 	gtk_list_store_append (helper->priv->list_store, &iter);
 	joint = g_strdup_printf ("%s - %s", name, summary);
-	id = xxxnotneededanymore (package_id);
-	text = gpk_package_id_format_twoline (id, joint);
+	text = gpk_package_id_format_twoline (package_id, joint);
 	if (menu_path != NULL) {
 		/* TRANSLATORS: the path in the menu, e.g. Applications -> Games -> Dave */
 		fulltext = g_strdup_printf("%s\n\n<i>%s</i>", text, menu_path);
 		g_free (text);
 		text = fulltext;
 	}
-	g_free (id);
 
 	gtk_list_store_set (helper->priv->list_store, &iter,
 			    GPK_CHOOSER_COLUMN_TEXT, fulltext,
diff --git a/src/gpk-log.c b/src/gpk-log.c
index 9f469f7..de44055 100644
--- a/src/gpk-log.c
+++ b/src/gpk-log.c
@@ -193,7 +193,6 @@ gpk_log_get_type_line (gchar **array, PkInfoEnum info)
 	gchar *text;
 	gchar *whole;
 	gchar **sections;
-	gchar *id;
 
 	string = g_string_new ("");
 	size = g_strv_length (array);
@@ -204,11 +203,9 @@ gpk_log_get_type_line (gchar **array, PkInfoEnum info)
 		sections = g_strsplit (array[i], "\t", 0);
 		info_local = pk_info_enum_from_text (sections[0]);
 		if (info_local == info) {
-			id = xxxnotneededanymore (sections[1]);
-			text = gpk_package_id_format_oneline (id, NULL);
+			text = gpk_package_id_format_oneline (sections[1], NULL);
 			g_string_append_printf (string, "%s, ", text);
 			g_free (text);
-			g_free (id);
 		}
 		g_strfreev (sections);
 	}
@@ -394,7 +391,7 @@ gpk_log_filter (const PkTransactionObj *obj)
 	guint length;
 	gchar **sections;
 	gchar **packages;
-	gchar *id;
+	gchar **split;
 
 	/* only show transactions that succeeded */
 	if (!obj->succeeded) {
@@ -420,15 +417,15 @@ gpk_log_filter (const PkTransactionObj *obj)
 			ret = TRUE;
 
 		/* check to see if package name, version or arch matches */
-		id = xxxnotneededanymore (sections[1]);
-		if (g_strrstr (id->name, filter) != NULL)
+		split = pk_package_id_split (sections[1]);
+		if (g_strrstr (split[0], filter) != NULL)
 			ret = TRUE;
-		if (id->version != NULL && g_strrstr (id->version, filter) != NULL)
+		if (split[1] != NULL && g_strrstr (split[1], filter) != NULL)
 			ret = TRUE;
-		if (id->arch != NULL && g_strrstr (id->arch, filter) != NULL)
+		if (split[2] != NULL && g_strrstr (split[2], filter) != NULL)
 			ret = TRUE;
 
-		g_free (id);
+		g_strfreev (split);
 		g_strfreev (sections);
 
 		/* shortcut for speed */
diff --git a/src/gpk-modal-dialog.c b/src/gpk-modal-dialog.c
index f95a9d5..2351a7d 100644
--- a/src/gpk-modal-dialog.c
+++ b/src/gpk-modal-dialog.c
@@ -405,7 +405,7 @@ gpk_modal_dialog_set_percentage (GpkModalDialog *dialog, guint percentage)
 	}
 
 	/* either pulse or set percentage */
-	if (percentage == PK_CLIENT_PERCENTAGE_INVALID)
+	if (percentage == -1)
 		gpk_modal_dialog_make_progressbar_pulse (dialog);
 	else
 		gtk_progress_bar_set_fraction (progress_bar, (gfloat) percentage / 100.0);
@@ -632,48 +632,48 @@ gboolean
 gpk_modal_dialog_set_package_list (GpkModalDialog *dialog, const GPtrArray *list)
 {
 	GtkTreeIter iter;
-	const PkItemPackage *obj;
+	const PkItemPackage *item;
 	PkDesktop *desktop;
 	gchar *icon;
 	gchar *text;
-	guint length;
 	guint i;
 	GtkWidget *widget;
+	gchar **split;
 
 	gtk_list_store_clear (dialog->priv->store);
 
-	length = xxxarray- (list);
 	widget = GTK_WIDGET (gtk_builder_get_object (dialog->priv->builder, "scrolledwindow_packages"));
-	if (length > 5)
+	if (list->len > 5)
 		gtk_widget_set_size_request (widget, -1, 300);
-	else if (length > 1)
+	else if (list->len > 1)
 		gtk_widget_set_size_request (widget, -1, 150);
 
 	desktop = pk_desktop_new ();
-	length = xxxarray- (list);
 
 	/* add each well */
-	for (i=0; i<length; i++) {
-		obj = g_ptr_array_index (list, i);
+	for (i=0; i<list->len; i++) {
+		item = g_ptr_array_index (list, i);
 
 		/* not installed, so ignore icon */
-		if (obj->info == PK_INFO_ENUM_DOWNLOADING ||
-		    obj->info == PK_INFO_ENUM_CLEANUP)
+		if (item->info_enum == PK_INFO_ENUM_DOWNLOADING ||
+		    item->info_enum == PK_INFO_ENUM_CLEANUP)
 			continue;
 
-		text = gpk_package_id_format_twoline (obj->package_id, obj->summary);
+		text = gpk_package_id_format_twoline (item->package_id, item->summary);
 
 		/* get the icon */
-		icon = gpk_desktop_guess_icon_name (desktop, obj->package_id->name);
+		split = pk_package_id_split (item->package_id);
+		icon = gpk_desktop_guess_icon_name (desktop, split[0]);
 		if (icon == NULL)
 			icon = g_strdup (gpk_info_enum_to_icon_name (PK_INFO_ENUM_INSTALLED));
 
 		gtk_list_store_append (dialog->priv->store, &iter);
 		gtk_list_store_set (dialog->priv->store, &iter,
 				    GPK_MODAL_DIALOG_STORE_IMAGE, icon,
-				    GPK_MODAL_DIALOG_STORE_ID, obj->package_id,
+				    GPK_MODAL_DIALOG_STORE_ID, item->package_id,
 				    GPK_MODAL_DIALOG_STORE_TEXT, text,
 				    -1);
+		g_strfreev (split);
 		g_free (icon);
 		g_free (text);
 	}
diff --git a/src/gpk-service-pack.c b/src/gpk-service-pack.c
index c91b374..058b9ad 100644
--- a/src/gpk-service-pack.c
+++ b/src/gpk-service-pack.c
@@ -145,7 +145,7 @@ gpk_pack_package_cb (PkServicePack *pack, const PkItemPackage *obj, gpointer dat
 
 	progress_bar = GTK_PROGRESS_BAR (gtk_builder_get_object (builder, "progressbar_percentage"));
 	/* TRANSLATORS: This is the package name that is being downloaded */
-	text = g_strdup_printf ("%s: %s-%s.%s", _("Downloading"), obj->package_id->name, obj->package_id->version, obj->package_id->arch);
+	text = g_strdup_printf ("%s: %s-%s.%s", _("Downloading"), obj->package_id->namexxxneedtosplitxxx, obj->package_id->version, obj->package_id->arch);
 	gtk_progress_bar_set_text (progress_bar, text);
 	g_free (text);
 }
@@ -219,7 +219,6 @@ gpk_pack_resolve_package_id (const gchar *package)
 	GError *error = NULL;
 	const PkItemPackage *obj;
 	gboolean ret = FALSE;
-	guint len;
 
 	/* get package list */
 	packages = g_strsplit (package, ";", 0);
@@ -232,14 +231,13 @@ gpk_pack_resolve_package_id (const gchar *package)
 
 	/* get the deps */
 	list = pk_client_get_package_list (client);
-	len = xxxarray- (list);
 
 	/* no matches */
-	if (len == 0)
+	if (list->len == 0)
 		goto out;
 
 	/* display warning if not exactly one match */
-	if (len > 1)
+	if (list->len > 1)
 		egg_warning ("More than one possible package for '%s' found!", package);
 
 	/* convert to a text package id */
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index e0696e3..1ee1a96 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -580,7 +580,7 @@ gpk_update_viewer_package_cb (PkClient *client, const PkItemPackage *obj, gpoint
 
 	pk_client_get_role (client, &role, NULL, NULL);
 	egg_debug ("role = %s, package = %s:%s:%s", pk_role_enum_to_text (role),
-		  pk_info_enum_to_text (obj->info), obj->package_id->name, obj->summary);
+		  pk_info_enum_to_text (obj->info_enum), obj->package_id->namexxxneedtosplitxxx, obj->summary);
 
 	/* are we simulating to get deps? */
 #if PK_CHECK_VERSION(0,5,2)
@@ -596,7 +596,7 @@ gpk_update_viewer_package_cb (PkClient *client, const PkItemPackage *obj, gpoint
 #endif
 
 	/* used for progress */
-	if (!gpk_update_viewer_is_update_info (obj->info)) {
+	if (!gpk_update_viewer_is_update_info (obj->info_enum)) {
 		g_free (package_id_last);
 		package_id_last = pk_package_id_copy (obj->package_id);
 
@@ -621,14 +621,14 @@ gpk_update_viewer_package_cb (PkClient *client, const PkItemPackage *obj, gpoint
 		}
 
 		/* if the info is finished, change the status to past tense */
-		if (obj->info == PK_INFO_ENUM_FINISHED) {
+		if (obj->info_enum == PK_INFO_ENUM_FINISHED) {
 			gtk_tree_model_get (model, &iter,
 					    GPK_UPDATES_COLUMN_STATUS, &info, -1);
 			/* promote to past tense if present tense */
 			if (info < PK_INFO_ENUM_UNKNOWN)
 				info += PK_INFO_ENUM_UNKNOWN;
 		} else {
-			info = obj->info;
+			info = obj->info_enum;
 		}
 		gtk_list_store_set (list_store_updates, &iter,
 				    GPK_UPDATES_COLUMN_STATUS, info, -1);
@@ -644,12 +644,12 @@ gpk_update_viewer_package_cb (PkClient *client, const PkItemPackage *obj, gpoint
 
 	/* add to list store */
 	text = gpk_package_id_format_twoline (obj->package_id, obj->summary);
-	selected = (obj->info != PK_INFO_ENUM_BLOCKED);
+	selected = (obj->info_enum != PK_INFO_ENUM_BLOCKED);
 	gtk_list_store_append (list_store_updates, &iter);
 	gtk_list_store_set (list_store_updates, &iter,
 			    GPK_UPDATES_COLUMN_TEXT, text,
 			    GPK_UPDATES_COLUMN_ID, package_id,
-			    GPK_UPDATES_COLUMN_INFO, obj->info,
+			    GPK_UPDATES_COLUMN_INFO, obj->info_enum,
 			    GPK_UPDATES_COLUMN_SELECT, selected,
 			    GPK_UPDATES_COLUMN_SENSITIVE, selected,
 			    GPK_UPDATES_COLUMN_CLICKABLE, selected,
@@ -1408,10 +1408,9 @@ gpk_update_viewer_check_blocked_packages (GPtrArray *list)
 	string = g_string_new ("");
 
 	/* find any that are blocked */
-	length = xxxarray- (list);
-	for (i=0;i<length;i++) {
+	for (i=0;i<list->len;i++) {
 		obj = g_ptr_array_index (list, i);
-		if (obj->info == PK_INFO_ENUM_BLOCKED) {
+		if (obj->info_enum == PK_INFO_ENUM_BLOCKED) {
 			text = gpk_package_id_format_oneline (obj->package_id, obj->summary);
 			g_string_append_printf (string, "%s\n", text);
 			g_free (text);
@@ -1672,7 +1671,7 @@ gpk_update_viewer_deps_update_event_cb (GpkHelperDepsUpdate *helper, GtkResponse
 			gtk_list_store_set (list_store_updates, &iter,
 					    GPK_UPDATES_COLUMN_TEXT, text,
 					    GPK_UPDATES_COLUMN_ID, obj->package_id,
-					    GPK_UPDATES_COLUMN_INFO, obj->info,
+					    GPK_UPDATES_COLUMN_INFO, obj->info_enum,
 					    GPK_UPDATES_COLUMN_SELECT, TRUE,
 					    GPK_UPDATES_COLUMN_SENSITIVE, FALSE,
 					    GPK_UPDATES_COLUMN_CLICKABLE, FALSE,
@@ -2049,7 +2048,7 @@ gpk_update_viewer_progress_changed_cb (PkClient *client, guint percentage, guint
 
 	widget = GTK_WIDGET (gtk_builder_get_object (builder, "progressbar_progress"));
 	gtk_widget_show (widget);
-	if (percentage != PK_CLIENT_PERCENTAGE_INVALID)
+	if (percentage != -1)
 		gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (widget), (gfloat) percentage / 100.0);
 
 	treeview = GTK_TREE_VIEW (gtk_builder_get_object (builder, "treeview_updates"));
diff --git a/src/gpk-watch.c b/src/gpk-watch.c
index 540c871..bd66e48 100644
--- a/src/gpk-watch.c
+++ b/src/gpk-watch.c
@@ -488,7 +488,7 @@ gpk_watch_task_list_finished_cb (PkTaskList *tlist, PkClient *client, PkExitEnum
 				ret = FALSE;
 				for (j=0; j<array->len; j++) {
 					obj_tmp = pk_obj_list_index (array, j);
-					if (g_strcmp0 (obj_tmp->id->name, obj->package_id->name) == 0) {
+					if (g_strcmp0 (obj_tmp->id->name, obj->package_id->namexxxneedtosplitxxx) == 0) {
 						ret = TRUE;
 						break;
 					}
@@ -497,7 +497,7 @@ gpk_watch_task_list_finished_cb (PkTaskList *tlist, PkClient *client, PkExitEnum
 					continue;
 
 				/* add to list */
-				g_ptr_array_add (watch->priv->restart_package_names, g_strdup (obj->package_id->name));
+				g_ptr_array_add (watch->priv->restart_package_names, g_strdup (obj->package_id->namexxxneedtosplitxxx));
 			}
 			g_object_unref (array);
 no_data:
@@ -1044,7 +1044,7 @@ gpk_watch_set_status (GpkWatch *watch, PkStatusEnum status)
 
 	/* spin */
 	if (status == PK_STATUS_ENUM_WAIT)
-		gpk_modal_dialog_set_percentage (watch->priv->dialog, PK_CLIENT_PERCENTAGE_INVALID);
+		gpk_modal_dialog_set_percentage (watch->priv->dialog, -1);
 
 	/* do visual stuff when finished */
 	if (status == PK_STATUS_ENUM_FINISHED) {
@@ -1129,8 +1129,8 @@ gpk_watch_monitor_tid (GpkWatch *watch, const gchar *tid)
 	} else {
 		egg_warning ("GetProgress failed");
 		gpk_watch_progress_changed_cb (watch->priv->client_primary,
-						PK_CLIENT_PERCENTAGE_INVALID,
-						PK_CLIENT_PERCENTAGE_INVALID, 0, 0, watch);
+						-1,
+						-1, 0, 0, watch);
 	}
 
 	/* get the role */
@@ -1160,14 +1160,10 @@ gpk_watch_monitor_tid (GpkWatch *watch, const gchar *tid)
 		gchar *id;
 		PkItemPackage *obj;
 
-		id = xxxnotneededanymore (package_id);
-		if (id != NULL) {
-			obj = pk_package_obj_new (PK_INFO_ENUM_UNKNOWN, id, NULL);
-			egg_warning ("package_id=%s", package_id);
-			gpk_watch_package_cb (watch->priv->client_primary, obj, watch);
-			pk_package_obj_free (obj);
-		}
-		g_free (id);
+		obj = pk_package_obj_new (PK_INFO_ENUM_UNKNOWN, package_id, NULL);
+		egg_warning ("package_id=%s", package_id);
+		gpk_watch_package_cb (watch->priv->client_primary, obj, watch);
+		pk_package_obj_free (obj);
 	}
 
 	gpk_modal_dialog_present (watch->priv->dialog);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]