aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-09-29 06:38:53 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-09-29 06:38:53 +0800
commitdf8634ddc8aedeeb471e1e1a6171a8ea102db61d (patch)
tree65b1422d037c7367864ab25a3ccf281b93156e40 /mail/mail-config.c
parent61e47e195ea3084227b2a986e055bfdb7e18444b (diff)
downloadgsoc2013-evolution-df8634ddc8aedeeb471e1e1a6171a8ea102db61d.tar.gz
gsoc2013-evolution-df8634ddc8aedeeb471e1e1a6171a8ea102db61d.tar.zst
gsoc2013-evolution-df8634ddc8aedeeb471e1e1a6171a8ea102db61d.zip
Setup the url_hash and url_equal functions for the local provider.
2001-09-28 Jeffrey Stedfast <fejj@ximian.com> * mail-local.c (mail_local_provider_init): Setup the url_hash and url_equal functions for the local provider. * mail-account-gui.c (mail_account_gui_save): Add code here to check to make sure that the Drafts and Sent folders are pointing to valid urls. This is kinda nasty and only really solves the case where the user changes, say, his imap server or something. Unfortunately we still have the problem where if account A's sent/drafts folders point to account B's store and the user changes the url for account B. * mail-config.c (mail_config_get_account_by_source_url): Use Camel to compare the urls rather than using e_url_equal which does all sorts of funky shit that may not work in every case. svn path=/trunk/; revision=13238
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index fbdded27c6..512a760034 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -1422,22 +1422,43 @@ const MailConfigAccount *
mail_config_get_account_by_source_url (const char *source_url)
{
const MailConfigAccount *account;
+ CamelProvider *provider;
+ CamelURL *source;
GSList *l;
-
+
g_return_val_if_fail (source_url != NULL, NULL);
-
+
+ provider = camel_session_get_provider (session, source_url, NULL);
+ if (!provider)
+ return NULL;
+
+ source = camel_url_new (source_url, NULL);
+ if (!source)
+ return NULL;
+
l = config->accounts;
while (l) {
account = l->data;
- if (account
- && account->source
- && account->source->url
- && e_url_equal (account->source->url, source_url))
- return account;
+
+ if (account && account->source && account->source->url) {
+ CamelURL *url;
+
+ url = camel_url_new (account->source->url, NULL);
+ if (url && provider->url_equal (url, source)) {
+ camel_url_free (url);
+ camel_url_free (source);
+ return account;
+ }
+
+ if (url)
+ camel_url_free (url);
+ }
l = l->next;
}
+ camel_url_free (source);
+
return NULL;
}