seahorse r2508 - in trunk: . libseahorse pkcs11 src



Author: nnielsen
Date: Sun Sep 14 14:14:08 2008
New Revision: 2508
URL: http://svn.gnome.org/viewvc/seahorse?rev=2508&view=rev

Log:
	* libseahorse/seahorse-set-model.c:
	* pkcs11/seahorse-pkcs11-certificate.vala:
	* src/seahorse-key-manager-store.c: Fix problems with validity
	and trust columns being the wrong type in the tree model.


Modified:
   trunk/ChangeLog
   trunk/libseahorse/seahorse-set-model.c
   trunk/pkcs11/seahorse-pkcs11-certificate.c
   trunk/pkcs11/seahorse-pkcs11-certificate.h
   trunk/pkcs11/seahorse-pkcs11-certificate.vala
   trunk/pkcs11/vala-build.stamp
   trunk/src/seahorse-key-manager-store.c

Modified: trunk/libseahorse/seahorse-set-model.c
==============================================================================
--- trunk/libseahorse/seahorse-set-model.c	(original)
+++ trunk/libseahorse/seahorse-set-model.c	Sun Sep 14 14:14:08 2008
@@ -389,7 +389,6 @@
 	spec = g_object_class_find_property (G_OBJECT_GET_CLASS (sobj), property);
 	if (spec) {
 		if (spec->value_type != type) {
-			g_value_set_string (value, "");
 			g_warning ("%s property of %s class was of type %s instead of type %s", 
 			           property, G_OBJECT_TYPE_NAME (sobj), 
 			           g_type_name (spec->value_type), g_type_name (type));

Modified: trunk/pkcs11/seahorse-pkcs11-certificate.c
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-certificate.c	(original)
+++ trunk/pkcs11/seahorse-pkcs11-certificate.c	Sun Sep 14 14:14:08 2008
@@ -188,11 +188,11 @@
 }
 
 
-gint seahorse_pkcs11_certificate_get_validity (SeahorsePkcs11Certificate* self) {
-	g_return_val_if_fail (SEAHORSE_PKCS11_IS_CERTIFICATE (self), 0);
+guint seahorse_pkcs11_certificate_get_validity (SeahorsePkcs11Certificate* self) {
+	g_return_val_if_fail (SEAHORSE_PKCS11_IS_CERTIFICATE (self), 0U);
 	/* TODO: We need to implement proper validity checking */
 	;
-	return ((gint) (SEAHORSE_VALIDITY_UNKNOWN));
+	return ((guint) (SEAHORSE_VALIDITY_UNKNOWN));
 }
 
 
@@ -204,21 +204,21 @@
 }
 
 
-gint seahorse_pkcs11_certificate_get_trust (SeahorsePkcs11Certificate* self) {
+guint seahorse_pkcs11_certificate_get_trust (SeahorsePkcs11Certificate* self) {
 	gulong trust;
-	g_return_val_if_fail (SEAHORSE_PKCS11_IS_CERTIFICATE (self), 0);
+	g_return_val_if_fail (SEAHORSE_PKCS11_IS_CERTIFICATE (self), 0U);
 	trust = 0UL;
 	if (self->priv->_pkcs11_attributes == NULL || !gp11_attributes_find_ulong (self->priv->_pkcs11_attributes, CKA_GNOME_USER_TRUST, &trust)) {
-		return ((gint) (SEAHORSE_VALIDITY_UNKNOWN));
+		return ((guint) (SEAHORSE_VALIDITY_UNKNOWN));
 	}
 	if (trust == CKT_GNOME_TRUSTED) {
-		return ((gint) (SEAHORSE_VALIDITY_FULL));
+		return ((guint) (SEAHORSE_VALIDITY_FULL));
 	} else {
 		if (trust == CKT_GNOME_UNTRUSTED) {
-			return ((gint) (SEAHORSE_VALIDITY_NEVER));
+			return ((guint) (SEAHORSE_VALIDITY_NEVER));
 		}
 	}
-	return ((gint) (SEAHORSE_VALIDITY_UNKNOWN));
+	return ((guint) (SEAHORSE_VALIDITY_UNKNOWN));
 }
 
 
@@ -288,13 +288,13 @@
 		g_value_set_string (value, seahorse_pkcs11_certificate_get_fingerprint (self));
 		break;
 		case SEAHORSE_PKCS11_CERTIFICATE_VALIDITY:
-		g_value_set_int (value, seahorse_pkcs11_certificate_get_validity (self));
+		g_value_set_uint (value, seahorse_pkcs11_certificate_get_validity (self));
 		break;
 		case SEAHORSE_PKCS11_CERTIFICATE_VALIDITY_STR:
 		g_value_set_string (value, seahorse_pkcs11_certificate_get_validity_str (self));
 		break;
 		case SEAHORSE_PKCS11_CERTIFICATE_TRUST:
-		g_value_set_int (value, seahorse_pkcs11_certificate_get_trust (self));
+		g_value_set_uint (value, seahorse_pkcs11_certificate_get_trust (self));
 		break;
 		case SEAHORSE_PKCS11_CERTIFICATE_TRUST_STR:
 		g_value_set_string (value, seahorse_pkcs11_certificate_get_trust_str (self));
@@ -348,9 +348,9 @@
 	g_object_class_override_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_MARKUP, "markup");
 	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_SIMPLE_NAME, g_param_spec_string ("simple-name", "simple-name", "simple-name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
 	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_FINGERPRINT, g_param_spec_string ("fingerprint", "fingerprint", "fingerprint", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_VALIDITY, g_param_spec_int ("validity", "validity", "validity", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_VALIDITY, g_param_spec_uint ("validity", "validity", "validity", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
 	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_VALIDITY_STR, g_param_spec_string ("validity-str", "validity-str", "validity-str", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
-	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_TRUST, g_param_spec_int ("trust", "trust", "trust", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
+	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_TRUST, g_param_spec_uint ("trust", "trust", "trust", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
 	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_TRUST_STR, g_param_spec_string ("trust-str", "trust-str", "trust-str", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
 	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_EXPIRES, g_param_spec_ulong ("expires", "expires", "expires", 0, G_MAXULONG, 0UL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
 	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAHORSE_PKCS11_CERTIFICATE_EXPIRES_STR, g_param_spec_string ("expires-str", "expires-str", "expires-str", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));

Modified: trunk/pkcs11/seahorse-pkcs11-certificate.h
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-certificate.h	(original)
+++ trunk/pkcs11/seahorse-pkcs11-certificate.h	Sun Sep 14 14:14:08 2008
@@ -42,9 +42,9 @@
 char* seahorse_pkcs11_certificate_get_display_id (SeahorsePkcs11Certificate* self);
 const char* seahorse_pkcs11_certificate_get_simple_name (SeahorsePkcs11Certificate* self);
 char* seahorse_pkcs11_certificate_get_fingerprint (SeahorsePkcs11Certificate* self);
-gint seahorse_pkcs11_certificate_get_validity (SeahorsePkcs11Certificate* self);
+guint seahorse_pkcs11_certificate_get_validity (SeahorsePkcs11Certificate* self);
 char* seahorse_pkcs11_certificate_get_validity_str (SeahorsePkcs11Certificate* self);
-gint seahorse_pkcs11_certificate_get_trust (SeahorsePkcs11Certificate* self);
+guint seahorse_pkcs11_certificate_get_trust (SeahorsePkcs11Certificate* self);
 char* seahorse_pkcs11_certificate_get_trust_str (SeahorsePkcs11Certificate* self);
 gulong seahorse_pkcs11_certificate_get_expires (SeahorsePkcs11Certificate* self);
 char* seahorse_pkcs11_certificate_get_expires_str (SeahorsePkcs11Certificate* self);

Modified: trunk/pkcs11/seahorse-pkcs11-certificate.vala
==============================================================================
--- trunk/pkcs11/seahorse-pkcs11-certificate.vala	(original)
+++ trunk/pkcs11/seahorse-pkcs11-certificate.vala	Sun Sep 14 14:14:08 2008
@@ -58,7 +58,7 @@
 			}
 		}
 		
-		public int validity { 
+		public uint validity { 
 			get { 
 				/* TODO: We need to implement proper validity checking */; 
 				return Validity.UNKNOWN;
@@ -69,7 +69,7 @@
 			get { return Util.validity_to_string((Seahorse.Validity)validity); }
 		}
 
-		public int trust {
+		public uint trust {
 			get { 
 				ulong trust;
 				if (_pkcs11_attributes == null ||

Modified: trunk/pkcs11/vala-build.stamp
==============================================================================
--- trunk/pkcs11/vala-build.stamp	(original)
+++ trunk/pkcs11/vala-build.stamp	Sun Sep 14 14:14:08 2008
@@ -1 +1 @@
-1221099095
+1221401269

Modified: trunk/src/seahorse-key-manager-store.c
==============================================================================
--- trunk/src/seahorse-key-manager-store.c	(original)
+++ trunk/src/seahorse-key-manager-store.c	Sun Sep 14 14:14:08 2008
@@ -59,7 +59,7 @@
 };
 
 static const SeahorseSetModelColumn column_info[] = {
-	{ "usage", G_TYPE_INT, "usage" },
+	{ "usage", G_TYPE_UINT, "usage" },
 	{ "stock-id", G_TYPE_STRING, NULL },
 	{ "markup", G_TYPE_STRING, "name" },
 	{ "display-id", G_TYPE_STRING, "id" },
@@ -67,9 +67,9 @@
 	{ "trust-str", G_TYPE_STRING, "trust" },
 	{ "type", G_TYPE_STRING, "type" },
 	{ "expires-str", G_TYPE_STRING, "expires" },
-	{ "validity", G_TYPE_INT, "validity" },
+	{ "validity", G_TYPE_UINT, "validity" },
 	{ "expires", G_TYPE_ULONG, "expires" },
-	{ "trust", G_TYPE_INT, "trust" }
+	{ "trust", G_TYPE_UINT, "trust" }
 };
 
 enum {
@@ -158,8 +158,7 @@
     if (SEAHORSE_IS_KEY_MANAGER_STORE (model))
         return SEAHORSE_KEY_MANAGER_STORE (model);
     
-    g_assert_not_reached ();
-    return NULL;
+    g_return_val_if_reached (NULL);
 }
 
 /* Given an iterator find the associated object */
@@ -171,6 +170,7 @@
 	/* Convert to base iter if necessary */
 	if (!SEAHORSE_IS_KEY_MANAGER_STORE (model)) {
 		SeahorseKeyManagerStore* skstore = key_store_from_model (model);
+		g_return_val_if_fail (SEAHORSE_IS_KEY_MANAGER_STORE (skstore), NULL);
 		get_base_iter (skstore, &i, iter);
         
 		iter = &i;
@@ -352,8 +352,8 @@
     g_assert (GTK_IS_TREE_VIEW (view));
     
     if (g_str_equal (key, KEY_MANAGER_SORT_KEY)) {
-        skstore = key_store_from_model (gtk_tree_view_get_model(view));
-        g_return_if_fail (skstore != NULL);
+        skstore = key_store_from_model (gtk_tree_view_get_model (view));
+        g_return_if_fail (SEAHORSE_IS_KEY_MANAGER_STORE (skstore));
         set_sort_to (skstore, gconf_value_get_string (gconf_entry_get_value (entry)));
     }
     
@@ -902,6 +902,7 @@
     
     g_return_val_if_fail (GTK_IS_TREE_VIEW (view), NULL);
     skstore = key_store_from_model (gtk_tree_view_get_model (view));
+    g_return_val_if_fail (SEAHORSE_IS_KEY_MANAGER_STORE (skstore), NULL);
     return seahorse_set_get_objects (SEAHORSE_SET_MODEL (skstore)->set);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]