[evolution-patches] 32732, blocking while doing some tasks



This basically tweaks the thread usage, so that things like blocking
connecting/startup don't block other tasks.

and fixes a fixme.

Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2761.2.11
diff -u -3 -r1.2761.2.11 ChangeLog
--- mail/ChangeLog	5 Aug 2003 21:38:19 -0000	1.2761.2.11
+++ mail/ChangeLog	5 Aug 2003 23:28:42 -0000
@@ -1,5 +1,30 @@
 2003-08-05  Not Zed  <NotZed Ximian com>
 
+	** See bug #32732
+
+	* message-list.c (mail_regen_list): use thread_new.
+
+	* mail-local.c (reconfigure_response): use thread_new.
+
+	* mail-display.c (stream_write_or_redisplay_when_loaded): use
+	thread_new.
+
+	* mail-config.c (mail_config_check_service): use thread_new rather
+	than queue.
+
+	* mail-callbacks.c (view_msg): change to use mail_get_messages(),
+	fixes FIXME.
+	(do_view_messages): handle get_messages callback.
+	(do_view_message): removed.
+
+	* mail-ops.c (mail_get_folderinfo): Use a new thread thread
+	semantic.
+	(mail_save_part): "
+	(mail_store_set_offline): "
+	(mail_sync_folder): use queued_slow thread queue.
+	(mail_expunge_folder): "
+	(mail_empty_trash): "
+
 	** See bug #47224.  Hook onto clicked rather than button_pressed,
 	so that dnd works.
 	
Index: mail/mail-callbacks.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-callbacks.c,v
retrieving revision 1.447.2.1
diff -u -3 -r1.447.2.1 mail-callbacks.c
--- mail/mail-callbacks.c	1 Jul 2003 18:44:38 -0000	1.447.2.1
+++ mail/mail-callbacks.c	5 Aug 2003 23:28:42 -0000
@@ -3115,18 +3115,21 @@
 }
 
 static void
