CVS: sylpheedclaws/sylpheed-claws/src action.c,1.12.2.34,1.12.2.34.2.1 export.c,1.8.2.17,1.8.2.17.4.1 filtering.c,1.60.2.15,1.60.2.15.2.1 folder.c,1.213.2.91,1.213.2.91.2.1 folder.h,1.87.2.27,1.87.2.27.2.1 folderview.c,1.207.2.97,1.207.2.97.2.1 gedit-print.c,1.1.2.4,1.1.2.4.4.1 imap.c,1.179.2.113,1.179.2.113.2.1 import.c,1.13.2.16,1.13.2.16.4.1 inc.c,1.149.2.47,1.149.2.47.2.1 main.c,1.115.2.83,1.115.2.83.2.1 mainwindow.c,1.274.2.108,1.274.2.108.2.1 matcher.c,1.75.2.21,1.75.2.21.2.1 mbox.c,1.28.2.13,1.28.2.13.4.1 mh.c,1.79.2.24,1.79.2.24.4.1 mimeview.c,1.83.2.68,1.83.2.68.2.1 procmsg.c,1.150.2.61,1.150.2.61.2.1 send_message.c,1.17.2.27,1.17.2.27.2.1 statusbar.c,1.5.2.8,1.5.2.8.4.1 summaryview.c,1.395.2.194,1.395.2.194.2.1 summaryview.h,1.68.2.23,1.68.2.23.2.1

[email protected]
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /pack/anoncvs/sylpheedclaws/sylpheed-claws/src
In directory sunsite.dk:/tmp/cvs-serv9009/src

Modified Files:
      Tag: stable_2_2
	action.c export.c filtering.c folder.c folder.h folderview.c 
	gedit-print.c imap.c import.c inc.c main.c mainwindow.c 
	matcher.c mbox.c mh.c mimeview.c procmsg.c send_message.c 
	statusbar.c summaryview.c summaryview.h 
Log Message:
2006-05-22 [colin]	2.2.0cvs1-stable

	* src/action.c
	* src/export.c
	* src/filtering.c
	* src/folder.c
	* src/folder.h
	* src/folderview.c
	* src/gedit-print.c
	* src/imap.c
	* src/import.c
	* src/inc.c
	* src/main.c
	* src/mainwindow.c
	* src/matcher.c
	* src/mbox.c
	* src/mh.c
	* src/mimeview.c
	* src/procmsg.c
	* src/send_message.c
	* src/statusbar.c
	* src/summaryview.c
	* src/summaryview.h
	* src/etpan/imap-thread.c
		Backport fixes from 2.2.0cvs{6,11,18,19,20,29,39,40,41,46}:
		always obey 'confirm before marking all mails read' option
		fix mbox import/export behaviour on failure
		fix automatic rule creation with List-Post
		get rid of some gtk warning/errors at runtime (and avoid divide-by-0).
		fix some compiler warnings
		don't initialize g_thread subsystem if it's already done
		fix saving of parts when there name can't be converted from UTF-8.
		fix bug #830 (Some unread messages get marked read in IMAP inbox)
		fix bug #955 (copying messages between imap folders is extremely slow)
		fix infinite loop in filtering when encountering move+copy

Index: action.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/action.c,v
retrieving revision 1.12.2.34
retrieving revision 1.12.2.34.2.1
diff -u -d -r1.12.2.34 -r1.12.2.34.2.1
--- action.c	2006/05/01 18:34:57	1.12.2.34
+++ action.c	2006/05/22 17:32:23	1.12.2.34.2.1
@@ -1137,6 +1137,7 @@
 		gchar *text;
 		
 		gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(children->progress_bar),
+						  (children->initial_nb == 0) ? 0 :
 					      (gdouble) (children->initial_nb - children->nb) /
 					      (gdouble) children->initial_nb);
 		text = g_strdup_printf("%s %d/%d", _("Completed"), 

Index: export.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/export.c,v
retrieving revision 1.8.2.17
retrieving revision 1.8.2.17.4.1
diff -u -d -r1.8.2.17 -r1.8.2.17.4.1
--- export.c	2006/01/20 07:44:18	1.8.2.17
+++ export.c	2006/05/22 17:32:24	1.8.2.17.4.1
@@ -49,6 +49,7 @@
 #include "folder.h"
 #include "utils.h"
 #include "codeconv.h"
+#include "alertpanel.h"
 
 static GtkWidget *window;
 static GtkWidget *src_entry;
@@ -57,7 +58,7 @@
 static GtkWidget *file_button;
 static GtkWidget *ok_button;
 static GtkWidget *cancel_button;
-static gboolean export_ack;
+static gboolean export_ok; /* see export_mbox() return values */
 
 static void export_create(void);
 static void export_ok_cb(GtkWidget *widget, gpointer data);
@@ -68,10 +69,12 @@
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data);
 
 gint export_mbox(FolderItem *default_src)
