aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/em-migrate.c41
-rw-r--r--mail/mail-account-gui.c18
3 files changed, 63 insertions, 9 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b5ca55109a..2e5984f39a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,18 @@
2004-01-26 Jeffrey Stedfast <fejj@ximian.com>
+ Fixes for bug #53251.
+
+ * mail-account-gui.c (mail_account_gui_new): Convert the account
+ drafts/sent folder uris to camel uris.
+ (mail_account_gui_save): Convert drafts/sent camel uris into
+ mailer uris when setting them on the account. Also, don't compare
+ against file: anymore since those uris don't exist anymore.
+
+ * em-migrate.c (em_upgrade_accounts_1_4): Update the drafts/sent
+ folder uris.
+
+2004-01-26 Jeffrey Stedfast <fejj@ximian.com>
+
* em-folder-tree.c (tree_drag_begin): Set priv->drag_row.
2004-01-26 Aaron Weber <aaron@ximian.com>
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 6ef3a3acf6..7e81d66047 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -54,7 +54,9 @@
#include <gal/util/e-xml-utils.h>
#include "e-util/e-bconf-map.h"
+#include "e-util/e-account-list.h"
+#include "mail-config.h"
#include "mail-component.h" /* for em_uri_from_camel() */
#include "em-migrate.h"
#include "mail-vfolder.h"
@@ -1750,6 +1752,42 @@ em_upgrade_xml_1_4 (xmlDocPtr doc)
}
static int
+em_upgrade_accounts_1_4 (void)
+{
+ EAccountList *accounts;
+ EIterator *iter;
+
+ if (!(accounts = mail_config_get_accounts ()))
+ return 0;
+
+ iter = e_list_get_iterator ((EList *) accounts);
+ while (e_iterator_is_valid (iter)) {
+ EAccount *account = (EAccount *) e_iterator_get (iter);
+ char *url;
+
+ if (account->drafts_folder_uri) {
+ url = upgrade_xml_uris_1_4 (account->drafts_folder_uri);
+ g_free (account->drafts_folder_uri);
+ account->drafts_folder_uri = url;
+ }
+
+ if (account->sent_folder_uri) {
+ url = upgrade_xml_uris_1_4 (account->sent_folder_uri);
+ g_free (account->sent_folder_uri);
+ account->sent_folder_uri = url;
+ }
+
+ e_iterator_next (iter);
+ }
+
+ g_object_unref (iter);
+
+ mail_config_save_accounts ();
+
+ return 0;
+}
+
+static int
em_migrate_pop_uid_caches_1_4 (const char *evolution_dir, CamelException *ex)
{
GString *oldpath, *newpath;
@@ -2124,6 +2162,9 @@ em_migrate_1_4 (const char *evolution_dir, xmlDocPtr filters, xmlDocPtr vfolders
camel_object_unref (session);
+ if (em_upgrade_accounts_1_4 () == -1)
+ return -1;
+
if (em_upgrade_xml_1_4 (filters) == -1)
return -1;
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index 40858ec792..b2c35b3bfb 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -1585,7 +1585,7 @@ mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog)
gui->drafts_folder_button = GTK_BUTTON (glade_xml_get_widget (gui->xml, "drafts_button"));
g_signal_connect (gui->drafts_folder_button, "selected", G_CALLBACK (folder_selected), &gui->drafts_folder_uri);
if (account->drafts_folder_uri)
- gui->drafts_folder_uri = g_strdup (account->drafts_folder_uri);
+ gui->drafts_folder_uri = em_uri_to_camel (account->drafts_folder_uri);
else
gui->drafts_folder_uri = g_strdup (default_drafts_folder_uri);
em_folder_selection_button_set_selection((EMFolderSelectionButton *)gui->drafts_folder_button, gui->drafts_folder_uri);
@@ -1594,7 +1594,7 @@ mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog)
gui->sent_folder_button = GTK_BUTTON (glade_xml_get_widget (gui->xml, "sent_button"));
g_signal_connect (gui->sent_folder_button, "selected", G_CALLBACK (folder_selected), &gui->sent_folder_uri);
if (account->sent_folder_uri)
- gui->sent_folder_uri = g_strdup (account->sent_folder_uri);
+ gui->sent_folder_uri = em_uri_to_camel (account->sent_folder_uri);
else
gui->sent_folder_uri = g_strdup (default_sent_folder_uri);
em_folder_selection_button_set_selection((EMFolderSelectionButton *)gui->sent_folder_button, gui->sent_folder_uri);
@@ -2006,20 +2006,20 @@ mail_account_gui_save (MailAccountGui *gui)
/* Check to make sure that the Drafts folder uri is "valid" before assigning it */
if (mail_config_get_account_by_source_url (gui->drafts_folder_uri) ||
- !strncmp (gui->drafts_folder_uri, "file:", 5)) {
- new->drafts_folder_uri = g_strdup (gui->drafts_folder_uri);
+ !strncmp (gui->drafts_folder_uri, "mbox:", 5)) {
+ new->drafts_folder_uri = em_uri_from_camel (gui->drafts_folder_uri);
} else {
/* assign defaults - the uri is unknown to us (probably pointed to an old source url) */
- new->drafts_folder_uri = g_strdup (default_drafts_folder_uri);
+ new->drafts_folder_uri = em_uri_from_camel (default_drafts_folder_uri);
}
/* Check to make sure that the Sent folder uri is "valid" before assigning it */
if (mail_config_get_account_by_source_url (gui->sent_folder_uri) ||
- !strncmp (gui->sent_folder_uri, "file:", 5)) {
- new->sent_folder_uri = g_strdup (gui->sent_folder_uri);
+ !strncmp (gui->sent_folder_uri, "mbox:", 5)) {
+ new->sent_folder_uri = em_uri_from_camel (gui->sent_folder_uri);
} else {
/* assign defaults - the uri is unknown to us (probably pointed to an old source url) */
- new->sent_folder_uri = g_strdup (default_sent_folder_uri);
+ new->sent_folder_uri = em_uri_from_camel (default_sent_folder_uri);
}
new->always_cc = gtk_toggle_button_get_active (gui->always_cc);
@@ -2036,7 +2036,7 @@ mail_account_gui_save (MailAccountGui *gui)
#if defined (HAVE_NSS)
new->smime_sign_default = gtk_toggle_button_get_active (gui->smime_sign_default);
new->smime_sign_key = g_strdup (gtk_entry_get_text (gui->smime_sign_key));
-
+
new->smime_encrypt_default = gtk_toggle_button_get_active (gui->smime_encrypt_default);
new->smime_encrypt_key = g_strdup (gtk_entry_get_text (gui->smime_encrypt_key));
new->smime_encrypt_to_self = gtk_toggle_button_get_active (gui->smime_encrypt_to_self);