From 5db8b60d2c9900fa417822e881be8c7abaccb289 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 17 Nov 2003 05:45:05 +0000 Subject: handle an unparsable url without crashing. 2003-11-17 Not Zed * em-folder-selection-button.c (set_contents): handle an unparsable url without crashing. svn path=/trunk/; revision=23381 --- mail/ChangeLog | 3 +++ mail/em-folder-selection-button.c | 11 ++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 119b4f015a..89203af080 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,8 @@ 2003-11-17 Not Zed + * em-folder-selection-button.c (set_contents): handle an + unparsable url without crashing. + * mail-tools.c (mail_tool_get_local_inbox): thin wrapper on mail_component_get_local_inbox. diff --git a/mail/em-folder-selection-button.c b/mail/em-folder-selection-button.c index a903514452..a31569fd33 100644 --- a/mail/em-folder-selection-button.c +++ b/mail/em-folder-selection-button.c @@ -20,7 +20,6 @@ * */ - #ifdef HAVE_CONFIG_H #include #endif @@ -39,7 +38,6 @@ #include "em-folder-selection-button.h" - static void em_folder_selection_button_class_init (EMFolderSelectionButtonClass *klass); static void em_folder_selection_button_init (EMFolderSelectionButton *emfsb); static void em_folder_selection_button_destroy (GtkObject *obj); @@ -48,7 +46,6 @@ static void em_folder_selection_button_clicked (GtkButton *button); static GtkButtonClass *parent_class = NULL; - struct _EMFolderSelectionButtonPrivate { GtkWidget *icon; GtkWidget *label; @@ -66,7 +63,6 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; - GType em_folder_selection_button_get_type (void) { @@ -127,12 +123,12 @@ set_contents (EMFolderSelectionButton *button) const char *path; CamelURL *url; - if (priv->uri == NULL) { + if (priv->uri == NULL + || (url = camel_url_new (priv->uri, NULL)) == NULL) { set_contents_unselected (button); return; } - url = camel_url_new (priv->uri, NULL); path = url->fragment ? url->fragment : url->path; if (path == NULL) { @@ -224,7 +220,6 @@ em_folder_selection_button_clicked (GtkButton *button) gtk_widget_show (dialog); } - GtkWidget * em_folder_selection_button_new (const char *title, const char *caption) { @@ -236,7 +231,6 @@ em_folder_selection_button_new (const char *title, const char *caption) return GTK_WIDGET (button); } - void em_folder_selection_button_set_selection (EMFolderSelectionButton *button, const char *uri) { @@ -252,7 +246,6 @@ em_folder_selection_button_set_selection (EMFolderSelectionButton *button, const set_contents (button); } - const char * em_folder_selection_button_get_selection (EMFolderSelectionButton *button) { -- cgit