diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-01-27 11:13:30 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-01-27 11:13:30 +0800 |
commit | 93c8da913ba3e095432d6e2c07c8fcd6f5c3bef7 (patch) | |
tree | 920393544e4f3214d92e98f3619831887b96b4ce /mail/subscribe-dialog.c | |
parent | 62ec012904d2004a0b486b10ddfdb05b98f05c3a (diff) | |
download | gsoc2013-evolution-93c8da913ba3e095432d6e2c07c8fcd6f5c3bef7.tar.gz gsoc2013-evolution-93c8da913ba3e095432d6e2c07c8fcd6f5c3bef7.tar.zst gsoc2013-evolution-93c8da913ba3e095432d6e2c07c8fcd6f5c3bef7.zip |
Check for a NULL service->url as we obviously can't subscribe to folders
2001-01-26 Jeffrey Stedfast <fejj@ximian.com>
* subscribe-dialog.c (populate_store_foreach): Check for a NULL
service->url as we obviously can't subscribe to folders on a
non-existant mail source :-)
(subscribe_do_get_store): Check for a NULL url here too, not that
we should need it anymore (due to the above fix) but it doesn't
hurt. Also, should we wait on the thread? Probably doesn't matter.
svn path=/trunk/; revision=7844
Diffstat (limited to 'mail/subscribe-dialog.c')
-rw-r--r-- | mail/subscribe-dialog.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/mail/subscribe-dialog.c b/mail/subscribe-dialog.c index 4026754a6e..5c8ee04180 100644 --- a/mail/subscribe-dialog.c +++ b/mail/subscribe-dialog.c @@ -224,7 +224,9 @@ static void subscribe_do_get_store (SubscribeDialog *sc, const char *url, SubscribeGetStoreCallback cb, gpointer cb_data) { get_store_input_t *input; - + + g_return_if_fail (url != NULL); + input = g_new (get_store_input_t, 1); input->sc = sc; input->url = g_strdup (url); @@ -232,6 +234,7 @@ subscribe_do_get_store (SubscribeDialog *sc, const char *url, SubscribeGetStoreC input->cb_data = cb_data; mail_operation_queue (&op_get_store, input, TRUE); + mail_operation_wait_for_finish (); } /* ** SUBSCRIBE FOLDER ******************************************************* */ @@ -870,8 +873,7 @@ store_cb (SubscribeDialog *sc, CamelStore *store, gpointer data) if (camel_store_supports_subscriptions (store)) { sc->store_list = g_list_prepend (sc->store_list, store); e_table_model_row_inserted (sc->store_model, 0); - } - else { + } else { camel_object_unref (CAMEL_OBJECT (store)); } } @@ -879,6 +881,8 @@ store_cb (SubscribeDialog *sc, CamelStore *store, gpointer data) static void populate_store_foreach (MailConfigService *service, SubscribeDialog *sc) { + g_return_if_fail (service->url != NULL); + subscribe_do_get_store (sc, service->url, store_cb, NULL); } @@ -894,7 +898,7 @@ populate_store_list (SubscribeDialog *sc) news = mail_config_get_news (); g_slist_foreach ((GSList *)news, (GFunc)populate_store_foreach, sc); - + e_table_model_changed (sc->store_model); } @@ -945,21 +949,20 @@ subscribe_dialog_gui_init (SubscribeDialog *sc) gtk_widget_show_all (folder_search_widget); search_control = bonobo_control_new (folder_search_widget); - bonobo_ui_component_object_set ( - component, "/Toolbar/FolderSearch", - bonobo_object_corba_objref (BONOBO_OBJECT (search_control)), NULL); + bonobo_ui_component_object_set (component, "/Toolbar/FolderSearch", + bonobo_object_corba_objref (BONOBO_OBJECT (search_control)), + NULL); /* set our our contents */ #if 0 sc->description = html_new (TRUE); put_html (GTK_HTML (sc->description), EXAMPLE_DESCR); - gtk_table_attach ( - GTK_TABLE (sc->table), sc->description->parent->parent, - 0, 1, 0, 1, - GTK_FILL | GTK_EXPAND, - 0, - 0, 0); + gtk_table_attach (GTK_TABLE (sc->table), sc->description->parent->parent, + 0, 1, 0, 1, + GTK_FILL | GTK_EXPAND, + 0, + 0, 0); #endif /* set up the store etable */ @@ -1055,9 +1058,8 @@ subscribe_dialog_gui_init (SubscribeDialog *sc) gtk_widget_show (sc->hpaned); /* FIXME: Session management and stuff? */ - gtk_window_set_default_size ( - GTK_WINDOW (sc->app), - DEFAULT_WIDTH, DEFAULT_HEIGHT); + gtk_window_set_default_size (GTK_WINDOW (sc->app), + DEFAULT_WIDTH, DEFAULT_HEIGHT); populate_store_list (sc); } |