+/* return values: -2 skipped/cancelled, -1 error, 0 OK */
 {
-	gint ok = 0;
 	gchar *src_id = NULL;
 
+	export_ok = -2;	// skipped or cancelled
+
 	if (!window) {
 		export_create();
 	}
@@ -98,35 +101,9 @@
 
 	gtk_main();
 
-	if (export_ack) {
-		const gchar *srcdir, *utf8mbox;
-		FolderItem *src;
-
-		srcdir = gtk_entry_get_text(GTK_ENTRY(src_entry));
-		utf8mbox = gtk_entry_get_text(GTK_ENTRY(file_entry));
-		if (utf8mbox && *utf8mbox) {
-			gchar *mbox;
-
-			mbox = g_filename_from_utf8(utf8mbox, -1, NULL, NULL, NULL);
-			if (!mbox) {
-				g_warning("Failed to convert character set.\n");
-				mbox = g_strdup(utf8mbox);
-			}
-
-			src = folder_find_item_from_identifier(srcdir);
-			if (!src) {
-				g_warning("Can't find the folder.\n");
-			} else {
-				ok = export_to_mbox(src, mbox);
-			}
-
-			g_free(mbox);
-		}
-	}
-
 	gtk_widget_hide(window);
 
-	return ok;
+	return export_ok;
 }
 
 static void export_create(void)
@@ -223,14 +200,47 @@
 
 static void export_ok_cb(GtkWidget *widget, gpointer data)
 {
-	export_ack = TRUE;
+	const gchar *srcdir, *utf8mbox;
+	FolderItem *src;
+	gchar *mbox;
+
+	srcdir = gtk_entry_get_text(GTK_ENTRY(src_entry));
+	utf8mbox = gtk_entry_get_text(GTK_ENTRY(file_entry));
+
+	if (utf8mbox && !*utf8mbox) {
+		alertpanel_error(_("Target mbox filename can't be left empty."));
+		gtk_widget_grab_focus(file_entry);
+		return;
+	}
+	if (srcdir && !*srcdir) {
+		alertpanel_error(_("Source folder can't be left empty."));
+		gtk_widget_grab_focus(src_entry);
+		return;
+	}
+
+	mbox = g_filename_from_utf8(utf8mbox, -1, NULL, NULL, NULL);
+	if (!mbox) {
+		g_warning("export_ok_cb(): failed to convert character set.\n");
+		mbox = g_strdup(utf8mbox);
+	}
+
+	src = folder_find_item_from_identifier(srcdir);
+	if (!src) {
+		alertpanel_error(_("Can't find the source folder."));
+		gtk_widget_grab_focus(src_entry);
+		return;
+	} else {
+		export_ok = export_to_mbox(src, mbox);
+	}
+
+	g_free(mbox);
+
 	if (gtk_main_level() > 1)
 		gtk_main_quit();
 }
 
 static void export_cancel_cb(GtkWidget *widget, gpointer data)
 {
-	export_ack = FALSE;
 	if (gtk_main_level() > 1)
 		gtk_main_quit();
 }

Index: filtering.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/filtering.c,v
retrieving revision 1.60.2.15
retrieving revision 1.60.2.15.2.1
diff -u -d -r1.60.2.15 -r1.60.2.15.2.1
--- filtering.c	2006/04/06 10:58:02	1.60.2.15
+++ filtering.c	2006/05/22 17:32:24	1.60.2.15.2.1
@@ -260,6 +260,13 @@
 			return FALSE;
 		}
 		
+		/* check if mail is set to copy already, 
+		 * in which case we have to do it */
+		if (info->is_copy && info->to_filter_folder) {
+			debug_print("should cp and mv !\n");
+			folder_item_copy_msg(info->to_filter_folder, info);
+			info->is_copy = FALSE;
+		}
 		/* mark message to be moved */		
 		info->is_move = TRUE;
 		info->to_filter_folder = dest_folder;

Index: folder.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/folder.c,v
retrieving revision 1.213.2.91
retrieving revision 1.213.2.91.2.1
diff -u -d -r1.213.2.91 -r1.213.2.91.2.1
--- folder.c	2006/04/25 22:39:56	1.213.2.91
+++ folder.c	2006/05/22 17:32:24	1.213.2.91.2.1
@@ -1526,6 +1526,11 @@
 	if (item->no_select)
 		return -1;
 
