fix 2 auto-sig bugs
authorPaul Mangan <paul@claws-mail.org>
Tue, 29 Jul 2003 12:15:48 +0000 (12:15 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 29 Jul 2003 12:15:48 +0000 (12:15 +0000)
ChangeLog.claws
configure.ac
src/compose.c

index 6635834..accf161 100644 (file)
@@ -1,3 +1,13 @@
+2003-07-29 [paul]      0.9.3claws71
+
+       * src/compose.c
+               fix bug where changing to an account without an auto-sig
+               from an initial account without an auto-sig would insert 
+               2 blank lines at the cursor point
+               fix bug where changing to an account with an auto-sig
+               from an initial account without an auto-sig would insert
+               the sig at the cursor point
+
 2003-07-29 [paul]      0.9.3claws70
 
        * src/folderview.c
index 1808e99..7649a86 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=70
+EXTRA_VERSION=71
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 0d9ab67..f74d5f2 100644 (file)
@@ -1902,6 +1902,7 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
 {
        GtkSText *text = GTK_STEXT(compose->text);
        gint cur_pos;
+       gint len;
 
        g_return_if_fail(compose->account != NULL);
 
@@ -1909,9 +1910,11 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
 
        gtk_stext_freeze(text);
 
+       len = gtk_stext_get_length(text);
+       gtk_stext_set_point(text, len);
+
        if (replace && compose->sig_str) {
                gint pos;
-               gint len;
 
                if (compose->sig_str[0] == '\0')
                        pos = -1;
@@ -1923,16 +1926,9 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
                        if (len >= 0) {
                                gtk_stext_set_point(text, pos);
                                gtk_stext_forward_delete(text, len);
-                       } else {
-                               len = gtk_stext_get_length(text);
-                               gtk_stext_set_point(text, len);
                        }
-               } else {
-                       len = gtk_stext_get_length(text);
-                       gtk_stext_set_point(text, len);
                }
-       } else
-               gtk_stext_insert(text, NULL, NULL, NULL, "\n\n", 2);
+       }
 
        g_free(compose->sig_str);
        compose->sig_str = compose_get_signature_str(compose);
@@ -1981,7 +1977,7 @@ static gchar *compose_get_signature_str(Compose *compose)
        }
 
        if (compose->account->sig_sep) {
-               sig_str = g_strconcat(compose->account->sig_sep, "\n", sig_body,
+               sig_str = g_strconcat("\n\n", compose->account->sig_sep, "\n", sig_body,
                                      NULL);
                g_free(sig_body);
        } else