aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog7
-rw-r--r--e-util/e-config-listener.c25
-rw-r--r--e-util/e-config-listener.h5
-rw-r--r--e-util/e-passwords.c3
4 files changed, 37 insertions, 3 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 2087a74f19..19bce6bd1f 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,10 @@
+2003-01-07 Dan Winship <danw@ximian.com>
+
+ * e-config-listener.c (e_config_listener_remove_value): New.
+
+ * e-passwords.c (e_passwords_get_password): Don't look at the
+ passwords hash until calling e_passwords_init().
+
2003-01-06 Dan Winship <danw@ximian.com>
* e-html-utils.c: Add this back: Connector needs it, and there's
diff --git a/e-util/e-config-listener.c b/e-util/e-config-listener.c
index 5d676985ad..8db46d049d 100644
--- a/e-util/e-config-listener.c
+++ b/e-util/e-config-listener.c
@@ -562,10 +562,33 @@ e_config_listener_set_string (EConfigListener *cl, const char *key, const char *
}
void
+e_config_listener_remove_value (EConfigListener *cl, const char *key)
+{
+ gpointer orig_key, orig_value;
+
+ g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
+ g_return_if_fail (key != NULL);
+
+ if (g_hash_table_lookup_extended (cl->priv->keys, key, &orig_key, &orig_value)) {
+ KeyData *kd = orig_value;
+
+ g_hash_table_remove (cl->priv->keys, key);
+ g_free (kd->key);
+ if (kd->type == GCONF_VALUE_STRING)
+ g_free (kd->value.v_str);
+ gconf_client_notify_remove (cl->priv->db, kd->lid);
+
+ g_free (kd);
+ }
+
+ gconf_client_unset (cl->priv->db, key, NULL);
+}
+
+void
e_config_listener_remove_dir (EConfigListener *cl, const char *dir)
{
GSList *slist, *iter;
- gchar *key;
+ const gchar *key;
g_return_if_fail (E_IS_CONFIG_LISTENER (cl));
g_return_if_fail (dir != NULL);
diff --git a/e-util/e-config-listener.h b/e-util/e-config-listener.h
index d9829a7d27..9b331a7c8a 100644
--- a/e-util/e-config-listener.h
+++ b/e-util/e-config-listener.h
@@ -70,7 +70,10 @@ void e_config_listener_set_string (EConfigListener *cl,
const char *key,
const char *value);
-void e_config_listener_remove_dir (EConfigListener *cl, const char *dir);
+void e_config_listener_remove_value (EConfigListener *cl,
+ const char *key);
+void e_config_listener_remove_dir (EConfigListener *cl,
+ const char *dir);
G_END_DECLS
diff --git a/e-util/e-passwords.c b/e-util/e-passwords.c
index 9dae5db6f3..f44e785f6f 100644
--- a/e-util/e-passwords.c
+++ b/e-util/e-passwords.c
@@ -219,11 +219,12 @@ e_passwords_forget_password (const char *component_name, const char *key)
char *
e_passwords_get_password (const char *component_name, const char *key)
{
- char *path, *passwd = g_hash_table_lookup (passwords, key);
+ char *path, *passwd;
char *encoded = NULL;
e_passwords_init ();
+ passwd = g_hash_table_lookup (passwords, key);
if (passwd)
return g_strdup (passwd);