+	if (item->scanning) {
+		debug_print("%s is scanning... \n", item->path ? item->path : item->name);
+		return -2;
+	}
+
 	item->processing_pending = TRUE;
 	folder_item_process_open (item, NULL, NULL, NULL);
 	
@@ -1681,11 +1686,13 @@
 	g_return_val_if_fail(folder != NULL, -1);
 	g_return_val_if_fail(folder->klass->get_num_list != NULL, -1);
 
+	item->scanning = TRUE;
 	debug_print("Scanning folder %s for cache changes.\n", item->path ? item->path : "(null)");
 
 	/* Get list of messages for folder and cache */
 	if (folder->klass->get_num_list(item->folder, item, &folder_list, &old_uids_valid) < 0) {
 		debug_print("Error fetching list of message numbers\n");
+		item->scanning = FALSE;
 		return(-1);
 	}
 
@@ -1929,6 +1936,8 @@
 	folder_item_update(item, update_flags);
 	folder_item_update_thaw();
 
+	item->scanning = FALSE;
+
 	return 0;
 }
 
@@ -1985,6 +1994,8 @@
 	if (item->no_select)
 		return -1;
 
+	item->scanning = TRUE;
+
 	if (item->cache == NULL)
 		folder_item_read_cache(item);
 	
@@ -1996,6 +2007,8 @@
 		procmsg_msginfo_free((MsgInfo *) cur->data);
 	
 	g_slist_free(msglist);
+
+	item->scanning = FALSE;
 
 	return ret;
 }

Index: folder.h
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/folder.h,v
retrieving revision 1.87.2.27
retrieving revision 1.87.2.27.2.1
diff -u -d -r1.87.2.27 -r1.87.2.27.2.1
--- folder.h	2006/04/25 08:00:00	1.87.2.27
+++ folder.h	2006/05/22 17:32:25	1.87.2.27.2.1
@@ -631,6 +631,7 @@
 	/* for faster search of special parents */
 	SpecialFolderItemType parent_stype;
 	gboolean processing_pending;
+	gboolean scanning;
 };
 
 struct _PersistPrefs

Index: folderview.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/folderview.c,v
retrieving revision 1.207.2.97
retrieving revision 1.207.2.97.2.1
diff -u -d -r1.207.2.97 -r1.207.2.97.2.1
--- folderview.c	2006/04/25 08:00:00	1.207.2.97
+++ folderview.c	2006/05/22 17:32:25	1.207.2.97.2.1
@@ -1043,7 +1043,12 @@
 			if (folder && folder != item->folder) continue;
 			if (!folder && !FOLDER_IS_LOCAL(item->folder)) continue;
 			if (!item->prefs->newmailcheck) continue;
-			
+			if (item->processing_pending == TRUE) {
+				debug_print("skipping %s, processing pending\n",
+					item->path ? item->path : item->name);
+				continue;
+			}
+
 			str = get_scan_str(item);
 
 			STATUSBAR_PUSH(folderview->mainwin, str);
@@ -1874,6 +1879,27 @@
 	return FALSE;
 }
 
