[packagekit] [PATCH 4/4] Get detail info for dependency packages
Zhang Qiang
qiang.z.zhang at intel.com
Sun Sep 26 01:22:12 PDT 2010
This patch provide the function to get the package/update details
information for dependency packages.
without this patch, the details info of dependency package is empty.
Related MeeGo bug: BMC#6616,6617.
---
src/gpk-update-viewer.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index 0bde267..017a951 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -50,6 +50,9 @@
#define GPK_UPDATE_VIEWER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GPK_TYPE_UPDATE_VIEWER, GpkUpdateViewerPrivate))
+static void gpk_update_viewer_get_update_detail_cb (PkClient *client, GAsyncResult *res, GpkUpdateViewer *update_viewer);
+static void gpk_update_viewer_get_details_cb (PkClient *client, GAsyncResult *res, GpkUpdateViewer *update_viewer);
+
struct GpkUpdateViewerPrivate
{
gboolean ignore_updates_changed;
@@ -958,6 +961,21 @@ gpk_update_viewer_progress_cb (PkProgress *progress, PkProgressType type, GpkUpd
egg_warning ("found no package %s", package_id);
goto out;
}
+
+ if (role == PK_ROLE_ENUM_SIMULATE_UPDATE_PACKAGES) {
+ gchar **package_ids;
+
+ package_ids = pk_package_ids_from_string (package_id);
+ /* get the details of dependency packages */
+ pk_client_get_update_detail_async (PK_CLIENT(priv->task), package_ids, priv->cancellable,
+ (PkProgressCallback) gpk_update_viewer_progress_cb, update_viewer,
+ (GAsyncReadyCallback) gpk_update_viewer_get_update_detail_cb, update_viewer);
+ /* get the size of dependency packages */
+ pk_client_get_details_async (PK_CLIENT(priv->task), package_ids, priv->cancellable,
+ (PkProgressCallback) gpk_update_viewer_progress_cb, update_viewer,
+ (GAsyncReadyCallback) gpk_update_viewer_get_details_cb, update_viewer);
+ g_strfreev (package_ids);
+ }
}
gtk_tree_model_get_iter (model, &iter, path);
--
1.7.2.2
More information about the PackageKit
mailing list