seahorse r2859 - in trunk: . pgp



Author: nnielsen
Date: Sat Feb 28 06:22:58 2009
New Revision: 2859
URL: http://svn.gnome.org/viewvc/seahorse?rev=2859&view=rev

Log:
Workaround for strange ownership behavior, we only add GPGME keys to the context, rather than all PGP keys.

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

Modified: trunk/pgp/seahorse-gpgme-key.c
==============================================================================
--- trunk/pgp/seahorse-gpgme-key.c	(original)
+++ trunk/pgp/seahorse-gpgme-key.c	Sat Feb 28 06:22:58 2009
@@ -410,12 +410,22 @@
 seahorse_gpgme_key_set_uids (SeahorsePgpKey *base, GList *uids)
 {
 	SeahorseGpgmeKey *self = SEAHORSE_GPGME_KEY (base);
+	GList *l;
+	
 	SEAHORSE_PGP_KEY_CLASS (seahorse_gpgme_key_parent_class)->set_uids (base, uids);
 	
+	/* Remove the parent on each old one */
+	for (l = self->pv->uids; l; l = g_list_next (l))
+		seahorse_context_remove_object (seahorse_context_for_app (), l->data);
+
 	/* Keep our own copy of the UID list */
 	seahorse_object_list_free (self->pv->uids);
 	self->pv->uids = seahorse_object_list_copy (uids);
 	
+	/* Add UIDS to context so that they show up in libcryptui */
+	for (l = self->pv->uids; l; l = g_list_next (l))
+		seahorse_context_add_object (seahorse_context_for_app (), l->data);
+
 	renumber_actual_uids (self);
 }
 
@@ -493,6 +503,11 @@
 seahorse_gpgme_key_object_dispose (GObject *obj)
 {
 	SeahorseGpgmeKey *self = SEAHORSE_GPGME_KEY (obj);
+	GList *l;
+	
+	/* Remove the attached UIDs */
+	for (l = self->pv->uids; l; l = g_list_next (l))
+		seahorse_context_remove_object (seahorse_context_for_app (), l->data);
 
 	if (self->pv->pubkey)
 		gpgme_key_unref (self->pv->pubkey);

Modified: trunk/pgp/seahorse-pgp-key.c
==============================================================================
--- trunk/pgp/seahorse-pgp-key.c	(original)
+++ trunk/pgp/seahorse-pgp-key.c	Sat Feb 28 06:22:58 2009
@@ -24,7 +24,6 @@
 
 #include <glib/gi18n.h>
 
-#include "seahorse-context.h"
 #include "seahorse-source.h"
 #include "seahorse-gtkstock.h"
 #include "seahorse-util.h"
@@ -112,10 +111,8 @@
 	id = seahorse_object_get_id (SEAHORSE_OBJECT (self));
 	
 	/* Remove the parent on each old one */
-	for (l = self->pv->uids; l; l = g_list_next (l)) {
-		seahorse_context_remove_object (seahorse_context_for_app (), l->data);
+	for (l = self->pv->uids; l; l = g_list_next (l))
 		seahorse_object_set_parent (l->data, NULL);
-	}
 
 	seahorse_object_list_free (self->pv->uids);
 	self->pv->uids = seahorse_object_list_copy (uids);
@@ -125,7 +122,6 @@
 		g_object_set (l->data, "id", seahorse_pgp_uid_calc_id (id, index), NULL);
 		if (l != self->pv->uids)
 			seahorse_object_set_parent (l->data, SEAHORSE_OBJECT (self));
-		seahorse_context_add_object (seahorse_context_for_app (), l->data);
 	}
 	
 	g_object_notify (G_OBJECT (self), "uids");
@@ -304,10 +300,9 @@
 	GList *l;
 	
 	/* Free all the attached UIDs */
-	for (l = self->pv->uids; l; l = g_list_next (l)) {
-		seahorse_context_remove_object (seahorse_context_for_app (), l->data);
+	for (l = self->pv->uids; l; l = g_list_next (l))
 		seahorse_object_set_parent (l->data, NULL);
-	}
+
 	seahorse_object_list_free (self->pv->uids);
 	self->pv->uids = NULL;
 



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