+typedef struct _PostponedSelectData
+{
+	GtkCTree *ctree;
+	GtkCTreeNode *row;
+	gint column;
+	FolderView *folderview;
+} PostponedSelectData;
+
+static gboolean postpone_select(void *data)
+{
+	PostponedSelectData *psdata = (PostponedSelectData *)data;
+	debug_print("trying again\n");
+	psdata->folderview->open_folder = TRUE;
+	main_window_cursor_normal(psdata->folderview->mainwin);
+	STATUSBAR_POP(psdata->folderview->mainwin);
+	folderview_selected(psdata->ctree, psdata->row,
+			    psdata->column, psdata->folderview);
+	g_free(psdata);
+	return FALSE;
+}
+
 static void folderview_selected(GtkCTree *ctree, GtkCTreeNode *row,
 				gint column, FolderView *folderview)
 {
@@ -1881,6 +1907,7 @@
 	gboolean opened;
 	FolderItem *item;
 	gchar *buf;
+	int res = 0;
 
 	folderview->selected = row;
 
@@ -1951,7 +1978,8 @@
 
 	main_window_cursor_wait(folderview->mainwin);
 
-	if (folder_item_open(item) != 0) {
+	res = folder_item_open(item);
+	if (res == -1) {
 		main_window_cursor_normal(folderview->mainwin);
 		STATUSBAR_POP(folderview->mainwin);
 
@@ -1961,7 +1989,19 @@
 		can_select = TRUE;
 
 		return;
-        }
+        } else if (res == -2) {
+		PostponedSelectData *data = g_new0(PostponedSelectData, 1);
+		data->ctree = ctree;
+		data->row = row;
+		data->column = column;
+		data->folderview = folderview;
+		debug_print("postponing open of %s till end of scan\n",
+			item->path ? item->path:item->name);
+		folderview->open_folder = FALSE;
+		can_select = TRUE;
+		g_timeout_add(500, postpone_select, data);
+		return;
+	}
 	
 	main_window_cursor_normal(folderview->mainwin);
 

Index: gedit-print.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/Attic/gedit-print.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.4.4.1
diff -u -d -r1.1.2.4 -r1.1.2.4.4.1
--- gedit-print.c	2005/10/26 16:15:21	1.1.2.4
+++ gedit-print.c	2006/05/22 17:32:26	1.1.2.4.4.1
@@ -276,7 +276,7 @@
 	g_free (str);
 
 	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (pji->progressbar), 
-				       1.0 * page_num / total);
+				       (total == 0) ? 0 : 1.0 * page_num / total);
 
 	/* Update UI */
 	while (gtk_events_pending ())

Index: imap.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/imap.c,v
retrieving revision 1.179.2.113
retrieving revision 1.179.2.113.2.1
diff -u -d -r1.179.2.113 -r1.179.2.113.2.1
--- imap.c	2006/05/03 17:51:39	1.179.2.113
+++ imap.c	2006/05/22 17:32:26	1.179.2.113.2.1
@@ -1325,7 +1325,7 @@
 static gint imap_do_remove_msgs(Folder *folder, FolderItem *dest, 
 			        MsgInfoList *msglist, GRelation *relation)
 {
-	gchar *destdir;
+	gchar *destdir, *dir;
 	GSList *numlist = NULL, *cur;
 	MsgInfo *msginfo;
 	IMAPSession *session;
@@ -1375,6 +1375,15 @@
 		return ok;
 	}
 	
+	dir = folder_item_get_path(msginfo->folder);
+	if (is_dir_exist(dir)) {
+		for (cur = msglist; cur; cur = cur->next) {
+			msginfo = (MsgInfo *)cur->data;
+			remove_numbered_files(dir, msginfo->msgnum, msginfo->msgnum);
+		}
+	}
+	g_free(dir);
+
 	g_relation_destroy(uid_mapping);
 	g_slist_free(numlist);
 
@@ -3452,12 +3461,6 @@
 	if (!session) {
 		return;
 	}
-	lock_session();
-	if ((ok = imap_select(session, IMAP_FOLDER(folder), msginfo->folder->path,
-	    NULL, NULL, NULL, NULL, FALSE)) != IMAP_SUCCESS) {
-	    	unlock_session();
-		return;
-	}
 
 	if (!MSG_IS_MARKED(msginfo->flags) &&  (newflags & MSG_MARKED))
 		flags_set |= IMAP_FLAG_FLAGGED;
@@ -3479,6 +3482,19 @@
 	if ( MSG_IS_DELETED(msginfo->flags) && !(newflags & MSG_DELETED))
 		flags_unset |= IMAP_FLAG_DELETED;
 
+	if (!flags_set && !flags_unset) {
+		/* the changed flags were not translatable to IMAP-speak.
+		 * like MSG_POSTFILTERED, so just apply. */
+		msginfo->flags.perm_flags = newflags;
+		return;
+	}
+
+	lock_session();
+	if ((ok = imap_select(session, IMAP_FOLDER(folder), msginfo->folder->path,
+	    NULL, NULL, NULL, NULL, FALSE)) != IMAP_SUCCESS) {
+	    	unlock_session();
+		return;
+	}
 	numlist.next = NULL;
 	numlist.data = GINT_TO_POINTER(msginfo->msgnum);
 

Index: import.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/import.c,v
retrieving revision 1.13.2.16
retrieving revision 1.13.2.16.4.1
diff -u -d -r1.13.2.16 -r1.13.2.16.4.1
--- import.c	2006/01/20 07:44:18	1.13.2.16
+++ import.c	2006/05/22 17:32:27	1.13.2.16.4.1
@@ -49,6 +49,7 @@
 #include "manage_window.h"
 #include "folder.h"
 #include "codeconv.h"
