Re: some regressions in current HEAD



On 06/30/2009 07:41:25 AM, Ildar Mulyukov wrote:
On 29.06.2009 12:12:48, Ildar Mulyukov wrote:
On 29.06.2009 10:59:41, Ildar Mulyukov wrote:
I've got some regressions with current HEAD.

1. Changing identities in the New message window wipes out the signature and does not add another sig. Have to insert the signature by hand.

Confirmed.

2. In Mailbox properties the "Update" button is disabled. If I change the Identity, it doesn't get enabled. I believe that it was not that way. This is for Maildir only. The mbox behaves allright.

Confirmed.

3: Unread mail counter sometimes gets to negative numbers. This is not a regression - it was there for ages. It can be seen for example when you "Hide Unflagged" and some new mail arrives or gets read. Counter algorithms are not good for filtered box situations.

I don't see that. I did as follows:

True regression:
4. *Find in Message* does not work either.

I do not see that. The search widget is displated and when I type characters, the current hit gets highlighted as expeted. Can you please list a step-by-step scenario that exposes the problem?

Anyone to react?

Could you please verify whether the attached patch fixes the problems 1 and 2?

Pawel
From 81be24cd120e1d3d7adbdeaac9c517f8faa2b35a Mon Sep 17 00:00:00 2001
From: Pawel Salek <pawsa theochem kth se>
Date: Tue, 30 Jun 2009 18:56:19 +0200
Subject: [PATCH] Fix two out of four issues reported by Ildar.

* src/mailbox-conf.c: enable "update" button when editing maildir/mh mboxes.
* src/sendmsg-window.c: insert sig when changing identities in a new message.

---
 src/mailbox-conf.c   |    2 +-
 src/sendmsg-window.c |   45 +++++++++++++++++++++++++--------------------
 2 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/src/mailbox-conf.c b/src/mailbox-conf.c
index 9e108d8..1f8a6e1 100644
--- a/src/mailbox-conf.c
+++ b/src/mailbox-conf.c
@@ -1095,7 +1095,7 @@ create_local_mailbox_dialog(MailboxConfWindow *mcw)
 
     action = mcw->mailbox_type == LIBBALSA_TYPE_MAILBOX_MBOX ?
         GTK_FILE_CHOOSER_ACTION_SAVE :
