aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-02-13 08:03:34 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-02-13 08:03:34 +0800
commit76bfed61ee6c9bd8bc468d269e724461b2aecc95 (patch)
tree0e328d500f8bc24d21aba0d370e63b8470653bb3 /mail
parent34f5839fa9c3f13ac15491d4881ae937bba9f894 (diff)
downloadgsoc2013-evolution-76bfed61ee6c9bd8bc468d269e724461b2aecc95.tar
gsoc2013-evolution-76bfed61ee6c9bd8bc468d269e724461b2aecc95.tar.gz
gsoc2013-evolution-76bfed61ee6c9bd8bc468d269e724461b2aecc95.tar.bz2
gsoc2013-evolution-76bfed61ee6c9bd8bc468d269e724461b2aecc95.tar.lz
gsoc2013-evolution-76bfed61ee6c9bd8bc468d269e724461b2aecc95.tar.xz
gsoc2013-evolution-76bfed61ee6c9bd8bc468d269e724461b2aecc95.tar.zst
gsoc2013-evolution-76bfed61ee6c9bd8bc468d269e724461b2aecc95.zip
Strip the leading "/" from the Namespace/Path entry if the provider
2001-02-12 Jeffrey Stedfast <fejj@ximian.com> * mail-account-editor.c (construct): Strip the leading "/" from the Namespace/Path entry if the provider doesn't require absolute pathnames. svn path=/trunk/; revision=8194
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-account-editor.c33
2 files changed, 38 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index db02cf0c80..07bfc4b533 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2001-02-12 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-account-editor.c (construct): Strip the leading "/" from
+ the Namespace/Path entry if the provider doesn't require absolute
+ pathnames.
+
2001-02-12 Kjartan Maraas <kmaraas@gnome.org>
* Makefile.am: xml-i18n-tools setup.
diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c
index 886b696218..5ce5db255b 100644
--- a/mail/mail-account-editor.c
+++ b/mail/mail-account-editor.c
@@ -708,7 +708,38 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account)
editor->source_passwd = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourcePasswd"));
gtk_entry_set_text (editor->source_passwd, url && url->passwd ? url->passwd : "");
editor->source_path = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourcePath"));
- gtk_entry_set_text (editor->source_path, url && url->path ? url->path : "");
+ if (url && url->path && *(url->path)) {
+ GList *providers;
+ CamelProvider *provider = NULL;
+
+ providers = camel_session_list_providers (session, TRUE);
+ while (providers) {
+ provider = providers->data;
+
+ if (strcmp (provider->domain, "mail")) {
+ provider = NULL;
+ providers = providers->next;
+ continue;
+ }
+
+ if (provider->object_types[CAMEL_PROVIDER_STORE] && provider->flags & CAMEL_PROVIDER_IS_SOURCE)
+ if (!url || !g_strcasecmp (provider->protocol, url->protocol))
+ break;
+
+ provider = NULL;
+ providers = providers->next;
+ }
+
+ if (provider) {
+ if (provider->url_flags & CAMEL_URL_PATH_IS_ABSOLUTE)
+ gtk_entry_set_text (editor->source_path, url->path);
+ else
+ gtk_entry_set_text (editor->source_path, url->path + 1);
+ } else {
+ /* we've got a serious problem if we ever get to here */
+ g_assert_not_reached ();
+ }
+ }
editor->save_passwd = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkSavePasswd"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->save_passwd), account->source->save_passwd);
editor->source_auth = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuSourceAuth"));