+#include "alertpanel.h"
 
 static GtkWidget *window;
 static GtkWidget *file_entry;
@@ -57,7 +58,7 @@
 static GtkWidget *dest_button;
 static GtkWidget *ok_button;
 static GtkWidget *cancel_button;
-static gboolean import_ack;
+static gboolean import_ok; /* see import_mbox() return values */
 
 static void import_create(void);
 static void import_ok_cb(GtkWidget *widget, gpointer data);
@@ -68,10 +69,12 @@
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data);
 
 gint import_mbox(FolderItem *default_dest)
+/* return values: -2 skipped/cancelled, -1 error, 0 OK */
 {
-	gint ok = 0;
 	gchar *dest_id = NULL;
 
+	import_ok = -2;	// skipped or cancelled
+
 	if (!window) {
 		import_create();
 	}
@@ -98,41 +101,9 @@
 
 	gtk_main();
 
-	if (import_ack) {
-		const gchar *utf8mbox, *destdir;
-		FolderItem *dest;
-
-		utf8mbox = gtk_entry_get_text(GTK_ENTRY(file_entry));
-		destdir = gtk_entry_get_text(GTK_ENTRY(dest_entry));
-		if (utf8mbox && *utf8mbox) {
-			gchar *mbox;
-
-			mbox = g_filename_from_utf8(utf8mbox, -1, NULL, NULL, NULL);
-			if (!mbox) {
-				g_warning("Failed to convert character set.\n");
-				mbox = g_strdup(utf8mbox);
-			}
-
-			if (!destdir || !*destdir) {
-				dest = folder_find_item_from_path(INBOX_DIR);
-			} else {
-				dest = folder_find_item_from_identifier
-					(destdir);
-			}
-
-			if (!dest) {
-				g_warning("Can't find the folder.\n");
-			} else {
-				ok = proc_mbox(dest, mbox, FALSE);
-			}
-
-			g_free(mbox);
-		}
-	}
-
 	gtk_widget_hide(window);
 
-	return ok;
+	return import_ok;
 }
 
 static void import_create(void)
@@ -228,14 +199,56 @@
 
 static void import_ok_cb(GtkWidget *widget, gpointer data)
 {
-	import_ack = TRUE;
+	const gchar *utf8mbox, *destdir;
+	FolderItem *dest;
+	gchar *mbox;
+
+	utf8mbox = gtk_entry_get_text(GTK_ENTRY(file_entry));
+	destdir = gtk_entry_get_text(GTK_ENTRY(dest_entry));
+
+	if (utf8mbox && !*utf8mbox) {
+		alertpanel_error(_("Source mbox filename can't be left empty."));
+		gtk_widget_grab_focus(file_entry);
+		return;
+	}
+	if (destdir && !*destdir) {
+		if (alertpanel(_("Import mbox file"), _("Destination folder is not set.\nImport mbox file to the inbox folder?"),
+						GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL)
+			== G_ALERTALTERNATE) {
+			gtk_widget_grab_focus(dest_entry);
+			return;
+		}
+	}
+
+	mbox = g_filename_from_utf8(utf8mbox, -1, NULL, NULL, NULL);
+	if (!mbox) {
+		g_warning("import_ok_cb(): failed to convert character set.\n");
+		mbox = g_strdup(utf8mbox);
+	}
+
+	if (!destdir || !*destdir) {
+		dest = folder_find_item_from_path(INBOX_DIR);
+	} else {
+		dest = folder_find_item_from_identifier
+			(destdir);
+	}
+
+	if (!dest) {
+		alertpanel_error(_("Can't find the destination folder."));
+		gtk_widget_grab_focus(dest_entry);
+		return;
+	} else {
+		import_ok = proc_mbox(dest, mbox, FALSE);
+	}
+
+	g_free(mbox);
+
 	if (gtk_main_level() > 1)
 		gtk_main_quit();
 }
 
 static void import_cancel_cb(GtkWidget *widget, gpointer data)
 {
-	import_ack = FALSE;
 	if (gtk_main_level() > 1)
 		gtk_main_quit();
 }

Index: inc.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/inc.c,v
retrieving revision 1.149.2.47
retrieving revision 1.149.2.47.2.1
diff -u -d -r1.149.2.47 -r1.149.2.47.2.1
--- inc.c	2006/04/11 22:03:26	1.149.2.47
+++ inc.c	2006/05/22 17:32:27	1.149.2.47.2.1
@@ -927,7 +927,7 @@
 	}
 
 	progress_dialog_set_fraction
