seahorse r2766 - in trunk: . pgp



Author: nnielsen
Date: Thu Feb  5 04:06:39 2009
New Revision: 2766
URL: http://svn.gnome.org/viewvc/seahorse?rev=2766&view=rev

Log:
Add object id to UID objects, which helps them
	to show up in libcryptui.

Modified:
   trunk/ChangeLog
   trunk/pgp/seahorse-gpgme-uid.c

Modified: trunk/pgp/seahorse-gpgme-uid.c
==============================================================================
--- trunk/pgp/seahorse-gpgme-uid.c	(original)
+++ trunk/pgp/seahorse-gpgme-uid.c	Thu Feb  5 04:06:39 2009
@@ -68,6 +68,23 @@
 }
 
 static void
+realize_id (SeahorseGpgmeUid *self)
+{
+	gchar *str = NULL;
+	GQuark id = 0;
+	
+	if (self->pv->gpgme_index >= 0 || self->pv->pubkey != NULL) {
+		/* Build up a new id for this UID */
+		g_return_if_fail (self->pv->pubkey->subkeys && self->pv->pubkey->subkeys->keyid);
+		str = seahorse_pgp_key_calc_id (self->pv->pubkey->subkeys->keyid, self->pv->gpgme_index + 1);
+		id = g_quark_from_string (str);
+		g_free (str);
+	}
+
+	g_object_set (self, "id", id, NULL);
+}
+
+static void
 realize_signatures (SeahorseGpgmeUid *self)
 {
 	gpgme_key_sig_t gsig;
@@ -331,6 +348,7 @@
 	seahorse_pgp_uid_set_comment (base, string);
 	g_free (string);
 	
+	realize_id (self);
 	realize_signatures (self);
 
 	seahorse_pgp_uid_set_validity (base, seahorse_gpgme_convert_validity (userid->validity));



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