aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-01-27 11:13:30 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-27 11:13:30 +0800
commit93c8da913ba3e095432d6e2c07c8fcd6f5c3bef7 (patch)
tree920393544e4f3214d92e98f3619831887b96b4ce
parent62ec012904d2004a0b486b10ddfdb05b98f05c3a (diff)
downloadgsoc2013-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
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/session.c24
-rw-r--r--mail/subscribe-dialog.c34
3 files changed, 46 insertions, 21 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index e84f8975d2..ff11955455 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+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.
+
2001-01-26 Iain Holmes <iain@ximian.com>
* evolution-outlook-importer.c (load_file_fn): Replace fsetpos with
diff --git a/mail/session.c b/mail/session.c
index a4a2122ddc..8e8ff6e4bf 100644
--- a/mail/session.c
+++ b/mail/session.c
@@ -1,11 +1,26 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* mail-session.c: handles the session information and resource manipulation */
/*
- * mail-session.c: handles the session information and resource manipulation
+ * Authors: Miguel de Icaza <miguel@gnu.org>
*
- * Author:
- * Miguel de Icaza (miguel@gnu.org)
+ * Copyright 2001 Ximian, Inc. (www.ximian.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*
- * (C) 2000 Helix Code, Inc. http://www.helixcode.com
*/
+
#include <config.h>
#include <gnome.h>
#include "mail.h"
@@ -34,7 +49,6 @@ mail_session_request_dialog (const char *prompt, gboolean secret, const char *ke
gboolean async)
{
GtkWidget *dialog;
-
char *ans;
if (!passwords)
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);
}