-		(inc_dialog->dialog,(gfloat)cur_total / (gfloat)total);
+		(inc_dialog->dialog, (total == 0) ? 0: (gfloat)cur_total / (gfloat)total);
 
 	g_snprintf(buf, sizeof(buf), "%d / %d",
 		   pop3_session->cur_msg, pop3_session->count);
@@ -935,7 +935,7 @@
 		(GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar), buf);
 	gtk_progress_bar_set_fraction
 		(GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar),
-		 (gfloat)cur_total / (gfloat)total);
+		 (total == 0) ? 0 : (gfloat)cur_total / (gfloat)total);
 
 	if (pop3_session->cur_total_num > 0) {
 		g_snprintf(buf, sizeof(buf),

Index: main.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/main.c,v
retrieving revision 1.115.2.83
retrieving revision 1.115.2.83.2.1
diff -u -d -r1.115.2.83 -r1.115.2.83.2.1
--- main.c	2006/05/05 16:17:37	1.115.2.83
+++ main.c	2006/05/22 17:32:28	1.115.2.83.2.1
@@ -334,8 +334,8 @@
 	if (cmd.exit)
 		return 0;
 #endif
-	g_thread_init(NULL);
-	/* gdk_threads_init(); */
+	if (!g_thread_supported())
+		g_thread_init(NULL);
 
 	gtk_set_locale();
 	gtk_init(&argc, &argv);

Index: mainwindow.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/mainwindow.c,v
retrieving revision 1.274.2.108
retrieving revision 1.274.2.108.2.1
diff -u -d -r1.274.2.108 -r1.274.2.108.2.1
--- mainwindow.c	2006/04/21 16:52:18	1.274.2.108
+++ mainwindow.c	2006/05/22 17:32:28	1.274.2.108.2.1
@@ -1883,8 +1883,7 @@
 	g_snprintf(buf, sizeof(buf), "%d / %d", cur, total);
 	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(mainwin->progressbar), buf);
 	gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(mainwin->progressbar),
-				(cur == 0 && total == 0) ? 0 :
-				(gfloat)cur / (gfloat)total);
+				(total == 0) ? 0 : (gfloat)cur / (gfloat)total);
 }
 
 void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
@@ -2667,19 +2666,28 @@
 static void import_mbox_cb(MainWindow *mainwin, guint action,
 			   GtkWidget *widget)
 {
-	import_mbox(mainwin->summaryview->folder_item);
+	/* only notify if import has failed */
+	if (import_mbox(mainwin->summaryview->folder_item) == -1) {
+		alertpanel_error(_("Mbox import has failed."));
+	}
 }
 
 static void export_mbox_cb(MainWindow *mainwin, guint action,
 			   GtkWidget *widget)
 {
-	export_mbox(mainwin->summaryview->folder_item);
+	/* only notify if export has failed */
+	if (export_mbox(mainwin->summaryview->folder_item) == -1) {
+		alertpanel_error(_("Export to mbox has failed."));
+	}
 }
 
 static void export_list_mbox_cb(MainWindow *mainwin, guint action,
 				GtkWidget *widget)
 {
-	summaryview_export_mbox_list(mainwin->summaryview);
+	/* only notify if export has failed */
+	if (summaryview_export_mbox_list(mainwin->summaryview) == -1) {
+		alertpanel_error(_("Export to mbox has failed."));
+	}
 }
 
 static void empty_trash_cb(MainWindow *mainwin, guint action,

Index: matcher.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/matcher.c,v
retrieving revision 1.75.2.21
retrieving revision 1.75.2.21.2.1
diff -u -d -r1.75.2.21 -r1.75.2.21.2.1
--- matcher.c	2006/04/28 09:21:10	1.75.2.21
+++ matcher.c	2006/05/22 17:32:29	1.75.2.21.2.1
@@ -390,7 +390,7 @@
 		res = matcherprop_string_match(prop, tmp);
 	}
 	
-	if (res == FALSE && strchr(prop->expr, '=') || strchr(prop->expr, '_') ) {
+	if (res == FALSE && (strchr(prop->expr, '=') || strchr(prop->expr, '_')) ) {
 		/* if searching for something with an equal char, maybe 
 		 * we should try to match the non-decoded string. 
 		 * In case it was not qp-encoded. */

Index: mbox.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/mbox.c,v
retrieving revision 1.28.2.13
retrieving revision 1.28.2.13.4.1
diff -u -d -r1.28.2.13 -r1.28.2.13.4.1
--- mbox.c	2006/02/06 18:02:16	1.28.2.13
+++ mbox.c	2006/05/22 17:32:29	1.28.2.13.4.1
@@ -59,6 +59,7 @@
 }
 
 gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter)
