aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-05-09 13:08:25 +0800
committerDan Winship <danw@src.gnome.org>2000-05-09 13:08:25 +0800
commitc6de9ace9fe9b4a438583ed143f9b3b99211091d (patch)
tree9e9eb677c5cc455fbf2530812ab730264d75d1c3 /mail/folder-browser.c
parentdebd40014f38065b6a72fbadefd60a0cadd2c89d (diff)
downloadgsoc2013-evolution-c6de9ace9fe9b4a438583ed143f9b3b99211091d.tar
gsoc2013-evolution-c6de9ace9fe9b4a438583ed143f9b3b99211091d.tar.gz
gsoc2013-evolution-c6de9ace9fe9b4a438583ed143f9b3b99211091d.tar.bz2
gsoc2013-evolution-c6de9ace9fe9b4a438583ed143f9b3b99211091d.tar.lz
gsoc2013-evolution-c6de9ace9fe9b4a438583ed143f9b3b99211091d.tar.xz
gsoc2013-evolution-c6de9ace9fe9b4a438583ed143f9b3b99211091d.tar.zst
gsoc2013-evolution-c6de9ace9fe9b4a438583ed143f9b3b99211091d.zip
make this a little less kludgy. Use gnome_error_dialog rather than printf
* folder-browser.c (folder_browser_load_folder): make this a little less kludgy. Use gnome_error_dialog rather than printf on errors. * mail-ops.c (fetch_mail): Fix to work with the new shell stuff... sorta. Will need more fixing later when the new shell framework is more done. * mail-config.c (finish): Call gnome_config_sync so the data actually gets written. svn path=/trunk/; revision=2931
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 424523e212..b7a3c9faa1 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -64,14 +64,23 @@ folder_browser_class_init (GtkObjectClass *object_class)
static gboolean
folder_browser_load_folder (FolderBrowser *fb, const char *name)
{
- char *store_name;
+ char *store_name, *msg;
CamelStore *store;
CamelFolder *new_folder;
CamelException *ex;
gboolean new_folder_exists = FALSE;
- /* Change "file:" to "mbox:". FIXME :) */
- store_name = g_strdup_printf ("mbox%s", strchr (name, ':'));
+ if (strncmp (name, "file:", 5) != 0) {
+ char *msg;
+
+ msg = g_strdup_printf ("Can't open URI %s", name);
+ gnome_error_dialog (msg);
+ g_free (msg);
+ return FALSE;
+ }
+
+ /* Change "file:" to "mbox:". */
+ store_name = g_strdup_printf ("mbox:%s", name + 5);
ex = camel_exception_new ();
store = camel_session_get_store (session, store_name, ex);
@@ -82,8 +91,9 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name)
}
if (camel_exception_get_id (ex)) {
- printf ("Unable to get folder %s: %s\n", name,
- camel_exception_get_description (ex));
+ msg = g_strdup_printf ("Unable to get folder %s: %s\n", name,
+ camel_exception_get_description (ex));
+ gnome_error_dialog (msg);
camel_exception_free (ex);
return FALSE;
}
@@ -91,8 +101,10 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name)
/* If the folder does not exist, we don't want to show it */
new_folder_exists = camel_folder_exists (new_folder, ex);
if (camel_exception_get_id (ex)) {
- printf ("Unable to test for folder existence: %s\n",
- camel_exception_get_description (ex));
+ msg = g_strdup_printf ("Unable to test if folder %s "
+ "exists: %s\n", name,
+ camel_exception_get_description (ex));
+ gnome_error_dialog (msg);
camel_exception_free (ex);
return FALSE;
}
@@ -102,7 +114,6 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name)
gtk_object_unref (GTK_OBJECT (new_folder));
return FALSE;
}
-
if (fb->folder)
gtk_object_unref (GTK_OBJECT (fb->folder));