Blob Blame Raw
From 32d3cf78b66cdc73e44049c893adb78806d28e9c Mon Sep 17 00:00:00 2001
From: Robert Ancell <robert.ancell@canonical.com>
Date: Wed, 12 Aug 2015 15:12:11 +1200
Subject: [PATCH] Correctly register enum properties

---
 lib/packagekit-glib2/pk-control.c                 |  7 ++---
 lib/packagekit-glib2/pk-details.c                 |  9 ++++---
 lib/packagekit-glib2/pk-distro-upgrade.c          |  9 ++++---
 lib/packagekit-glib2/pk-error.c                   |  9 ++++---
 lib/packagekit-glib2/pk-media-change-required.c   |  9 ++++---
 lib/packagekit-glib2/pk-package.c                 | 33 ++++++++++++-----------
 lib/packagekit-glib2/pk-repo-signature-required.c |  9 ++++---
 lib/packagekit-glib2/pk-require-restart.c         |  9 ++++---
 lib/packagekit-glib2/pk-results.c                 |  5 ++--
 lib/packagekit-glib2/pk-source.c                  |  9 ++++---
 lib/packagekit-glib2/pk-transaction-past.c        |  9 ++++---
 lib/packagekit-glib2/pk-update-detail.c           | 17 ++++++------
 12 files changed, 73 insertions(+), 61 deletions(-)

diff --git a/lib/packagekit-glib2/pk-control.c b/lib/packagekit-glib2/pk-control.c
index 0ce408b..94d26c8 100644
--- a/lib/packagekit-glib2/pk-control.c
+++ b/lib/packagekit-glib2/pk-control.c
@@ -38,6 +38,7 @@
 #include <packagekit-glib2/pk-common.h>
 #include <packagekit-glib2/pk-control.h>
 #include <packagekit-glib2/pk-version.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_control_finalize	(GObject     *object);
 
@@ -2106,7 +2107,7 @@ pk_control_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
 		g_value_set_boolean (value, priv->locked);
 		break;
 	case PROP_NETWORK_STATE:
-		g_value_set_uint (value, priv->network_state);
+		g_value_set_enum (value, priv->network_state);
 		break;
 	case PROP_DISTRO_ID:
 		g_value_set_string (value, priv->distro_id);
@@ -2271,8 +2272,8 @@ pk_control_class_init (PkControlClass *klass)
 	 *
 	 * Since: 0.5.3
 	 */