+/* return values: -1 error, >=0 number of msgs added */
 {
 	FILE *mbox_fp;
 	gchar buf[MSGBUFSIZE];
@@ -375,6 +376,7 @@
 }
 
 gint export_list_to_mbox(GSList *mlist, const gchar *mbox)
+/* return values: -2 skipped, -1 error, 0 OK */
 {
 	GSList *cur;
 	MsgInfo *msginfo;
@@ -388,7 +390,7 @@
 							_("Overwrite"), GTK_STOCK_CANCEL, NULL, FALSE,
 							NULL, ALERT_WARNING, G_ALERTALTERNATE)
 			== G_ALERTALTERNATE) {
-		return -1;
+		return -2;
 	}
 	}
 
@@ -456,9 +458,11 @@
 }
 
 /* read all messages in SRC, and store them into one MBOX file. */
+/* return values: -2 skipped, -1 error, 0 OK */
 gint export_to_mbox(FolderItem *src, const gchar *mbox)
 {
 	GSList *mlist;
+	gint ret;
 	
 	g_return_val_if_fail(src != NULL, -1);
 	g_return_val_if_fail(src->folder != NULL, -1);
@@ -469,9 +473,9 @@
 
 	mlist = folder_item_get_msg_list(src);
 
-	export_list_to_mbox(mlist, mbox);
+	ret = export_list_to_mbox(mlist, mbox);
 
 	procmsg_msg_list_free(mlist);
 
-	return 0;
+	return ret;
 }

Index: mh.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/mh.c,v
retrieving revision 1.79.2.24
retrieving revision 1.79.2.24.4.1
diff -u -d -r1.79.2.24 -r1.79.2.24.4.1
--- mh.c	2006/03/01 18:38:23	1.79.2.24
+++ mh.c	2006/05/22 17:32:29	1.79.2.24.4.1
@@ -324,7 +324,8 @@
 	gchar *file;
 
 	g_return_val_if_fail(item != NULL, NULL);
-	g_return_val_if_fail(num > 0, NULL);
+	if (num <= 0)
+		return NULL;
 
 	file = mh_fetch_msg(folder, item, num);
 	if (!file) return NULL;

Index: mimeview.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/mimeview.c,v
retrieving revision 1.83.2.68
retrieving revision 1.83.2.68.2.1
diff -u -d -r1.83.2.68 -r1.83.2.68.2.1
--- mimeview.c	2006/04/25 06:33:14	1.83.2.68
+++ mimeview.c	2006/05/22 17:32:30	1.83.2.68.2.1
@@ -1292,6 +1292,10 @@
 
 	tmp = g_filename_from_utf8(filename, -1, NULL, NULL, NULL);
 	
+	if (tmp == NULL) {
+		g_warning("filename not in UTF-8");
+		tmp = g_strdup("Unnamed part");
+	}
 	filename = g_strconcat(get_mime_tmp_dir(), G_DIR_SEPARATOR_S,
 			       tmp, NULL);
 

Index: procmsg.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/procmsg.c,v
retrieving revision 1.150.2.61
retrieving revision 1.150.2.61.2.1
diff -u -d -r1.150.2.61 -r1.150.2.61.2.1
--- procmsg.c	2006/04/18 16:21:10	1.150.2.61
+++ procmsg.c	2006/05/22 17:32:30	1.150.2.61.2.1
@@ -633,7 +633,7 @@
 		} else if (hentry[H_SENDER].body != NULL) {
 			SET_FILTER_KEY("header \"Sender\"", H_SENDER);
 		} else if (hentry[H_LIST_POST].body != NULL) {
-			SET_FILTER_KEY("header \"Sender\"", H_LIST_POST);
+			SET_FILTER_KEY("header \"List-Post\"", H_LIST_POST);
 		} else if (msginfo->to) {
 			*header = g_strdup("to");
 			*key = g_strdup(msginfo->to);

Index: send_message.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/send_message.c,v
retrieving revision 1.17.2.27
retrieving revision 1.17.2.27.2.1
diff -u -d -r1.17.2.27 -r1.17.2.27.2.1
--- send_message.c	2006/04/14 08:50:41	1.17.2.27
+++ send_message.c	2006/05/22 17:32:31	1.17.2.27.2.1
@@ -493,7 +493,7 @@
 		   cur_len, total_len);
 	progress_dialog_set_label(dialog->dialog, buf);
 	progress_dialog_set_fraction
