From cc1db29474b86b6ce73078e5386ca305f4de89db Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Fri, 11 May 2012 16:53:23 +0000 Subject: [PATCH] 2012-05-11 [colin] 3.8.0cvs40 * src/mimeview.c * src/common/utils.c Fix bug 2659, 'E-mail attachments are handled inconsistently' Fix problems iterating the mime tree, and determine whether a file is an email without To: --- ChangeLog | 9 +++++++++ PATCHSETS | 1 + configure.ac | 2 +- src/common/utils.c | 6 ++++-- src/mimeview.c | 11 ++++++++--- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c5f83440..346d9a869 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-05-11 [colin] 3.8.0cvs40 + + * src/mimeview.c + * src/common/utils.c + Fix bug 2659, 'E-mail attachments are handled + inconsistently' + Fix problems iterating the mime tree, and determine + whether a file is an email without To: + 2012-04-03 [colin] 3.8.0cvs39 * src/Makefile.am diff --git a/PATCHSETS b/PATCHSETS index 32c821776..efb7e98ef 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -4356,3 +4356,4 @@ ( cvs diff -u -r 1.382.2.599 -r 1.382.2.600 src/compose.c; ) > 3.8.0cvs37.patchset ( cvs diff -u -r 1.155.2.99 -r 1.155.2.100 src/Makefile.am; ) > 3.8.0cvs38.patchset ( cvs diff -u -r 1.155.2.100 -r 1.155.2.101 src/Makefile.am; ) > 3.8.0cvs39.patchset +( cvs diff -u -r 1.83.2.188 -r 1.83.2.189 src/mimeview.c; cvs diff -u -r 1.36.2.195 -r 1.36.2.196 src/common/utils.c; ) > 3.8.0cvs40.patchset diff --git a/configure.ac b/configure.ac index b81cd9187..3bba8a790 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=8 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=39 +EXTRA_VERSION=40 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/common/utils.c b/src/common/utils.c index d5a5a9483..3b82ed01f 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -4844,9 +4844,11 @@ gboolean file_is_email (const gchar *filename) && fgets(buffer, sizeof (buffer), fp) > 0) { if (!strncmp(buffer, "From:", strlen("From:"))) score++; - if (!strncmp(buffer, "To:", strlen("To:"))) + else if (!strncmp(buffer, "Date:", strlen("Date:"))) score++; - if (!strncmp(buffer, "Subject:", strlen("Subject:"))) + else if (!strncmp(buffer, "Message-ID:", strlen("Message-ID:"))) + score++; + else if (!strncmp(buffer, "Subject:", strlen("Subject:"))) score++; i++; } diff --git a/src/mimeview.c b/src/mimeview.c index 0ab2c887e..4773efd42 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -630,10 +630,15 @@ static gboolean mimeview_tree_next(GtkTreeModel *model, GtkTreePath *path) has_parent = gtk_tree_model_iter_parent(model, &parent, &iter); if (!gtk_tree_model_iter_next(model, &iter)) { - if (has_parent && gtk_tree_model_iter_next(model, &parent)) { + while (has_parent) { + GtkTreeIter saved_parent = parent; gtk_tree_path_up(path); - gtk_tree_path_next(path); - return TRUE; + if (gtk_tree_model_iter_next(model, &parent)) { + gtk_tree_path_next(path); + return TRUE; + } else { + has_parent = gtk_tree_model_iter_parent(model, &parent, &saved_parent); + } } } else { -- 2.25.1