diff options
author | Milan Crha <mcrha@redhat.com> | 2009-04-30 22:56:58 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-01 03:16:41 +0800 |
commit | 63889c5f1275fec81cb5ede6b09d1e058e31e7f2 (patch) | |
tree | fa3dd833456411913b3d542af79a2a39c27f196a /mail | |
parent | 92c5401b6cea503347540ed23c9650d382cbc4e4 (diff) | |
download | gsoc2013-evolution-63889c5f1275fec81cb5ede6b09d1e058e31e7f2.tar gsoc2013-evolution-63889c5f1275fec81cb5ede6b09d1e058e31e7f2.tar.gz gsoc2013-evolution-63889c5f1275fec81cb5ede6b09d1e058e31e7f2.tar.bz2 gsoc2013-evolution-63889c5f1275fec81cb5ede6b09d1e058e31e7f2.tar.lz gsoc2013-evolution-63889c5f1275fec81cb5ede6b09d1e058e31e7f2.tar.xz gsoc2013-evolution-63889c5f1275fec81cb5ede6b09d1e058e31e7f2.tar.zst gsoc2013-evolution-63889c5f1275fec81cb5ede6b09d1e058e31e7f2.zip |
Bug #570730 - Get rid of gnome-config in Evolution
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-shell-module-migrate.c | 101 | ||||
-rw-r--r-- | mail/mail-session.c | 1 |
2 files changed, 0 insertions, 102 deletions
diff --git a/mail/e-mail-shell-module-migrate.c b/mail/e-mail-shell-module-migrate.c index e318dee267..ac09eec42f 100644 --- a/mail/e-mail-shell-module-migrate.c +++ b/mail/e-mail-shell-module-migrate.c @@ -40,7 +40,6 @@ #include <gtk/gtk.h> #include <gconf/gconf-client.h> -#include <libgnome/gnome-config.h> #include <camel/camel.h> #include <camel/camel-store.h> @@ -728,105 +727,6 @@ em_upgrade_xml_1_2 (xmlDocPtr doc) return upgrade_xml_1_2_rec (root); } -/* converts passwords from ~/evolution/private/config.xmldb to gnome_private() */ -static gboolean -upgrade_passwords_1_2(void) -{ - xmlNodePtr root, entry; - char *filename; - xmlDocPtr priv_doc = NULL; - struct stat st; - int work = 0; - gboolean success = FALSE; - - filename = g_build_filename(g_get_home_dir(), "evolution/private/config.xmldb", NULL); - if (lstat(filename, &st) == 0 && S_ISREG(st.st_mode)) - priv_doc = xmlParseFile(filename); - g_free(filename); - - if (priv_doc == NULL) - return TRUE; - - root = priv_doc->children; - if (strcmp((char *)root->name, "bonobo-config") != 0) { - xmlFreeDoc(priv_doc); - return TRUE; - } - - root = root->children; - while (root) { - if (!strcmp((char *)root->name, "section")) { - char *path = (char *)xmlGetProp(root, (const unsigned char *)"path"); - - /* All sections of form - <section path="/Passwords/COMPONENT"> - <entry name="base64name" value="hexvalue"> - Are converted to: - /Evolution/Passwords-COMPONENT/name = value - */ - - if (path && !strncmp(path, "/Passwords/", 11)) { - entry = root->children; - while (entry) { - if (!strcmp((char *)entry->name, "entry")) { - char *namep = (char *)xmlGetProp(entry, (const unsigned char *)"name"), - *valuep = (char *)xmlGetProp(entry, (const unsigned char *)"value"); - - if (namep && valuep) { - char *value = e_bconf_hex_decode(valuep); - guchar *decoded; - char *p, *new; - gsize len; - - decoded = g_base64_decode (namep, &len); - memcpy (namep, decoded, len); - g_free (decoded); - namep[len] = 0; - p = namep; - - d(printf("Found password entry '%s' = '%s'\n", namep, value)); - - while (*p) { - if (*p == '/' || *p == '=') - *p = '_'; - p++; - } - - p = g_strdup_printf("/Evolution/Passwords-%s/%s", path+11, namep); - new = gnome_config_private_get_string_with_default(p, NULL); - if (new == NULL) { - d(printf("password not there, setting '%s' = '%s'\n", p, value)); - gnome_config_private_set_string(p, value); - work = TRUE; - } else { - d(printf("password already there, leaving\n")); - } - g_free(p); - g_free(value); - } - xmlFree(namep); - xmlFree(valuep); - } - entry = entry->next; - } - } - xmlFree(path); - } - root = root->next; - } - - xmlFreeDoc(priv_doc); - - if (work) { - if (gnome_config_private_sync_file("/Evolution")) - success = TRUE; - } else { - success = TRUE; - } - - return success; -} - /* ********************************************************************** */ /* Tables for converting flat bonobo conf -> gconf xml blob */ /* ********************************************************************** */ @@ -1123,7 +1023,6 @@ em_migrate_1_2(const char *data_dir, xmlDocPtr config_xmldb, xmlDocPtr filters, em_upgrade_xml_1_2(filters); em_upgrade_xml_1_2(vfolders); - upgrade_passwords_1_2(); return TRUE; } diff --git a/mail/mail-session.c b/mail/mail-session.c index 8e7b2177c5..df5d35c179 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -33,7 +33,6 @@ #include <gconf/gconf-client.h> -#include <libgnome/gnome-config.h> #include <libgnome/gnome-sound.h> #include <libedataserverui/e-passwords.h> |