[gnome-packagekit/glib2: 17/79] moo
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-packagekit/glib2: 17/79] moo
- Date: Tue, 6 Oct 2009 09:46:20 +0000 (UTC)
commit 84dd7a6b185a4a6850d1d64ad5ed33b3c47a7aea
Author: Richard Hughes <richard hughsie com>
Date: Wed Sep 16 11:53:56 2009 +0100
moo
src/gpk-common.c | 39 +++++++++++++++++++--------------------
src/gpk-common.h | 5 ++---
src/gpk-dbus-task.c | 2 +-
3 files changed, 22 insertions(+), 24 deletions(-)
---
diff --git a/src/gpk-common.c b/src/gpk-common.c
index a4e166e..8499b23 100644
--- a/src/gpk-common.c
+++ b/src/gpk-common.c
@@ -50,31 +50,30 @@
/* static, so local to process */
static gboolean small_form_factor_mode = FALSE;
-#if (!PK_CHECK_VERSION(0,5,0))
/**
- * gpk_error_code_is_need_untrusted:
- * @error_code: the transactions #PkErrorCodeEnum
+ * pk_strv_to_ptr_array:
+ * @array: the gchar** array of strings
*
- * Return value: if the error code suggests to try with only_trusted %FALSE
+ * Form a GPtrArray array of strings.
+ * The data in the array is copied.
+ *
+ * Return value: the string array, or %NULL if invalid
**/
-gboolean
-gpk_error_code_is_need_untrusted (PkErrorCodeEnum error_code)
+GPtrArray *
+pk_strv_to_ptr_array (gchar **array)
{
- gboolean ret = FALSE;
- switch (error_code) {
- case PK_ERROR_ENUM_GPG_FAILURE:
- case PK_ERROR_ENUM_BAD_GPG_SIGNATURE:
- case PK_ERROR_ENUM_MISSING_GPG_SIGNATURE:
- case PK_ERROR_ENUM_CANNOT_INSTALL_REPO_UNSIGNED:
- case PK_ERROR_ENUM_CANNOT_UPDATE_REPO_UNSIGNED:
- ret = TRUE;
- break;
- default:
- break;
- }
- return ret;
+ guint i;
+ guint length;
+ GPtrArray *parray;
+
+ g_return_val_if_fail (array != NULL, NULL);
+
+ parray = g_ptr_array_new ();
+ length = g_strv_length (array);
+ for (i=0; i<length; i++)
+ g_ptr_array_add (parray, g_strdup (array[i]));
+ return parray;
}
-#endif
/**
* gtk_text_buffer_insert_markup:
diff --git a/src/gpk-common.h b/src/gpk-common.h
index 4a867e2..383326a 100644
--- a/src/gpk-common.h
+++ b/src/gpk-common.h
@@ -112,9 +112,8 @@ gboolean gpk_window_set_size_request (GtkWindow *window,
gboolean gpk_ignore_session_error (GError *error);
gboolean gpk_window_set_parent_xid (GtkWindow *window,
guint32 xid);
-#if (!PK_CHECK_VERSION(0,5,0))
-gboolean gpk_error_code_is_need_untrusted (PkErrorCodeEnum error_code);
-#endif
+GPtrArray *pk_strv_to_ptr_array (gchar **array)
+ G_GNUC_WARN_UNUSED_RESULT;
G_END_DECLS
diff --git a/src/gpk-dbus-task.c b/src/gpk-dbus-task.c
index fc259a5..4868474 100644
--- a/src/gpk-dbus-task.c
+++ b/src/gpk-dbus-task.c
@@ -3311,7 +3311,7 @@ gpk_dbus_task_init (GpkDbusTask *task)
/* get actions */
task->priv->control = pk_control_new ();
- task->priv->roles = pk_control_get_properties (task->priv->control, NULL);
+ task->priv->roles = pk_control_get_properties (task->priv->control, NULL, NULL);
task->priv->client_primary = pk_client_new ();
g_signal_connect (task->priv->client_primary, "finished",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]