aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-06-29 01:06:38 +0800
committerDan Winship <danw@src.gnome.org>2002-06-29 01:06:38 +0800
commitc2c672c537eef298146903f562d896ba89fb2f27 (patch)
tree98b08194f684f5a6766d9cec333981e906210af8
parentd462bdb71781dc071373feea544b9db172899ce8 (diff)
downloadgsoc2013-evolution-c2c672c537eef298146903f562d896ba89fb2f27.tar
gsoc2013-evolution-c2c672c537eef298146903f562d896ba89fb2f27.tar.gz
gsoc2013-evolution-c2c672c537eef298146903f562d896ba89fb2f27.tar.bz2
gsoc2013-evolution-c2c672c537eef298146903f562d896ba89fb2f27.tar.lz
gsoc2013-evolution-c2c672c537eef298146903f562d896ba89fb2f27.tar.xz
gsoc2013-evolution-c2c672c537eef298146903f562d896ba89fb2f27.tar.zst
gsoc2013-evolution-c2c672c537eef298146903f562d896ba89fb2f27.zip
Add this, to call e_summary_mail_get_info from an idle handler.
* e-summary-mail.c (e_summary_mail_idle_get_info): Add this, to call e_summary_mail_get_info from an idle handler. (new_folder_cb, update_folder_cb): Use idle_get_info rather than making another corba call from inside the corba handler. (Fixes a three-way deadlock between mail, summary, and exchange.) svn path=/trunk/; revision=17322
-rw-r--r--my-evolution/ChangeLog8
-rw-r--r--my-evolution/e-summary-mail.c39
2 files changed, 31 insertions, 16 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog
index 40d8d443c1..e3cab6c49c 100644
--- a/my-evolution/ChangeLog
+++ b/my-evolution/ChangeLog
@@ -1,3 +1,11 @@
+2002-06-28 Dan Winship <danw@ximian.com>
+
+ * e-summary-mail.c (e_summary_mail_idle_get_info): Add this, to
+ call e_summary_mail_get_info from an idle handler.
+ (new_folder_cb, update_folder_cb): Use idle_get_info rather than
+ making another corba call from inside the corba handler. (Fixes a
+ three-way deadlock between mail, summary, and exchange.)
+
2002-06-26 Iain <iain@ximian.com>
* e-summary-rdf.c (layer_find_url): If w == NULL return. Fixes crash
diff --git a/my-evolution/e-summary-mail.c b/my-evolution/e-summary-mail.c
index 50b06901b8..ffa65159ef 100644
--- a/my-evolution/e-summary-mail.c
+++ b/my-evolution/e-summary-mail.c
@@ -51,7 +51,7 @@ typedef struct _FolderStore {
GNOME_Evolution_Shell shell;
GNOME_Evolution_FolderInfo folder_info;
GNOME_Evolution_StorageRegistry registry;
- BonoboListener *listener;
+ Bonobo_Listener corba_listener;
EvolutionStorageListener *storage_listener;
GSList *storage_list;
@@ -185,18 +185,15 @@ e_summary_mail_get_html (ESummary *summary)
}
static void
-e_summary_mail_get_info (const char *uri,
- BonoboListener *listener)
+e_summary_mail_get_info (const char *uri)
{
- Bonobo_Listener corba_listener;
CORBA_Environment ev;
g_return_if_fail (folder_store->folder_info != CORBA_OBJECT_NIL);
- corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (listener));
CORBA_exception_init (&ev);
GNOME_Evolution_FolderInfo_getInfo (folder_store->folder_info, uri ? uri : "",
- corba_listener, &ev);
+ folder_store->corba_listener, &ev);
if (BONOBO_EX (&ev)) {
g_warning ("Error getting info for %s:\n%s", uri,
CORBA_exception_id (&ev));
@@ -208,6 +205,16 @@ e_summary_mail_get_info (const char *uri,
return;
}
+static gboolean
+e_summary_mail_idle_get_info (gpointer user_data)
+{
+ char *uri = user_data;
+
+ e_summary_mail_get_info (uri);
+ g_free (uri);
+ return FALSE;
+}
+
static void
new_folder_cb (EvolutionStorageListener *listener,
const char *path,
@@ -240,8 +247,8 @@ new_folder_cb (EvolutionStorageListener *listener,
if (strcmp (f->physical_uri, folder->physicalUri) == 0) {
folder_store->shown = g_list_append (folder_store->shown, mail_folder);
- e_summary_mail_get_info (mail_folder->path,
- folder_store->listener);
+ g_idle_add (e_summary_mail_idle_get_info,
+ g_strdup (mail_folder->path));
}
}
}
@@ -271,9 +278,7 @@ update_folder_cb (EvolutionStorageListener *listener,
g_print ("uri: %s\n", uri);
}
- e_summary_mail_get_info (uri, folder_store->listener);
-
- g_free (uri);
+ g_idle_add (e_summary_mail_idle_get_info, uri);
}
static void
@@ -537,8 +542,7 @@ e_summary_mail_reconfigure (void)
folder = g_hash_table_lookup (folder_store->folders, uri);
if (folder != NULL) {
if (folder->init == FALSE) {
- e_summary_mail_get_info (folder->path,
- folder_store->listener);
+ e_summary_mail_get_info (folder->path);
}
folder_store->shown = g_list_append (folder_store->shown, folder);
}
@@ -895,7 +899,8 @@ gboolean
e_summary_folder_init_folder_store (GNOME_Evolution_Shell shell)
{
CORBA_Environment ev;
-
+ BonoboListener *listener;
+
if (folder_store != NULL) {
return TRUE;
}
@@ -913,9 +918,11 @@ e_summary_folder_init_folder_store (GNOME_Evolution_Shell shell)
}
CORBA_exception_free (&ev);
- folder_store->listener = bonobo_listener_new (NULL, NULL);
- gtk_signal_connect (GTK_OBJECT (folder_store->listener), "event-notify",
+
+ listener = bonobo_listener_new (NULL, NULL);
+ gtk_signal_connect (GTK_OBJECT (listener), "event-notify",
GTK_SIGNAL_FUNC (mail_change_notify), NULL);
+ folder_store->corba_listener = bonobo_object_corba_objref (BONOBO_OBJECT (listener));
/* Create a hash table for the folders */
folder_store->folders = g_hash_table_new (g_str_hash, g_str_equal);