From 2f46886814d35618ad234e474a00a6ca977a13c3 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 18 Feb 2003 20:11:01 +0000 Subject: Removed. (lookup_signature): Removed. (xml_get_int): Removed. 2003-02-18 Jeffrey Stedfast * mail-config.c (uri_to_key): Removed. (lookup_signature): Removed. (xml_get_int): Removed. (xml_get_bool): Removed. (mail_config_get_time_24hour): Removed. * evolution-mail.schemas: s/long/int/g and change default_account to be a string instead of an int. * mail-config.c (mail_config_get_default_account): default_account now uses the account uid, so change the code a bit to match uid strings rather than use an index. (mail_config_remove_account): Same here. simplifies the code a bunch. (mail_config_set_default_account): Here too. * folder-browser-ui.c (folder_browser_ui_setup_view_menus): Update the GalView path. svn path=/trunk/; revision=19932 --- mail/ChangeLog | 21 +++++++ mail/evolution-mail.schemas | 26 ++++---- mail/folder-browser-ui.c | 7 +-- mail/mail-config.c | 144 +++++--------------------------------------- 4 files changed, 52 insertions(+), 146 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index d6e10d9062..cf0b510007 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,24 @@ +2003-02-18 Jeffrey Stedfast + + * mail-config.c (uri_to_key): Removed. + (lookup_signature): Removed. + (xml_get_int): Removed. + (xml_get_bool): Removed. + (mail_config_get_time_24hour): Removed. + + * evolution-mail.schemas: s/long/int/g and change default_account + to be a string instead of an int. + + * mail-config.c (mail_config_get_default_account): default_account + now uses the account uid, so change the code a bit to match uid + strings rather than use an index. + (mail_config_remove_account): Same here. simplifies the code a + bunch. + (mail_config_set_default_account): Here too. + + * folder-browser-ui.c (folder_browser_ui_setup_view_menus): Update + the GalView path. + 2003-02-14 Jeffrey Stedfast * mail-session.c (do_get_pass): Change the logic here diff --git a/mail/evolution-mail.schemas b/mail/evolution-mail.schemas index 0f1a6ec232..2bc9aeda19 100644 --- a/mail/evolution-mail.schemas +++ b/mail/evolution-mail.schemas @@ -1,4 +1,4 @@ - + @@ -135,7 +135,7 @@ /schemas/apps/evolution/mail/display/load_http_images /apps/evolution/mail/display/load_http_images evolution-mail - long + int 0 Load images for HTML messages over http @@ -152,7 +152,7 @@ /schemas/apps/evolution/mail/display/xmailer_mask /apps/evolution/mail/display/xmailer_mask evolution-mail - long + int 0 S3kr3t 0pt10n @@ -180,7 +180,7 @@ /schemas/apps/evolution/mail/display/mark_seen_timeout /apps/evolution/mail/display/mark_seen_timeout evolution-mail - long + int 1500 Timeout for marking message as Seen @@ -222,7 +222,7 @@ /schemas/apps/evolution/mail/display/paned_size /apps/evolution/mail/display/paned_size evolution-mail - long + int 144 Height of the message-list pane @@ -311,7 +311,7 @@ /schemas/apps/evolution/mail/format/forward_style /apps/evolution/mail/format/forward_style evolution-mail - long + int 0 Default forward style @@ -325,7 +325,7 @@ /schemas/apps/evolution/mail/format/reply_style /apps/evolution/mail/format/reply_style evolution-mail - long + int 0 Default reply style @@ -339,7 +339,7 @@ /schemas/apps/evolution/mail/format/message_display_style /apps/evolution/mail/format/message_display_style evolution-mail - long + int 0 Message-display style (normal, full headers, source) @@ -355,7 +355,7 @@ /schemas/apps/evolution/mail/notify/type /apps/evolution/mail/notify/type evolution-mail - long + int 0 New Mail Notify type @@ -480,11 +480,11 @@ /schemas/apps/evolution/mail/default_account /apps/evolution/mail/default_account evolution-mail - long + string - Index of the default account + UID string of the default account. - Index of the default account. + UID string of the default account. @@ -506,4 +506,4 @@ - + diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c index 6680d8dd2a..c265ad62c3 100644 --- a/mail/folder-browser-ui.c +++ b/mail/folder-browser-ui.c @@ -357,10 +357,9 @@ folder_browser_ui_setup_view_menus (FolderBrowser *fb) gal_view_collection_set_title (collection, _("Mail")); local_dir = gnome_util_prepend_user_home ("/evolution/views/mail/"); - gal_view_collection_set_storage_directories - (collection, - EVOLUTION_GALVIEWSDIR "/evolution/views/mail/", - local_dir); + gal_view_collection_set_storage_directories (collection, + EVOLUTION_GALVIEWSDIR "/mail/", + local_dir); g_free (local_dir); spec = e_table_specification_new (); diff --git a/mail/mail-config.c b/mail/mail-config.c index 86bfa2b175..418959f2df 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -85,9 +85,6 @@ typedef struct { GSList *labels; guint label_notify_id; - - /* readonly fields from calendar */ - int time_24hour; } MailConfig; static MailConfig *config = NULL; @@ -123,34 +120,6 @@ signature_destroy (MailConfigSignature *sig) g_free (sig); } -static gboolean -xml_get_bool (xmlNodePtr node, const char *name) -{ - gboolean bool = FALSE; - char *buf; - - if ((buf = xmlGetProp (node, name))) { - bool = (!strcmp (buf, "true") || !strcmp (buf, "yes")); - xmlFree (buf); - } - - return bool; -} - -static int -xml_get_int (xmlNodePtr node, const char *name) -{ - int number = 0; - char *buf; - - if ((buf = xmlGetProp (node, name))) { - number = strtol (buf, NULL, 10); - xmlFree (buf); - } - - return number; -} - static char * xml_get_prop (xmlNodePtr node, const char *name) { @@ -175,27 +144,6 @@ xml_get_content (xmlNodePtr node) return val; } -static MailConfigSignature * -lookup_signature (int id) -{ - MailConfigSignature *sig; - GSList *l; - - if (id == -1) - return NULL; - - l = config->signatures; - while (l != NULL) { - sig = (MailConfigSignature *) l->data; - if (sig->id == id) - return sig; - - l = l->next; - } - - return NULL; -} - void mail_config_save_accounts (void) { @@ -584,23 +532,6 @@ mail_config_is_corrupt (void) return config->corrupt; } -static char * -uri_to_key (const char *uri) -{ - char *rval, *ptr; - - if (!uri) - return NULL; - - rval = g_strdup (uri); - - for (ptr = rval; *ptr; ptr++) - if (*ptr == '/' || *ptr == ':') - *ptr = '_'; - - return rval; -} - GSList * mail_config_get_labels (void) { @@ -664,7 +595,7 @@ mail_config_get_default_account (void) { EAccount *account = NULL; EIterator *iter; - int index, n; + char *uid; if (config == NULL) mail_config_init (); @@ -672,18 +603,20 @@ mail_config_get_default_account (void) if (!config->accounts) return NULL; - index = gconf_client_get_int (config->gconf, "/apps/evolution/mail/default_account", NULL); + uid = gconf_client_get_string (config->gconf, "/apps/evolution/mail/default_account", NULL); iter = e_list_get_iterator ((EList *) config->accounts); - n = 0; while (e_iterator_is_valid (iter)) { - if (n == index) { - account = (EAccount *) e_iterator_get (iter); - break; + account = (EAccount *) e_iterator_get (iter); + + if (!strcmp (account->uid, uid)) { + g_object_unref (iter); + g_free (uid); + + return account; } - n++; e_iterator_next (iter); } @@ -693,7 +626,7 @@ mail_config_get_default_account (void) e_iterator_reset (iter); account = (EAccount *) e_iterator_get (iter); - gconf_client_set_int (config->gconf, "/apps/evolution/mail/default_account", 0, NULL); + gconf_client_set_string (config->gconf, "/apps/evolution/mail/default_account", account->uid, NULL); } g_object_unref (iter); @@ -839,35 +772,17 @@ mail_config_add_account (EAccount *account) void mail_config_remove_account (EAccount *account) { - EAccount *acnt = NULL; - EIterator *iter; - int index, cur; + char *uid; - cur = gconf_client_get_int (config->gconf, "/apps/evolution/mail/default_account", NULL); + uid = gconf_client_get_string (config->gconf, "/apps/evolution/mail/default_account", NULL); if (account == mail_config_get_default_account ()) { /* the default account has been deleted, the new default becomes the first account in the list */ - gconf_client_set_int (config->gconf, "/apps/evolution/mail/default_account", 0, NULL); - } else { - /* adjust the default to make sure it points to the same one */ - index = 0; - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - acnt = (EAccount *) e_iterator_get (iter); - if (acnt == account) - break; - - index++; - e_iterator_next (iter); - } - - g_object_unref (iter); - - if (cur > index) - gconf_client_set_int (config->gconf, "/apps/evolution/mail/default_account", cur - 1, NULL); + gconf_client_set_string (config->gconf, "/apps/evolution/mail/default_account", account->uid, NULL); } + g_free (uid); g_object_ref (account); e_list_remove ((EList *) config->accounts, account); g_signal_emit_by_name (config->accounts, "account-removed", account); @@ -879,29 +794,7 @@ mail_config_remove_account (EAccount *account) void mail_config_set_default_account (EAccount *account) { - EIterator *iter; - EAccount *acnt; - int index = -1; - int i = 0; - - iter = e_list_get_iterator ((EList *) config->accounts); - while (e_iterator_is_valid (iter)) { - acnt = (EAccount *) e_iterator_get (iter); - if (acnt == account) { - index = i; - break; - } - - i++; - e_iterator_next (iter); - } - - g_object_unref (iter); - - if (index == -1) - return; - - gconf_client_set_int (config->gconf, "/apps/evolution/mail/default_account", index, NULL); + gconf_client_set_string (config->gconf, "/apps/evolution/mail/default_account", account->uid, NULL); } EAccountIdentity * @@ -1659,10 +1552,3 @@ mail_config_signature_set_html (MailConfigSignature *sig, gboolean html) mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_HTML_CHANGED, sig); } } - -int -mail_config_get_time_24hour(void) -{ - return config->time_24hour; -} - -- cgit v1.2.3