[gnome-keyring] [dbus] Refresh and store the default keyring correctly.



commit 4d22df25dac5c051c04f8d957169ff5ba45b5020
Author: Stef Walter <stef memberwebs com>
Date:   Sat Feb 6 15:06:16 2010 +0000

    [dbus] Refresh and store the default keyring correctly.
    
    Although the default keyring was being loaded, it was not being
    used correctly by the path resolution code.

 daemon/dbus/gkd-secret-service.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/daemon/dbus/gkd-secret-service.c b/daemon/dbus/gkd-secret-service.c
index 4e2b01c..3d5bd19 100644
--- a/daemon/dbus/gkd-secret-service.c
+++ b/daemon/dbus/gkd-secret-service.c
@@ -56,7 +56,6 @@ struct _GkdSecretService {
 	GHashTable *clients;
 	gchar *match_rule;
 	GkdSecretObjects *objects;
-	gchar *default_collection;
 };
 
 typedef struct _ServiceClient {
@@ -88,9 +87,11 @@ static void
 update_default (GkdSecretService *self, gboolean force)
 {
 	gchar *contents = NULL;
+	const gchar *identifier;
 	gchar *path;
 
-	if (!force && self->default_collection)
+	identifier = gkd_secret_objects_get_alias (self->objects, "default");
+	if (!force && identifier)
 		return;
 
 	path = default_path ();
@@ -103,21 +104,23 @@ update_default (GkdSecretService *self, gboolean force)
 	}
 	g_free (path);
 
-	g_free (self->default_collection);
-	self->default_collection = contents;
+	gkd_secret_objects_set_alias (self->objects, "default", contents);
+	g_free (contents);
 }
 
 static void
 store_default (GkdSecretService *self)
 {
 	GError *error = NULL;
+	const gchar *identifier;
 	gchar *path;
 
-	if (!self->default_collection)
+	identifier = gkd_secret_objects_get_alias (self->objects, "default");
+	if (!identifier)
 		return;
 
 	path = default_path ();
-	if (!g_file_set_contents (path, self->default_collection, -1, &error)) {
+	if (!g_file_set_contents (path, identifier, -1, &error)) {
 		g_message ("couldn't store default keyring: %s",
 		           error->message ? error->message : "");
 	}



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