-		(dialog->dialog, (gfloat)cur_len / (gfloat)total_len);
+		(dialog->dialog, (total_len == 0) ? 0 : (gfloat)cur_len / (gfloat)total_len);
 
 	return 0;
 }

Index: statusbar.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/statusbar.c,v
retrieving revision 1.5.2.8
retrieving revision 1.5.2.8.4.1
diff -u -d -r1.5.2.8 -r1.5.2.8.4.1
--- statusbar.c	2006/01/13 17:24:14	1.5.2.8
+++ statusbar.c	2006/05/22 17:32:31	1.5.2.8.4.1
@@ -155,7 +155,7 @@
 			(GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), buf);
 		gtk_progress_bar_set_fraction
 			(GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar),
-			 (gfloat)done / (gfloat)total);
+			 (total == 0) ? 0 : (gfloat)done / (gfloat)total);
 	} else if (total == 0) {
 		gtk_progress_bar_set_text
 			(GTK_PROGRESS_BAR(mainwindow_get_mainwindow()->progressbar), "");

Index: summaryview.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/summaryview.c,v
retrieving revision 1.395.2.194
retrieving revision 1.395.2.194.2.1
diff -u -d -r1.395.2.194 -r1.395.2.194.2.1
--- summaryview.c	2006/04/25 06:33:14	1.395.2.194
+++ summaryview.c	2006/05/22 17:32:31	1.395.2.194.2.1
@@ -2449,7 +2449,8 @@
 
 	Xstrdup_a(email_addr, addr, return NULL);
 	extract_address(email_addr);
-	g_return_val_if_fail(*email_addr, NULL);
+	if (!*email_addr)
+		return NULL;
 
 	/*
 	 * completion stuff must be already initialized
@@ -3149,7 +3150,21 @@
 {
 	GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 	GtkCTreeNode *node;
+	AlertValue val;
 
+	if (prefs_common.ask_mark_all_read) {
+		val = alertpanel_full(_("Mark all as read"),
+			_("Do you really want to mark all mails in this "
+			  "folder as read ?"), GTK_STOCK_NO, GTK_STOCK_YES, NULL,
+			  TRUE, NULL, ALERT_QUESTION, G_ALERTALTERNATE);
+
+		if (val == G_ALERTDEFAULT ||
+		    val == (G_ALERTDEFAULT|G_ALERTDISABLE))
+			return;
+		else if (val == (G_ALERTALTERNATE|G_ALERTDISABLE))
+			prefs_common.ask_mark_all_read = FALSE;
+	}
+	
 	START_LONG_OPERATION(summaryview);
 	folder_item_set_batch(summaryview->folder_item, TRUE);
 	for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list); node != NULL;
@@ -5853,19 +5868,22 @@
 		summary_select_node(summaryview, node, TRUE, TRUE);
 }
 
-void summaryview_export_mbox_list(SummaryView *summaryview)
+gint summaryview_export_mbox_list(SummaryView *summaryview)
+/* return values: -2 skipped, -1 error, 0 OK */
 {
 	GSList *list = summary_get_selected_msg_list(summaryview);
 	gchar *mbox = filesel_select_file_save(_("Export to mbox file"), NULL);
+	gint ret;
 	
 	if (mbox == NULL || list == NULL)
-		return;
+		return -1;
 		
-	export_list_to_mbox(list, mbox);
+	ret = export_list_to_mbox(list, mbox);
 	
 	g_slist_free(list);
 	g_free(mbox);
 	
+	return ret;
 }
 
 void summaryview_lock(SummaryView *summaryview, FolderItem *item)

Index: summaryview.h
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/summaryview.h,v
retrieving revision 1.68.2.23
retrieving revision 1.68.2.23.2.1
diff -u -d -r1.68.2.23 -r1.68.2.23.2.1
--- summaryview.h	2006/04/25 06:33:15	1.68.2.23
+++ summaryview.h	2006/05/22 17:32:32	1.68.2.23.2.1
@@ -282,7 +282,7 @@
                                   (SummaryView *summaryview, FolderItem *item);
 void summary_save_prefs_to_folderitem
                                   (SummaryView *summaryview, FolderItem *item);
-void summaryview_export_mbox_list (SummaryView *summaryview);
+gint summaryview_export_mbox_list (SummaryView *summaryview);
 void summaryview_lock(SummaryView *summaryview, FolderItem *item);
 void summaryview_unlock(SummaryView *summaryview, FolderItem *item);
 void summary_reflect_prefs(void);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.