diff options
author | Michal Minar <miminar@redhat.com> | 2014-06-24 07:58:02 +0200 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2014-06-24 08:06:37 +0200 |
commit | 66d6716ba9c89c4e0f17348f37d51cf9441ce3f9 (patch) | |
tree | 31d37d03d82e76f80a3e43bb03047d7efd3af67c | |
parent | cca4daf752e94d5d0c91cd50428c70273c50f169 (diff) | |
download | openlmi-providers-66d6716ba9c89c4e0f17348f37d51cf9441ce3f9.tar.gz openlmi-providers-66d6716ba9c89c4e0f17348f37d51cf9441ce3f9.tar.xz openlmi-providers-66d6716ba9c89c4e0f17348f37d51cf9441ce3f9.zip |
software: support older versions of PackageKit api
continuation of former commit (dbddcd9) replacing pk_details_* functions
unavailable in PackageKit v0.8.9
-rw-r--r-- | src/software-dbus/LMI_ResourceForSoftwareIdentityProvider.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/software-dbus/LMI_ResourceForSoftwareIdentityProvider.c b/src/software-dbus/LMI_ResourceForSoftwareIdentityProvider.c index 62864fd..930dc25 100644 --- a/src/software-dbus/LMI_ResourceForSoftwareIdentityProvider.c +++ b/src/software-dbus/LMI_ResourceForSoftwareIdentityProvider.c @@ -86,7 +86,6 @@ static CMPIStatus enum_instances(const CMPIResult *cr, const char *ns, GHashTableIter iter; gchar *repo_id = NULL, *pkg_id = NULL, **values = NULL, **pk_det_id_split = NULL; - const gchar *pkg_id_c = NULL; unsigned i, j; char error_msg[BUFLEN] = ""; @@ -180,9 +179,11 @@ static CMPIStatus enum_instances(const CMPIResult *cr, const char *ns, if (det_array && det_array->len > 0) { for (i = 0; i < det_array->len; i++) { - pkg_id_c = pk_details_get_package_id(g_ptr_array_index(det_array, i)); - pk_det_id_split = pk_package_id_split(pkg_id_c); + g_object_get(g_ptr_array_index(det_array, i), + "package-id", &pkg_id, NULL); + pk_det_id_split = pk_package_id_split(pkg_id); if (!pk_det_id_split) { + g_free(pkg_id); continue; } @@ -192,8 +193,9 @@ static CMPIStatus enum_instances(const CMPIResult *cr, const char *ns, pk_det_id_split = NULL; if (sir) { - k_return_rfsi(pkg_id_c, sir, cr, ns, names); + k_return_rfsi(pkg_id, sir, cr, ns, names); } + g_free(pkg_id); } g_ptr_array_unref(det_array); det_array = NULL; @@ -376,7 +378,6 @@ static void enum_sw_instance_names_for_repo(const char *repo_id_p, GPtrArray *pkg_array = NULL, *det_array = NULL, *repo_array = NULL, *array = NULL; gchar *repo_id = NULL, *pkg_id = NULL, **values = NULL; - const gchar *pkg_id_c = NULL; short found; unsigned i, j; @@ -447,8 +448,9 @@ static void enum_sw_instance_names_for_repo(const char *repo_id_p, if (det_array && det_array->len > 0) { for (i = 0; i < det_array->len; i++) { - pkg_id_c = pk_details_get_package_id(g_ptr_array_index(det_array, i)); - k_return_sw_identity_op_from_pkg_id(pkg_id_c, _cb, ns, cr); + g_object_get(g_ptr_array_index(det_array, i), "package-id", &pkg_id, NULL); + k_return_sw_identity_op_from_pkg_id(pkg_id, _cb, ns, cr); + g_free(pkg_id); } g_ptr_array_unref(det_array); det_array = NULL; |