-	pspec = g_param_spec_uint ("network-state", NULL, NULL,
-				   0, G_MAXUINT, PK_NETWORK_ENUM_LAST,
+	pspec = g_param_spec_enum ("network-state", NULL, NULL,
+				   PK_TYPE_NETWORK_ENUM, PK_NETWORK_ENUM_LAST,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_NETWORK_STATE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-details.c b/lib/packagekit-glib2/pk-details.c
index 8195256..7122c30 100644
--- a/lib/packagekit-glib2/pk-details.c
+++ b/lib/packagekit-glib2/pk-details.c
@@ -33,6 +33,7 @@
 #include <glib-object.h>
 
 #include <packagekit-glib2/pk-details.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_details_finalize	(GObject     *object);
 
@@ -204,7 +205,7 @@ pk_details_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
 		g_value_set_string (value, priv->license);
 		break;
 	case PROP_GROUP:
-		g_value_set_uint (value, priv->group);
+		g_value_set_enum (value, priv->group);
 		break;
 	case PROP_DESCRIPTION:
 		g_value_set_string (value, priv->description);
@@ -243,7 +244,7 @@ pk_details_set_property (GObject *object, guint prop_id, const GValue *value, GP
 		priv->license = g_strdup (g_value_get_string (value));
 		break;
 	case PROP_GROUP:
-		priv->group = g_value_get_uint (value);
+		priv->group = g_value_get_enum (value);
 		break;
 	case PROP_DESCRIPTION:
 		g_free (priv->description);
@@ -303,8 +304,8 @@ pk_details_class_init (PkDetailsClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("group", NULL, NULL,
-				   0, G_MAXUINT, PK_GROUP_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("group", NULL, NULL,
+				   PK_TYPE_GROUP_ENUM, PK_GROUP_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_GROUP, pspec);
 
diff --git a/lib/packagekit-glib2/pk-distro-upgrade.c b/lib/packagekit-glib2/pk-distro-upgrade.c
index 01903d6..ac1a475 100644
--- a/lib/packagekit-glib2/pk-distro-upgrade.c
+++ b/lib/packagekit-glib2/pk-distro-upgrade.c
@@ -34,6 +34,7 @@
 
 #include <packagekit-glib2/pk-distro-upgrade.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_distro_upgrade_finalize	(GObject     *object);
 
@@ -125,7 +126,7 @@ pk_distro_upgrade_get_property (GObject *object, guint prop_id, GValue *value, G
 
 	switch (prop_id) {
 	case PROP_STATE:
-		g_value_set_uint (value, priv->state);
+		g_value_set_enum (value, priv->state);
 		break;
 	case PROP_NAME:
 		g_value_set_string (value, priv->name);
@@ -150,7 +151,7 @@ pk_distro_upgrade_set_property (GObject *object, guint prop_id, const GValue *va
 
 	switch (prop_id) {
 	case PROP_STATE:
-		priv->state = g_value_get_uint (value);
+		priv->state = g_value_get_enum (value);
 		break;
 	case PROP_NAME:
 		g_free (priv->name);
@@ -183,8 +184,8 @@ pk_distro_upgrade_class_init (PkDistroUpgradeClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("state", NULL, NULL,
-				   0, G_MAXUINT, PK_DISTRO_UPGRADE_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("state", NULL, NULL,
+				   PK_TYPE_DISTRO_UPGRADE_ENUM, PK_DISTRO_UPGRADE_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_STATE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-error.c b/lib/packagekit-glib2/pk-error.c
index bd4301f..fc2dcd8 100644
--- a/lib/packagekit-glib2/pk-error.c
+++ b/lib/packagekit-glib2/pk-error.c
@@ -34,6 +34,7 @@
 
 #include <packagekit-glib2/pk-error.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_error_finalize	(GObject     *object);
 
@@ -70,7 +71,7 @@ pk_error_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec
 
 	switch (prop_id) {
 	case PROP_CODE:
-		g_value_set_uint (value, priv->code);
+		g_value_set_enum (value, priv->code);
 		break;
 	case PROP_DETAILS:
 		g_value_set_string (value, priv->details);
@@ -92,7 +93,7 @@ pk_error_set_property (GObject *object, guint prop_id, const GValue *value, GPar
 
 	switch (prop_id) {
 	case PROP_CODE:
-		priv->code = g_value_get_uint (value);
+		priv->code = g_value_get_enum (value);
 		break;
 	case PROP_DETAILS:
 		g_free (priv->details);
@@ -145,8 +146,8 @@ pk_error_class_init (PkErrorClass *klass)
 	 *
 	 * Since: 0.5.5
 	 */
-	pspec = g_param_spec_uint ("code", NULL, NULL,
-				   0, G_MAXUINT, PK_ERROR_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("code", NULL, NULL,
+				   PK_TYPE_ERROR_ENUM, PK_ERROR_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_CODE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-media-change-required.c b/lib/packagekit-glib2/pk-media-change-required.c
index f816264..8e01aec 100644
--- a/lib/packagekit-glib2/pk-media-change-required.c
+++ b/lib/packagekit-glib2/pk-media-change-required.c
@@ -34,6 +34,7 @@
 
 #include <packagekit-glib2/pk-media-change-required.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_media_change_required_finalize	(GObject     *object);
 
@@ -72,7 +73,7 @@ pk_media_change_required_get_property (GObject *object, guint prop_id, GValue *v
 
 	switch (prop_id) {
 	case PROP_MEDIA_TYPE:
-		g_value_set_uint (value, priv->media_type);
+		g_value_set_enum (value, priv->media_type);
 		break;
 	case PROP_MEDIA_ID:
 		g_value_set_string (value, priv->media_id);
@@ -97,7 +98,7 @@ pk_media_change_required_set_property (GObject *object, guint prop_id, const GVa
 
 	switch (prop_id) {
 	case PROP_MEDIA_TYPE:
-		priv->media_type = g_value_get_uint (value);
+		priv->media_type = g_value_get_enum (value);
 		break;
 	case PROP_MEDIA_ID:
 		g_free (priv->media_id);
@@ -130,8 +131,8 @@ pk_media_change_required_class_init (PkMediaChangeRequiredClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("media-type", NULL, NULL,
-				   0, G_MAXUINT, PK_MEDIA_TYPE_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("media-type", NULL, NULL,
+				   PK_TYPE_MEDIA_TYPE_ENUM, PK_MEDIA_TYPE_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_MEDIA_TYPE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-package.c b/lib/packagekit-glib2/pk-package.c
index aebcad1..e0191b7 100644
--- a/lib/packagekit-glib2/pk-package.c
+++ b/lib/packagekit-glib2/pk-package.c
@@ -37,6 +37,7 @@
 #include <packagekit-glib2/pk-package.h>
 #include <packagekit-glib2/pk-common.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 #include <packagekit-glib2/pk-package-id.h>
 
 static void     pk_package_finalize	(GObject     *object);
@@ -430,13 +431,13 @@ pk_package_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
 		g_value_set_string (value, priv->summary);
 		break;
 	case PROP_INFO:
-		g_value_set_uint (value, priv->info);
+		g_value_set_enum (value, priv->info);
 		break;
 	case PROP_LICENSE:
 		g_value_set_string (value, priv->license);
 		break;
 	case PROP_GROUP:
-		g_value_set_uint (value, priv->group);
+		g_value_set_enum (value, priv->group);
 		break;
 	case PROP_DESCRIPTION:
 		g_value_set_string (value, priv->description);
@@ -463,7 +464,7 @@ pk_package_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
 		g_value_set_boxed (value, priv->update_cve_urls);
 		break;
 	case PROP_UPDATE_RESTART:
-		g_value_set_uint (value, priv->update_restart);
+		g_value_set_enum (value, priv->update_restart);
 		break;
 	case PROP_UPDATE_UPDATE_TEXT:
 		g_value_set_string (value, priv->update_text);
@@ -472,7 +473,7 @@ pk_package_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
 		g_value_set_string (value, priv->update_changelog);
 		break;
 	case PROP_UPDATE_STATE:
-		g_value_set_uint (value, priv->update_state);
+		g_value_set_enum (value, priv->update_state);
 		break;
 	case PROP_UPDATE_ISSUED:
 		g_value_set_string (value, priv->update_issued);
@@ -497,7 +498,7 @@ pk_package_set_property (GObject *object, guint prop_id, const GValue *value, GP
 
 	switch (prop_id) {
 	case PROP_INFO:
-		pk_package_set_info (package, g_value_get_uint (value));
+		pk_package_set_info (package, g_value_get_enum (value));
 		break;
 	case PROP_SUMMARY:
 		pk_package_set_summary (package, g_value_get_string (value));
@@ -507,7 +508,7 @@ pk_package_set_property (GObject *object, guint prop_id, const GValue *value, GP
 		priv->license = g_strdup (g_value_get_string (value));
 		break;
 	case PROP_GROUP:
-		priv->group = g_value_get_uint (value);
+		priv->group = g_value_get_enum (value);
 		break;
 	case PROP_DESCRIPTION:
 		g_free (priv->description);
@@ -541,7 +542,7 @@ pk_package_set_property (GObject *object, guint prop_id, const GValue *value, GP
 		priv->update_cve_urls = g_strdupv (g_value_get_boxed (value));
 		break;
 	case PROP_UPDATE_RESTART:
-		priv->update_restart = g_value_get_uint (value);
+		priv->update_restart = g_value_get_enum (value);
 		break;
 	case PROP_UPDATE_UPDATE_TEXT:
 		g_free (priv->update_text);
@@ -552,7 +553,7 @@ pk_package_set_property (GObject *object, guint prop_id, const GValue *value, GP
 		priv->update_changelog = g_strdup (g_value_get_string (value));
 		break;
 	case PROP_UPDATE_STATE:
-		priv->update_state = g_value_get_uint (value);
+		priv->update_state = g_value_get_enum (value);
 		break;
 	case PROP_UPDATE_ISSUED:
 		g_free (priv->update_issued);
@@ -586,9 +587,9 @@ pk_package_class_init (PkPackageClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("info", NULL,
+	pspec = g_param_spec_enum ("info", NULL,
 				   "The PkInfoEnum package type, e.g. PK_INFO_ENUM_NORMAL",
-				   0, G_MAXUINT, PK_INFO_ENUM_UNKNOWN,
+				   PK_TYPE_INFO_ENUM, PK_INFO_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_INFO, pspec);
 
@@ -630,9 +631,9 @@ pk_package_class_init (PkPackageClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("group", NULL,
+	pspec = g_param_spec_enum ("group", NULL,
 				   "The package group",
-				   0, PK_GROUP_ENUM_LAST, PK_GROUP_ENUM_UNKNOWN,
+				   PK_TYPE_GROUP_ENUM, PK_GROUP_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_GROUP, pspec);
 
@@ -729,9 +730,9 @@ pk_package_class_init (PkPackageClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("update-restart", NULL,
+	pspec = g_param_spec_enum ("update-restart", NULL,
 				   "The update restart type",
-				   0, PK_RESTART_ENUM_LAST, PK_RESTART_ENUM_UNKNOWN,
+				   PK_TYPE_RESTART_ENUM, PK_RESTART_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_UPDATE_RESTART, pspec);
 
@@ -762,9 +763,9 @@ pk_package_class_init (PkPackageClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("update-state", NULL,
+	pspec = g_param_spec_enum ("update-state", NULL,
 				   "The update state",
-				   0, PK_UPDATE_STATE_ENUM_LAST, PK_UPDATE_STATE_ENUM_UNKNOWN,
+				   PK_TYPE_UPDATE_STATE_ENUM, PK_UPDATE_STATE_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_UPDATE_STATE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-repo-signature-required.c b/lib/packagekit-glib2/pk-repo-signature-required.c
index b88dc6a..e404ae8 100644
--- a/lib/packagekit-glib2/pk-repo-signature-required.c
+++ b/lib/packagekit-glib2/pk-repo-signature-required.c
@@ -34,6 +34,7 @@
 
 #include <packagekit-glib2/pk-repo-signature-required.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_repo_signature_required_finalize	(GObject     *object);
 
@@ -103,7 +104,7 @@ pk_repo_signature_required_get_property (GObject *object, guint prop_id, GValue
 		g_value_set_string (value, priv->key_timestamp);
 		break;
 	case PROP_TYPE:
-		g_value_set_uint (value, priv->type);
+		g_value_set_enum (value, priv->type);
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -150,7 +151,7 @@ pk_repo_signature_required_set_property (GObject *object, guint prop_id, const G
 		priv->key_timestamp = g_strdup (g_value_get_string (value));
 		break;
 	case PROP_TYPE:
-		priv->type = g_value_get_uint (value);
+		priv->type = g_value_get_enum (value);
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -245,8 +246,8 @@ pk_repo_signature_required_class_init (PkRepoSignatureRequiredClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("type", NULL, NULL,
-				   0, G_MAXUINT, PK_SIGTYPE_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("type", NULL, NULL,
+				   PK_TYPE_SIG_TYPE_ENUM, PK_SIGTYPE_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_TYPE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-require-restart.c b/lib/packagekit-glib2/pk-require-restart.c
index f3f47e4..3a22878 100644
--- a/lib/packagekit-glib2/pk-require-restart.c
+++ b/lib/packagekit-glib2/pk-require-restart.c
@@ -34,6 +34,7 @@
 
 #include <packagekit-glib2/pk-require-restart.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_require_restart_finalize	(GObject     *object);
 
@@ -70,7 +71,7 @@ pk_require_restart_get_property (GObject *object, guint prop_id, GValue *value,
 
 	switch (prop_id) {
 	case PROP_RESTART:
-		g_value_set_uint (value, priv->restart);
+		g_value_set_enum (value, priv->restart);
 		break;
 	case PROP_PACKAGE_ID:
 		g_value_set_string (value, priv->package_id);
@@ -92,7 +93,7 @@ pk_require_restart_set_property (GObject *object, guint prop_id, const GValue *v
 
 	switch (prop_id) {
 	case PROP_RESTART:
-		priv->restart = g_value_get_uint (value);
+		priv->restart = g_value_get_enum (value);
 		break;
 	case PROP_PACKAGE_ID:
 		g_free (priv->package_id);
@@ -121,8 +122,8 @@ pk_require_restart_class_init (PkRequireRestartClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("restart", NULL, NULL,
-				   0, G_MAXUINT, PK_RESTART_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("restart", NULL, NULL,
+				   PK_TYPE_RESTART_ENUM, PK_RESTART_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_RESTART, pspec);
 
diff --git a/lib/packagekit-glib2/pk-results.c b/lib/packagekit-glib2/pk-results.c
index 3891c39..115ce57 100644
--- a/lib/packagekit-glib2/pk-results.c
+++ b/lib/packagekit-glib2/pk-results.c
@@ -35,6 +35,7 @@
 
 #include <packagekit-glib2/pk-results.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_results_finalize	(GObject     *object);
 
@@ -820,8 +821,8 @@ pk_results_class_init (PkResultsClass *klass)
 	 *
 	 * Since: 0.5.2
 	 */
-	pspec = g_param_spec_uint ("role", NULL, NULL,
-				   0, PK_ROLE_ENUM_LAST, PK_ROLE_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("role", NULL, NULL,
+				   PK_TYPE_ROLE_ENUM, PK_ROLE_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_ROLE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-source.c b/lib/packagekit-glib2/pk-source.c
index 73830eb..c11f4cc 100644
--- a/lib/packagekit-glib2/pk-source.c
+++ b/lib/packagekit-glib2/pk-source.c
@@ -33,6 +33,7 @@
 
 #include <packagekit-glib2/pk-source.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_source_finalize	(GObject     *object);
 
@@ -69,7 +70,7 @@ pk_source_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
 
 	switch (prop_id) {
 	case PROP_ROLE:
-		g_value_set_uint (value, priv->role);
+		g_value_set_enum (value, priv->role);
 		break;
 	case PROP_TRANSACTION_ID:
 		g_value_set_string (value, priv->transaction_id);
@@ -91,7 +92,7 @@ pk_source_set_property (GObject *object, guint prop_id, const GValue *value, GPa
 
 	switch (prop_id) {
 	case PROP_ROLE:
-		priv->role = g_value_get_uint (value);
+		priv->role = g_value_get_enum (value);
 		break;
 	case PROP_TRANSACTION_ID:
 		g_free (priv->transaction_id);
@@ -120,8 +121,8 @@ pk_source_class_init (PkSourceClass *klass)
 	 *
 	 * Since: 0.6.0
 	 */
-	pspec = g_param_spec_uint ("role", NULL, NULL,
-				   0, G_MAXUINT, PK_ROLE_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("role", NULL, NULL,
+				   PK_TYPE_ROLE_ENUM, PK_ROLE_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_ROLE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-transaction-past.c b/lib/packagekit-glib2/pk-transaction-past.c
index 65a9672..114924b 100644
--- a/lib/packagekit-glib2/pk-transaction-past.c
+++ b/lib/packagekit-glib2/pk-transaction-past.c
@@ -35,6 +35,7 @@
 #include <packagekit-glib2/pk-transaction-past.h>
 #include <packagekit-glib2/pk-common.h>
 #include <packagekit-glib2/pk-enum.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_transaction_past_finalize	(GObject     *object);
 
@@ -273,7 +274,7 @@ pk_transaction_past_get_property (GObject *object, guint prop_id, GValue *value,
 		g_value_set_boolean (value, priv->succeeded);
 		break;
 	case PROP_ROLE:
-		g_value_set_uint (value, priv->role);
+		g_value_set_enum (value, priv->role);
 		break;
 	case PROP_DURATION:
 		g_value_set_uint (value, priv->duration);
@@ -315,7 +316,7 @@ pk_transaction_past_set_property (GObject *object, guint prop_id, const GValue *
 		priv->succeeded = g_value_get_boolean (value);
 		break;
 	case PROP_ROLE:
-		priv->role = g_value_get_uint (value);
+		priv->role = g_value_get_enum (value);
 		break;
 	case PROP_DURATION:
 		priv->duration = g_value_get_uint (value);
@@ -384,8 +385,8 @@ pk_transaction_past_class_init (PkTransactionPastClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("role", NULL, NULL,
-				   0, G_MAXUINT, PK_ROLE_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("role", NULL, NULL,
+				   PK_TYPE_ROLE_ENUM, PK_ROLE_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_ROLE, pspec);
 
diff --git a/lib/packagekit-glib2/pk-update-detail.c b/lib/packagekit-glib2/pk-update-detail.c
index e1cb7b4..50b6c2c 100644
--- a/lib/packagekit-glib2/pk-update-detail.c
+++ b/lib/packagekit-glib2/pk-update-detail.c
@@ -33,6 +33,7 @@
 #include <glib-object.h>
 
 #include <packagekit-glib2/pk-update-detail.h>
+#include <packagekit-glib2/pk-enum-types.h>
 
 static void     pk_update_detail_finalize	(GObject     *object);
 
@@ -310,7 +311,7 @@ pk_update_detail_get_property (GObject *object, guint prop_id, GValue *value, GP
 		g_value_set_boxed (value, priv->cve_urls);
 		break;
 	case PROP_RESTART:
-		g_value_set_uint (value, priv->restart);
+		g_value_set_enum (value, priv->restart);
 		break;
 	case PROP_UPDATE_TEXT:
 		g_value_set_string (value, priv->update_text);
@@ -319,7 +320,7 @@ pk_update_detail_get_property (GObject *object, guint prop_id, GValue *value, GP
 		g_value_set_string (value, priv->changelog);
 		break;
 	case PROP_STATE:
-		g_value_set_uint (value, priv->state);
+		g_value_set_enum (value, priv->state);
 		break;
 	case PROP_ISSUED:
 		g_value_set_string (value, priv->issued);
@@ -368,7 +369,7 @@ pk_update_detail_set_property (GObject *object, guint prop_id, const GValue *val
 		priv->cve_urls = g_strdupv (g_value_get_boxed (value));
 		break;
 	case PROP_RESTART:
-		priv->restart = g_value_get_uint (value);
+		priv->restart = g_value_get_enum (value);
 		break;
 	case PROP_UPDATE_TEXT:
 		g_free (priv->update_text);
@@ -379,7 +380,7 @@ pk_update_detail_set_property (GObject *object, guint prop_id, const GValue *val
 		priv->changelog = g_strdup (g_value_get_string (value));
 		break;
 	case PROP_STATE:
-		priv->state = g_value_get_uint (value);
+		priv->state = g_value_get_enum (value);
 		break;
 	case PROP_ISSUED:
 		g_free (priv->issued);
@@ -472,8 +473,8 @@ pk_update_detail_class_init (PkUpdateDetailClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("restart", NULL, NULL,
-				   0, G_MAXUINT, PK_RESTART_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("restart", NULL, NULL,
+				   PK_TYPE_RESTART_ENUM, PK_RESTART_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_RESTART, pspec);
 
@@ -502,8 +503,8 @@ pk_update_detail_class_init (PkUpdateDetailClass *klass)
 	 *
 	 * Since: 0.5.4
 	 */
-	pspec = g_param_spec_uint ("state", NULL, NULL,
-				   0, G_MAXUINT, PK_UPDATE_STATE_ENUM_UNKNOWN,
+	pspec = g_param_spec_enum ("state", NULL, NULL,
+				   PK_TYPE_UPDATE_STATE_ENUM, PK_UPDATE_STATE_ENUM_UNKNOWN,
 				   G_PARAM_READWRITE);
 	g_object_class_install_property (object_class, PROP_STATE, pspec);
 
-- 
2.4.3