-do_view_message (CamelFolder *folder, const char *uid, CamelMimeMessage *message, void *data)
+do_view_messages(CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, void *data)
 {
-	FolderBrowser *fb = FOLDER_BROWSER (data);
-	
+	FolderBrowser *fb = data;
+	int i;
+
 	if (FOLDER_BROWSER_IS_DESTROYED (fb))
 		return;
-	
-	if (message && uid) {
+
+	for (i = 0; i < uids->len && i < msgs->len; i++) {
+		char *uid = uids->pdata[i];
+		CamelMimeMessage *msg = msgs->pdata[i];
 		GtkWidget *mb;
 		
-		camel_folder_set_message_flags (folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
-		mb = message_browser_new (fb->shell, fb->uri, uid);
+		camel_folder_set_message_flags(folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
+		mb = message_browser_new(fb->shell, fb->uri, uid);
 		gtk_widget_show (mb);
 	}
 }
@@ -3136,7 +3139,6 @@
 {
 	FolderBrowser *fb = FOLDER_BROWSER (user_data);
 	GPtrArray *uids;
-	int i;
 	
 	if (FOLDER_BROWSER_IS_DESTROYED (fb))
 		return;
@@ -3147,12 +3149,7 @@
 	if (uids->len > 10 && !are_you_sure (_("Are you sure you want to open all %d messages in separate windows?"), uids, fb))
 		return;
 	
-	/* FIXME: use mail_get_messages() */
-	for (i = 0; i < uids->len; i++) {
-		mail_get_message (fb->folder, uids->pdata [i], do_view_message, fb, mail_thread_queued);
-		g_free (uids->pdata [i]);
-	}
-	g_ptr_array_free (uids, TRUE);
+	mail_get_messages(fb->folder, uids, do_view_messages, fb);
 }
 
 void
Index: mail/mail-config.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.c,v
retrieving revision 1.284
diff -u -3 -r1.284 mail-config.c
--- mail/mail-config.c	25 Jun 2003 16:54:17 -0000	1.284
+++ mail/mail-config.c	5 Aug 2003 23:28:42 -0000
@@ -1153,7 +1153,7 @@
 	m->success = &ret;
 	
 	id = m->msg.seq;
-	e_thread_put(mail_thread_queued, (EMsg *)m);
+	e_thread_put(mail_thread_new, (EMsg *)m);
 
 	dialog = gtk_dialog_new_with_buttons(_("Connecting to server..."), window,
 					     GTK_DIALOG_DESTROY_WITH_PARENT,
Index: mail/mail-local.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-local.c,v
retrieving revision 1.132.4.1
diff -u -3 -r1.132.4.1 mail-local.c
--- mail/mail-local.c	1 Aug 2003 18:39:01 -0000	1.132.4.1
+++ mail/mail-local.c	5 Aug 2003 23:28:42 -0000
@@ -1396,7 +1396,7 @@
 		gtk_widget_set_sensitive (m->apply, FALSE);
 		gtk_widget_set_sensitive (m->cancel, FALSE);
 		
-		e_thread_put (mail_thread_queued, (EMsg *)m);
+		e_thread_put (mail_thread_new, (EMsg *)m);
 		break; }
 	case GTK_RESPONSE_CANCEL:
 	default:
Index: mail/mail-ops.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-ops.c,v
retrieving revision 1.392.4.1
diff -u -3 -r1.392.4.1 mail-ops.c
--- mail/mail-ops.c	1 Aug 2003 18:39:01 -0000	1.392.4.1
+++ mail/mail-ops.c	5 Aug 2003 23:28:42 -0000
@@ -1184,7 +1184,7 @@
 	m->data = data;
 	id = m->msg.seq;
 
-	e_thread_put(mail_thread_queued, (EMsg *)m);
+	e_thread_put(mail_thread_new, (EMsg *)m);
 
 	return id;
 }
@@ -1558,7 +1558,7 @@
 	m->data = data;
 	m->done = done;
 
-	e_thread_put(mail_thread_queued, (EMsg *)m);
+	e_thread_put(mail_thread_queued_slow, (EMsg *)m);
 }
 
 /* ******************************************************************************** */
@@ -1630,7 +1630,7 @@
 	m->data = data;
 	m->done = done;
 
-	e_thread_put(mail_thread_queued, (EMsg *)m);
+	e_thread_put(mail_thread_queued_slow, (EMsg *)m);
 }
 
 /* ******************************************************************************** */
@@ -1705,7 +1705,7 @@
 	m->data = data;
 	m->done = done;
 
-	e_thread_put(mail_thread_queued, (EMsg *)m);
+	e_thread_put(mail_thread_queued_slow, (EMsg *)m);
 }
 
 /* ** GET MESSAGE(s) ***************************************************** */
@@ -2126,7 +2126,7 @@
 	m->done = done;
 	
 	id = m->msg.seq;
-	e_thread_put (mail_thread_queued, (EMsg *)m);
+	e_thread_put (mail_thread_new, (EMsg *)m);
 	
 	return id;
 }
@@ -2301,7 +2301,7 @@
 	m->done = done;
 
 	id = m->msg.seq;
-	e_thread_put(mail_thread_queued, (EMsg *)m);
+	e_thread_put(mail_thread_new, (EMsg *)m);
 
 	return id;
 }
Index: mail/message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.346.2.1
diff -u -3 -r1.346.2.1 message-list.c
--- mail/message-list.c	1 Jul 2003 18:44:39 -0000	1.346.2.1
+++ mail/message-list.c	5 Aug 2003 23:28:42 -0000
@@ -2913,5 +2913,5 @@
 
 	ml->regen = g_list_prepend(ml->regen, m);
 	
-	e_thread_put (mail_thread_queued, (EMsg *)m);
+	e_thread_put (mail_thread_new, (EMsg *)m);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]