-        GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER;
+        GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
     dialog =
         gtk_file_chooser_dialog_new(_("Local Mailbox Configurator"),
                                     GTK_WINDOW(balsa_app.main_window),
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 9c651ab..ae8faa7 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -180,11 +180,11 @@ static void edit_with_gnome(GtkAction * action, BalsaSendmsg* bsmsg);
 #endif
 static void change_identity_dialog_cb(GtkAction * action,
                                       BalsaSendmsg * bsmsg);
-static void repl_identity_signature(BalsaSendmsg* bsmsg, 
-                                    LibBalsaIdentity* new_ident,
-                                    LibBalsaIdentity* old_ident,
-                                    gint* replace_offset, gint siglen, 
-                                    gchar* new_sig);
+static void replace_identity_signature(BalsaSendmsg* bsmsg, 
+                                       LibBalsaIdentity* new_ident,
+                                       LibBalsaIdentity* old_ident,
+                                       gint* replace_offset, gint siglen, 
+                                       const gchar* new_sig);
 static void update_bsmsg_identity(BalsaSendmsg*, LibBalsaIdentity*);
 
 static void sw_size_alloc_cb(GtkWidget * window, GtkAllocation * alloc);
@@ -1269,9 +1269,9 @@ change_identity_dialog_cb(GtkAction * action, BalsaSendmsg* bsmsg)
 
 /* NOTE: replace_offset and siglen are  utf-8 character offsets. */
 static void
-repl_identity_signature(BalsaSendmsg* bsmsg, LibBalsaIdentity* new_ident,
-                        LibBalsaIdentity* old_ident, gint* replace_offset, 
-                        gint siglen, gchar* new_sig) 
+replace_identity_signature(BalsaSendmsg* bsmsg, LibBalsaIdentity* new_ident,
+                           LibBalsaIdentity* old_ident, gint* replace_offset, 
+                           gint siglen, const gchar* new_sig) 
 {
     gint newsiglen;
     gboolean reply_type = (bsmsg->type == SEND_REPLY || 
@@ -1299,8 +1299,9 @@ repl_identity_signature(BalsaSendmsg* bsmsg, LibBalsaIdentity* new_ident,
     
     /* check to see if this is a reply or forward and compare identity
      * settings to determine whether to add signature */
-    if ((reply_type && new_ident->sig_whenreply) ||
-          (forward_type && new_ident->sig_whenforward)) {
+    if (bsmsg->type == SEND_NORMAL ||
+        (reply_type && new_ident->sig_whenreply) ||
+        (forward_type && new_ident->sig_whenforward)) {
 
         /* see if sig location is probably going to be the same */
         if (new_ident->sig_prepend == old_ident->sig_prepend) {
@@ -1315,6 +1316,7 @@ repl_identity_signature(BalsaSendmsg* bsmsg, LibBalsaIdentity* new_ident,
             /* put it at the end of the message */
             gtk_text_buffer_get_end_iter(buffer, &ins);
         }
+        printf("Inserting new sig\n");
         gtk_text_buffer_place_cursor(buffer, &ins);
         gtk_text_buffer_insert_at_cursor(buffer, new_sig, -1);
     }
@@ -1549,8 +1551,8 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
     if (!old_sig) {
         replace_offset = bsmsg->ident->sig_prepend 
             ? 0 : g_utf8_strlen(message_text, -1);
-        repl_identity_signature(bsmsg, ident, old_ident, &replace_offset,
-                                0, new_sig);
+        replace_identity_signature(bsmsg, ident, old_ident, &replace_offset,
+                                   0, new_sig);
     } else {
         /* split on sig separator */
         message_split = g_strsplit(message_text, "\n-- \n", 0);
@@ -1561,8 +1563,8 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
 
 	if (g_ascii_strncasecmp(old_sig, compare_str, siglen) == 0) {
 	    g_free(compare_str);
-	    repl_identity_signature(bsmsg, ident, old_ident,
-				    &replace_offset, siglen - 1, new_sig);
+	    replace_identity_signature(bsmsg, ident, old_ident,
+                                       &replace_offset, siglen - 1, new_sig);
 	    found_sig = TRUE;
 	} else {
 	    g_free(compare_str);
@@ -1572,8 +1574,9 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
 
 		/* try to find occurance of old signature */
 		if (g_ascii_strncasecmp(old_sig, compare_str, siglen) == 0) {
-		    repl_identity_signature(bsmsg, ident, old_ident,
-					    &replace_offset, siglen, new_sig);
+		    replace_identity_signature(bsmsg, ident, old_ident,
+                                               &replace_offset, siglen,
+                                               new_sig);
 		    found_sig = TRUE;
 		}
 
@@ -1596,16 +1599,18 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
 
 	    if (g_ascii_strncasecmp(old_sig, tmpstr, siglen) == 0) {
 		g_free(tmpstr);
-		repl_identity_signature(bsmsg, ident, old_ident,
-					&replace_offset, siglen - 1, new_sig);
+		replace_identity_signature(bsmsg, ident, old_ident,
+                                           &replace_offset, siglen - 1,
+                                           new_sig);
 	    } else {
 		g_free(tmpstr);
 		replace_offset++;
 		compare_str = g_utf8_next_char(compare_str);
 		while (*compare_str) {
 		    if (g_ascii_strncasecmp(old_sig, compare_str, siglen) == 0) {
-			repl_identity_signature(bsmsg, ident, old_ident,
-						&replace_offset, siglen, new_sig);
+			replace_identity_signature(bsmsg, ident, old_ident,
+                                                   &replace_offset, siglen,
+                                                   new_sig);
 		    }
 		    replace_offset++;
 		    compare_str = g_utf8_next_char(compare_str);
-- 
1.6.0.6




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