aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog21
-rw-r--r--mail/evolution-mail.schemas26
-rw-r--r--mail/folder-browser-ui.c7
-rw-r--r--mail/mail-config.c144
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 <fejj@ximian.com>
+
+ * 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 <fejj@ximian.com>
* 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 @@
-<evolutionmailschemafile>
+<gconfschemafile>
<schemalist>
<!-- Composer settings -->
@@ -135,7 +135,7 @@
<key>/schemas/apps/evolution/mail/display/load_http_images</key>
<applyto>/apps/evolution/mail/display/load_http_images</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>int</type>
<default>0</default>
<locale name="C">
<short>Load images for HTML messages over http</short>
@@ -152,7 +152,7 @@
<key>/schemas/apps/evolution/mail/display/xmailer_mask</key>
<applyto>/apps/evolution/mail/display/xmailer_mask</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>int</type>
<default>0</default>
<locale name="C">
<short>S3kr3t 0pt10n</short>
@@ -180,7 +180,7 @@
<key>/schemas/apps/evolution/mail/display/mark_seen_timeout</key>
<applyto>/apps/evolution/mail/display/mark_seen_timeout</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>int</type>
<default>1500</default>
<locale name="C">
<short>Timeout for marking message as Seen</short>
@@ -222,7 +222,7 @@
<key>/schemas/apps/evolution/mail/display/paned_size</key>
<applyto>/apps/evolution/mail/display/paned_size</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>int</type>
<default>144</default>
<locale name="C">
<short>Height of the message-list pane</short>
@@ -311,7 +311,7 @@
<key>/schemas/apps/evolution/mail/format/forward_style</key>
<applyto>/apps/evolution/mail/format/forward_style</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>int</type>
<default>0</default>
<locale name="C">
<short>Default forward style</short>
@@ -325,7 +325,7 @@
<key>/schemas/apps/evolution/mail/format/reply_style</key>
<applyto>/apps/evolution/mail/format/reply_style</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>int</type>
<default>0</default>
<locale name="C">
<short>Default reply style</short>
@@ -339,7 +339,7 @@
<key>/schemas/apps/evolution/mail/format/message_display_style</key>
<applyto>/apps/evolution/mail/format/message_display_style</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>int</type>
<default>0</default>
<locale name="C">
<short>Message-display style (normal, full headers, source)</short>
@@ -355,7 +355,7 @@
<key>/schemas/apps/evolution/mail/notify/type</key>
<applyto>/apps/evolution/mail/notify/type</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>int</type>
<default>0</default>
<locale name="C">
<short>New Mail Notify type</short>
@@ -480,11 +480,11 @@
<key>/schemas/apps/evolution/mail/default_account</key>
<applyto>/apps/evolution/mail/default_account</applyto>
<owner>evolution-mail</owner>
- <type>long</type>
+ <type>string</type>
<locale name="C">
- <short>Index of the default account</short>
+ <short>UID string of the default account.</short>
<long>
- Index of the default account.
+ UID string of the default account.
</long>
</locale>
</schema>
@@ -506,4 +506,4 @@
</schema>
</schemalist>
-</evolutionmailschemafile>
+</gconfschemafile>
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;
-}
-