[gnome-packagekit] Adjust for PackageKit depends/requires API changes
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-packagekit] Adjust for PackageKit depends/requires API changes
- Date: Tue, 24 Dec 2013 14:03:30 +0000 (UTC)
commit 6e48adcc74795d30883e29e0e59ea42df01dd5b4
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sat Dec 21 20:22:20 2013 -0600
Adjust for PackageKit depends/requires API changes
Use the new API, but use macros to fallback to the old one
https://bugzilla.gnome.org/show_bug.cgi?id=720909
Signed-off-by: Richard Hughes <richard hughsie com>
src/gpk-application.c | 23 +++++++++++++----------
src/gpk-enum.c | 12 ++++++------
src/gpk-enum.h | 5 +++++
3 files changed, 24 insertions(+), 16 deletions(-)
---
diff --git a/src/gpk-application.c b/src/gpk-application.c
index 7442964..2d35bd4 100644
--- a/src/gpk-application.c
+++ b/src/gpk-application.c
@@ -48,6 +48,11 @@
#include "gpk-task.h"
#include "gpk-debug.h"
+#if (!PK_CHECK_VERSION(0,9,1))
+#define pk_client_depends_on_async pk_client_get_depends_async
+#define pk_client_required_by_async pk_client_get_requires_async
+#endif
+
typedef enum {
GPK_SEARCH_NAME,
GPK_SEARCH_DETAILS,
@@ -946,12 +951,11 @@ gpk_application_menu_requires_cb (GtkAction *action, GpkApplicationPrivate *priv
/* get the requires */
package_ids = pk_package_ids_from_id (package_id_selected);
- /* pk_client_get_depends/requires semantic is reversed */
- pk_client_get_depends_async (PK_CLIENT (priv->task),
- pk_bitfield_value (PK_FILTER_ENUM_NONE),
- package_ids, TRUE, priv->cancellable,
- (PkProgressCallback) gpk_application_progress_cb, priv,
- (GAsyncReadyCallback) gpk_application_get_depends_cb, priv);
+ pk_client_depends_on_async (PK_CLIENT (priv->task),
+ pk_bitfield_value (PK_FILTER_ENUM_NONE),
+ package_ids, TRUE, priv->cancellable,
+ (PkProgressCallback) gpk_application_progress_cb, priv,
+ (GAsyncReadyCallback) gpk_application_get_depends_cb, priv);
out:
g_free (package_id_selected);
@@ -1071,8 +1075,7 @@ gpk_application_menu_depends_cb (GtkAction *_action, GpkApplicationPrivate *priv
/* get the depends */
package_ids = pk_package_ids_from_id (package_id_selected);
- /* pk_client_get_depends/require semantic is reversed */
- pk_client_get_requires_async (PK_CLIENT (priv->task),
+ pk_client_required_by_async (PK_CLIENT (priv->task),
pk_bitfield_value (PK_FILTER_ENUM_NONE),
package_ids, TRUE, priv->cancellable,
(PkProgressCallback) gpk_application_progress_cb, priv,
@@ -3029,11 +3032,11 @@ pk_backend_status_get_properties_cb (GObject *object, GAsyncResult *res, GpkAppl
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_files"));
gtk_widget_hide (widget);
}
- if (pk_bitfield_contain (priv->roles, PK_ROLE_ENUM_GET_DEPENDS) == FALSE) {
+ if (pk_bitfield_contain (priv->roles, PK_ROLE_ENUM_DEPENDS_ON) == FALSE) {
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_depends"));
gtk_widget_hide (widget);
}
- if (pk_bitfield_contain (priv->roles, PK_ROLE_ENUM_GET_REQUIRES) == FALSE) {
+ if (pk_bitfield_contain (priv->roles, PK_ROLE_ENUM_REQUIRED_BY) == FALSE) {
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_requires"));
gtk_widget_hide (widget);
}
diff --git a/src/gpk-enum.c b/src/gpk-enum.c
index 606b8b3..1609ec7 100644
--- a/src/gpk-enum.c
+++ b/src/gpk-enum.c
@@ -144,16 +144,15 @@ static const PkEnumMatch enum_role_icon_name[] = {
{PK_ROLE_ENUM_UNKNOWN, "help-browser"}, /* fall though value */
{PK_ROLE_ENUM_ACCEPT_EULA, "pk-package-info"},
{PK_ROLE_ENUM_CANCEL, "process-stop"},
+ {PK_ROLE_ENUM_DEPENDS_ON, "pk-package-info"},
{PK_ROLE_ENUM_DOWNLOAD_PACKAGES, "pk-package-download"},
{PK_ROLE_ENUM_GET_CATEGORIES, "pk-package-info"},
- {PK_ROLE_ENUM_GET_DEPENDS, "pk-package-info"},
{PK_ROLE_ENUM_GET_DETAILS, "pk-package-info"},
{PK_ROLE_ENUM_GET_DISTRO_UPGRADES, "pk-package-info"},
{PK_ROLE_ENUM_GET_FILES, "pk-package-search"},
{PK_ROLE_ENUM_GET_OLD_TRANSACTIONS, "pk-package-info"},
{PK_ROLE_ENUM_GET_PACKAGES, "pk-package-search"},
{PK_ROLE_ENUM_GET_REPO_LIST, "pk-package-sources"},
- {PK_ROLE_ENUM_GET_REQUIRES, "pk-package-info"},
{PK_ROLE_ENUM_GET_UPDATE_DETAIL, "pk-package-info"},
{PK_ROLE_ENUM_GET_UPDATES, "pk-package-info"},
{PK_ROLE_ENUM_INSTALL_FILES, "pk-package-add"},
@@ -163,6 +162,7 @@ static const PkEnumMatch enum_role_icon_name[] = {
{PK_ROLE_ENUM_REMOVE_PACKAGES, "pk-package-delete"},
{PK_ROLE_ENUM_REPO_ENABLE, "pk-package-sources"},
{PK_ROLE_ENUM_REPO_SET_DATA, "pk-package-sources"},
+ {PK_ROLE_ENUM_REQUIRED_BY, "pk-package-info"},
{PK_ROLE_ENUM_RESOLVE, "pk-package-search"},
{PK_ROLE_ENUM_SEARCH_DETAILS, "pk-package-search"},
{PK_ROLE_ENUM_SEARCH_FILE, "pk-package-search"},
@@ -1202,7 +1202,7 @@ gpk_role_enum_to_localised_present (PkRoleEnum role)
/* TRANSLATORS: The role of the transaction, in present tense */
text = _("Unknown role type");
break;
- case PK_ROLE_ENUM_GET_DEPENDS:
+ case PK_ROLE_ENUM_DEPENDS_ON:
/* TRANSLATORS: The role of the transaction, in present tense */
text = _("Getting dependencies");
break;
@@ -1214,7 +1214,7 @@ gpk_role_enum_to_localised_present (PkRoleEnum role)
/* TRANSLATORS: The role of the transaction, in present tense */
text = _("Getting details");
break;
- case PK_ROLE_ENUM_GET_REQUIRES:
+ case PK_ROLE_ENUM_REQUIRED_BY:
/* TRANSLATORS: The role of the transaction, in present tense */
text = _("Getting requires");
break;
@@ -1338,7 +1338,7 @@ gpk_role_enum_to_localised_past (PkRoleEnum role)
/* TRANSLATORS: The role of the transaction, in past tense */
text = _("Unknown role type");
break;
- case PK_ROLE_ENUM_GET_DEPENDS:
+ case PK_ROLE_ENUM_DEPENDS_ON:
/* TRANSLATORS: The role of the transaction, in past tense */
text = _("Got dependencies");
break;
@@ -1350,7 +1350,7 @@ gpk_role_enum_to_localised_past (PkRoleEnum role)
/* TRANSLATORS: The role of the transaction, in past tense */
text = _("Got details");
break;
- case PK_ROLE_ENUM_GET_REQUIRES:
+ case PK_ROLE_ENUM_REQUIRED_BY:
/* TRANSLATORS: The role of the transaction, in past tense */
text = _("Got requires");
break;
diff --git a/src/gpk-enum.h b/src/gpk-enum.h
index 4ad5cff..4002879 100644
--- a/src/gpk-enum.h
+++ b/src/gpk-enum.h
@@ -65,6 +65,11 @@ typedef enum {
#define PK_ERROR_ENUM_LOCK_REQUIRED (PK_ERROR_ENUM_UNFINISHED_TRANSACTION+1)
#endif
+#if (!PK_CHECK_VERSION(0,9,1))
+#define PK_ROLE_ENUM_DEPENDS_ON (PK_ROLE_ENUM_GET_DEPENDS)
+#define PK_ROLE_ENUM_REQUIRED_BY (PK_ROLE_ENUM_GET_REQUIRES)
+#endif
+
const gchar *gpk_role_enum_to_localised_past (PkRoleEnum role)
G_GNUC_CONST;
const gchar *gpk_role_enum_to_localised_present (PkRoleEnum role)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]