[Commits] [SCM] claws branch, 3.15.0-cherrypick, created. 3.15.0-13-gba333d5

claws at claws-mail.org claws at claws-mail.org
Mon Aug 28 19:53:01 CEST 2017


The branch, 3.15.0-cherrypick has been created
        at  ba333d5e8833efdcdf7fa2c6d76d2121b3533395 (commit)

- Log -----------------------------------------------------------------
commit ba333d5e8833efdcdf7fa2c6d76d2121b3533395
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Aug 26 10:03:51 2017 +0200

    Fix typo around libarchive in configure.ac.
    
    Patch by Orbea, Bug 3866 - slibtool causes compile failure

diff --git a/configure.ac b/configure.ac
index 1108adc..8547307 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1174,7 +1174,7 @@ AC_SUBST(ARCHIVE_CFLAGS)
 AC_CHECK_LIB([archive], [archive_read_new],
 		       ARCHIVE_LIBS=-larchive
 		       HAVE_ARCHIVE=yes
-		       AC_SUBST(ARCHIVE_LIBS,ARCHIVE_CFLAGS),
+		       AC_SUBST(ARCHIVE_LIBS,$ARCHIVE_CFLAGS),
 		       HAVE_ARCHIVE=no
 		       )
 

commit 668a6773c05848de97dcdb3c6d6c7fc52df8cac4
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Aug 26 10:00:07 2017 +0200

    Fixed incorrect PERL_LDFLAGS modification with sed.
    
    Patch by Orbea, Bug 3866 - slibtool causes compile failure

diff --git a/AUTHORS b/AUTHORS
index a387e3f..bc4c8db 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -313,3 +313,4 @@ contributors (in addition to the above; based on Changelog)
 	Ashish Gupta
 	Olivier Brunel
 	Michael Vilain
+	Orbea
diff --git a/configure.ac b/configure.ac
index 3205d35..1108adc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1222,10 +1222,10 @@ if test x"$HAVE_PERL" = xyes; then
 	AC_MSG_CHECKING(for Perl compile flags)
 	PERL_CFLAGS=`perl -MExtUtils::Embed -e ccopts`
 	PERL_CFLAGS=`echo $PERL_CFLAGS | sed 's/-D_FILE_OFFSET_BITS=[[0-9]]*//'`
-	PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm//'`
-	PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb//'`
-	PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm//'`
-	PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc//'`
+	PERL_LDFLAGS=`perl -MExtUtils::Embed -e ldopts |sed 's/-lgdbm\>//'`
+	PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-ldb\>//'`
+	PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lndbm\>//'`
+	PERL_LDFLAGS=`echo $PERL_LDFLAGS |sed 's/-lc\>//'`
 	AC_MSG_RESULT(ok)
 	AC_MSG_NOTICE([Adding perl LIBS ${PERL_CFLAGS}])
 	
diff --git a/src/gtk/authors.h b/src/gtk/authors.h
index 7f8c09c..b6b7cf7 100644
--- a/src/gtk/authors.h
+++ b/src/gtk/authors.h
@@ -240,6 +240,7 @@ static char *CONTRIBS_LIST[] = {
 "Miquel Oliete",
 "Paul Ollis",
 "Fredrik Olofssen",
+"Orbea",
 "Reza Pakdel",
 "Richard Palo",
 "Marcel Pol",

commit 2bff5b4bc20d11074cfd9a2981a2c57ad3f5bb05
Author: Ricardo Mones <ricardo at mones.org>
Date:   Wed Aug 9 16:48:38 2017 +0200

    Fix bug #3855: segfault at startup with old profile and IMAP account
    
    Revert "Remove duplicated code and include".
    
    This reverts commit 300f811f3bbf10455ca55d9b01da6705dd1e07bb.

diff --git a/src/imap.c b/src/imap.c
index eb810a3..6c9161a 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -77,6 +77,8 @@ typedef struct _IMAPSession	IMAPSession;
 typedef struct _IMAPNameSpace	IMAPNameSpace;
 typedef struct _IMAPFolderItem	IMAPFolderItem;
 
+#include "prefs_account.h"
+
 #define IMAP_FOLDER(obj)	((IMAPFolder *)obj)
 #define IMAP_FOLDER_ITEM(obj)	((IMAPFolderItem *)obj)
 #define IMAP_SESSION(obj)	((IMAPSession *)obj)
@@ -425,6 +427,7 @@ static gint imap_get_flags			(Folder 	*folder,
 						 FolderItem 	*item,
                     				 MsgInfoList 	*msglist,
 						 GHashTable 	*msgflags);
+static gchar *imap_folder_get_path		(Folder		*folder);
 static gchar *imap_item_get_path		(Folder		*folder,
 						 FolderItem	*item);
 static MsgInfo *imap_parse_msg(const gchar *file, FolderItem *item);
@@ -3041,6 +3044,35 @@ static FolderItem *imap_create_special_folder(Folder *folder,
 	return new_item;
 }
 
+static gchar *imap_folder_get_path(Folder *folder)
+{
+	gchar *folder_path;
+
+	g_return_val_if_fail(folder != NULL, NULL);
+        g_return_val_if_fail(folder->account != NULL, NULL);
+
+#ifdef G_OS_WIN32
+	gchar *sanitized_dirname = g_strdup(folder->account->recv_server);
+	g_strdelimit(sanitized_dirname, ":", ',');
+#endif
+
+        folder_path = g_strconcat(get_imap_cache_dir(),
+                                  G_DIR_SEPARATOR_S,
+#ifdef G_OS_WIN32
+																	sanitized_dirname,
+#else
+                                  folder->account->recv_server,
+#endif
+                                  G_DIR_SEPARATOR_S,
+                                  folder->account->userid,
+                                  NULL);
+
+#ifdef G_OS_WIN32
+	g_free(sanitized_dirname);
+#endif
+	return folder_path;
+}
+
 #ifdef G_OS_WIN32
 static gchar *imap_encode_unsafe_chars(const gchar *str)
 {
@@ -3077,9 +3109,8 @@ static gchar *imap_item_get_path(Folder *folder, FolderItem *item)
 	gchar *item_path = NULL;
 	
 	g_return_val_if_fail(folder != NULL, NULL);
-	g_return_val_if_fail(folder->account != NULL, NULL);
 	g_return_val_if_fail(item != NULL, NULL);
-	folder_path = prefs_account_cache_dir(folder->account, FALSE);
+	folder_path = imap_folder_get_path(folder);
 
 	g_return_val_if_fail(folder_path != NULL, NULL);
 

commit 6d21543c9badc3e8a73d3ff2c72ad015f9808dcf
Author: Ricardo Mones <ricardo at mones.org>
Date:   Mon Jul 3 21:55:23 2017 +0200

    Fix bug #3348 ‘Contact pictures not deleted when contact is deleted’
    
    Based on original patch submitted by Charles Lehner (thanks!)

diff --git a/src/addrduplicates.c b/src/addrduplicates.c
index dcde08a..96fe30d 100644
--- a/src/addrduplicates.c
+++ b/src/addrduplicates.c
@@ -862,10 +862,7 @@ gboolean addrduplicates_delete_item_person(ItemPerson *item, AddressDataSource *
 #endif
 
 	if(item) {
-		gchar *filename = addritem_person_get_picture(item);
-		if (filename && is_file_exist(filename))
-			claws_unlink(filename);
-		g_free(filename);
+		addritem_person_remove_picture(item);
 		addritem_free_item_person(item);
 	}
 	return TRUE;
diff --git a/src/addressbook.c b/src/addressbook.c
index 403b556..77ddee8 100644
--- a/src/addressbook.c
+++ b/src/addressbook.c
@@ -1573,10 +1573,7 @@ static void addressbook_del_clicked(GtkButton *button, gpointer data)
 				}
 #endif
 				if( item ) {
-					gchar *filename = addritem_person_get_picture(item);
-					if (filename && is_file_exist(filename))
-						claws_unlink(filename);
-					g_free(filename);
+					addritem_person_remove_picture(item);
 					addritem_free_item_person( item );
 				}
 			}
diff --git a/src/addritem.c b/src/addritem.c
index ae3dc4e..f6d9d12 100644
--- a/src/addritem.c
+++ b/src/addritem.c
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2001-2012 Match Grun and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2001-2017 Match Grun and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 /*
@@ -25,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "defs.h"
 #include "utils.h"
 #include "addritem.h"
 #include "mgutils.h"
@@ -272,13 +272,37 @@ void addritem_person_set_picture( ItemPerson *person, const gchar *value ) {
 /**
  * Get picture for person object.
  * \param person Person object.
- * \param value Picture.
  */
 gchar *addritem_person_get_picture( ItemPerson *person) {
 	if (person->picture)
 		return g_strdup(person->picture);
 	return NULL;
 }
+
+/**
+ * Delete picture for person object.
+ * \param person Person object.
+ */
+void addritem_person_remove_picture( ItemPerson *person) {
+	if (person->picture) {
+		gchar *filename = g_strconcat( get_rc_dir(), G_DIR_SEPARATOR_S,
+			ADDRBOOK_DIR, G_DIR_SEPARATOR_S, person->picture,
+			".png", NULL );
+		if (is_file_exist(filename)) {
+			debug_print("removing addressbook picture %s\n",
+				filename);
+			if (claws_unlink(filename) < 0) {
+				FILE_OP_ERROR(filename, "remove");
+				g_free(filename);
+				return;
+			}
+		}
+		g_free(person->picture);
+		person->picture = NULL;
+		g_free(filename);
+	}
+}
+
 /**
  * Specify first name for person object.
  * \param person Person object.
diff --git a/src/addritem.h b/src/addritem.h
index 82fbaf3..9bccdf8 100644
--- a/src/addritem.h
+++ b/src/addritem.h
@@ -1,6 +1,6 @@
 /*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2001-2012 Match Grun and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 2001-2017 Match Grun and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 /*
@@ -138,6 +137,7 @@ ItemPerson *addritem_create_item_person	( void );
 ItemPerson *addritem_copy_item_person	( ItemPerson *item );
 void addritem_person_set_picture	( ItemPerson *person, const gchar *value );
 gchar *addritem_person_get_picture	( ItemPerson *person);
+void addritem_person_remove_picture	( ItemPerson *person);
 void addritem_person_set_first_name	( ItemPerson *person, const gchar *value );
 void addritem_person_set_last_name	( ItemPerson *person, const gchar *value );
 void addritem_person_set_nick_name	( ItemPerson *person, const gchar *value );

commit ee440c5c3d0fc895e6ba75a22ba80a30196d349a
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sat Jun 17 17:05:55 2017 +0200

    Fix bug 3822 ‘AttRemover deletes message and fails to create new one when disk is full’

diff --git a/src/plugins/att_remover/att_remover.c b/src/plugins/att_remover/att_remover.c
index 1092c15..0946bb1 100644
--- a/src/plugins/att_remover/att_remover.c
+++ b/src/plugins/att_remover/att_remover.c
@@ -129,9 +129,14 @@ static gint save_new_message(MsgInfo *oldmsg, MsgInfo *newmsg, MimeInfo *info,
 		flags.tmp_flags &= ~MSG_HAS_ATTACHMENT;
 
 	oldmsg->flags.perm_flags &= ~MSG_LOCKED;
+	msgnum = folder_item_add_msg(item, finalmsg->plaintext_file, &flags, TRUE);
+	if (msgnum < 0) {
+		g_warning("could not add message without attachments");
+		procmsg_msginfo_free(&newmsg);
+		procmsg_msginfo_free(&finalmsg);
+		return msgnum;
+	}
 	folder_item_remove_msg(item, oldmsg->msgnum);
-	msgnum = folder_item_add_msg(item, finalmsg->plaintext_file, 
-			&flags, TRUE);
 	finalmsg->msgnum = msgnum;
 	procmsg_msginfo_free(&newmsg);
 	procmsg_msginfo_free(&finalmsg);

commit 4324cd82f0f3acf74aae4e9d1e79c7897647f155
Author: Paul <paul at claws-mail.org>
Date:   Fri Jun 16 10:05:15 2017 +0100

    fix building on MAC. fixes bug 3835, 'autogen.sh fails with invalid test on line 33'
    
    fix by Michael Vilain <michael at vilain.com>

diff --git a/AUTHORS b/AUTHORS
index f84b2cc..a387e3f 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -312,3 +312,4 @@ contributors (in addition to the above; based on Changelog)
 	Darac Marjal
 	Ashish Gupta
 	Olivier Brunel
+	Michael Vilain
diff --git a/autogen.sh b/autogen.sh
index 093adb3..f2f62c9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -12,9 +12,9 @@ if [ "$bisonver" = "" ]; then
 fi
 
 if [ "$LEX" != "" ]; then
-	flexver=`$LEX --version|sed "s/.* //"`
+	flexver=`$LEX --version|awk '{print $2}'`
 else
-	flexver=`flex --version|sed "s/.* //"`
+	flexver=`flex --version|awk '{print $2}'`
 fi
 
 if [ "$flexver" = "" ]; then
@@ -36,8 +36,21 @@ else
 	fi
 fi
 
+case `uname` in
+	Darwin*)
+		if [ "`glibtoolize --version`" = "" ]; then
+			echo MacOS requires glibtool from either Macport or brew
+			exit 1
+		fi
+		LIBTOOL="glibtoolize --force --copy"
+		;;
+	*)
+		LIBTOOL="libtoolize --force --copy"
+		;;
+esac
+
 aclocal -I m4 \
-  && libtoolize --force --copy \
+  && ${LIBTOOL} \
   && autoheader \
   && automake --add-missing --foreign --copy \
   && autoconf 
diff --git a/src/gtk/authors.h b/src/gtk/authors.h
index f5d958c..7f8c09c 100644
--- a/src/gtk/authors.h
+++ b/src/gtk/authors.h
@@ -294,6 +294,7 @@ static char *CONTRIBS_LIST[] = {
 "Petr Vanek",
 "Jeroen Versteeg",
 "Kevin Vigor",
+"Michael Vilain",
 "Johan Vromans",
 "Botalov Vyacheslav",
 "Radek Vybiral",

commit dde06f95c7cfd96bccce613bea50104dd6b707f4
Author: Ricardo Mones <ricardo at mones.org>
Date:   Thu Jun 1 12:27:15 2017 +0200

    Fix bug #3721 ‘Fails to build in Debian kfreebsd-*’

diff --git a/configure.ac b/configure.ac
index ecdd285..3205d35 100644
--- a/configure.ac
+++ b/configure.ac
@@ -500,7 +500,7 @@ case $host_os in
 	*dragonfly*)
 		AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
 	;;
-	*freebsd*)
+	freebsd*)
 	;; # not used
 	*)
 		AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))

commit 910c25c82366d21ecb3d938ac9457759a1b9711c
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed May 31 21:10:19 2017 +0200

    Only preserve existing Message-ID when reediting a draft.
    
    This is a followup to commit e22cbed1f.
    Closes Bug 3828 - "Re-edit" should not recycle the Message-ID header

diff --git a/src/compose.c b/src/compose.c
index 6935a5e..84f951d 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -2981,7 +2981,9 @@ static gint compose_parse_header(Compose *compose, MsgInfo *msginfo)
 		if (msginfo->inreplyto && *msginfo->inreplyto)
 			compose->inreplyto = g_strdup(msginfo->inreplyto);
 
-		if (msginfo->msgid && *msginfo->msgid)
+		if (msginfo->msgid && *msginfo->msgid &&
+				compose->folder != NULL &&
+				compose->folder->stype ==  F_DRAFT)
 			compose->msgid = g_strdup(msginfo->msgid);
 	} else {
 		if (msginfo->msgid && *msginfo->msgid)

commit 051735e8b3813d33d50181ff9c721098a412f721
Author: Paul <paul at claws-mail.org>
Date:   Sun May 21 19:12:51 2017 +0100

    fix Resent-Date value

diff --git a/src/compose.c b/src/compose.c
index 4a29775..6935a5e 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -5461,7 +5461,7 @@ static gint compose_redirect_write_headers(Compose *compose, FILE *fp)
 		get_rfc822_date_hide_tz(date, sizeof(date));
 	else
 		get_rfc822_date(date, sizeof(date));
-	err |= (fprintf(fp, "Resent-Date: %s\n", buf) < 0);
+	err |= (fprintf(fp, "Resent-Date: %s\n", date) < 0);
 
 	/* Resent-From */
 	if (compose->account->name && *compose->account->name) {

commit b6c1a4b853ea1b3acb5ff8486094fdd0ff955b97
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Mon May 15 22:22:13 2017 +0200

    RSSyl: Stop earlier when an invalid feed is encountered.
    
    This fixes a bug where feeds get renamed to "Untitled feed"
    if their URL starts serving e.g. a HTML document instead
    of proper content.

diff --git a/src/plugins/rssyl/libfeed/feed.c b/src/plugins/rssyl/libfeed/feed.c
index 10f0a76..c88f87b 100644
--- a/src/plugins/rssyl/libfeed/feed.c
+++ b/src/plugins/rssyl/libfeed/feed.c
@@ -38,6 +38,7 @@ Feed *feed_new(gchar *url)
 	feed = malloc( sizeof(Feed) );
 	g_return_val_if_fail(feed != NULL, NULL);
 
+	feed->is_valid = TRUE;
 	feed->timeout = FEED_DEFAULT_TIMEOUT;
 	feed->url = g_strdup(url);
 	feed->auth = NULL;
@@ -339,8 +340,11 @@ guint feed_update(Feed *feed, time_t last_update)
 	if( res != CURLE_OK ) {
 		feed->fetcherr = g_strdup(curl_easy_strerror(res));
 		response_code = FEED_ERR_FETCH;
-	} else
+	} else if (!feed->is_valid) {
+		response_code = FEED_ERR_NOFEED;
+	} else {
 		curl_easy_getinfo(eh, CURLINFO_RESPONSE_CODE, &response_code);
+	}
 
 cleanup:
 	curl_easy_cleanup(eh);
diff --git a/src/plugins/rssyl/libfeed/feed.h b/src/plugins/rssyl/libfeed/feed.h
index f8df922..c62f462 100644
--- a/src/plugins/rssyl/libfeed/feed.h
+++ b/src/plugins/rssyl/libfeed/feed.h
@@ -46,6 +46,7 @@ struct _FeedAuth {
 struct _Feed {
 	gchar *url;
 	FeedAuth *auth;
+	gboolean is_valid;
 	gchar *title;
 	gchar *description;
 	gchar *language;
diff --git a/src/plugins/rssyl/libfeed/parser.c b/src/plugins/rssyl/libfeed/parser.c
index 68694ab..be9458c 100644
--- a/src/plugins/rssyl/libfeed/parser.c
+++ b/src/plugins/rssyl/libfeed/parser.c
@@ -93,6 +93,9 @@ static void _elparse_start_chooser(void *data,
 				feedtype = FEED_TYPE_ATOM_10;
 			else
 				feedtype = FEED_TYPE_ATOM_03;
+		} else {
+			/* Not a known feed type */
+			ctx->feed->is_valid = FALSE;
 		}
 	}
 
@@ -164,11 +167,19 @@ size_t feed_writefunc(void *ptr, size_t size, size_t nmemb, void *data)
 	FeedParserCtx *ctx = (FeedParserCtx *)data;
 	gint status, err;
 
+	if (!ctx->feed->is_valid) {
+		/* We already know that the feed is not valid, so we won't
+		 * try parsing it. Just return correct number so libcurl is
+		 * happy. */
+		return len;
+	}
+
 	status = XML_Parse(ctx->parser, ptr, len, FALSE);
 
 	if( status == XML_STATUS_ERROR ) {
 		err = XML_GetErrorCode(ctx->parser);
 		printf("\nExpat: --- %s\n\n", XML_ErrorString(err));
+		ctx->feed->is_valid = FALSE;
 	}
 
 	return len;
diff --git a/src/plugins/rssyl/rssyl_update_feed.c b/src/plugins/rssyl/rssyl_update_feed.c
index a9d1129..e74045c 100644
--- a/src/plugins/rssyl/rssyl_update_feed.c
+++ b/src/plugins/rssyl/rssyl_update_feed.c
@@ -134,7 +134,7 @@ void rssyl_fetch_feed(RFetchCtx *ctx, RSSylVerboseFlags verbose)
 
 		ctx->success = FALSE;
 	} else {
-		if( ctx->feed == NULL ) {
+		if( ctx->feed == NULL || ctx->response_code == FEED_ERR_NOFEED) {
 			if( verbose & RSSYL_SHOW_ERRORS) {
 				gchar *msg = g_markup_printf_escaped(
 						(const char *) _("No valid feed found at\n<b>%s</b>"),

commit a775ccee710b2c93a7904972eb3fe6dbf9cd6976
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri May 12 18:20:14 2017 +0200

    Fix incorrect labels in folder selection dialog
    
    When custom label for folder selection were introduced (in bd8213fe) a
    few ones were wrongly set, specifically ones when copying/moving folders
    were talking about copying/moving message(s) instead.
    
    Patch by Olivier Brunel.

diff --git a/AUTHORS b/AUTHORS
index 494802b..f84b2cc 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -311,3 +311,4 @@ contributors (in addition to the above; based on Changelog)
 	Ralf Bormann
 	Darac Marjal
 	Ashish Gupta
+	Olivier Brunel
diff --git a/src/gtk/authors.h b/src/gtk/authors.h
index a79fad1..f5d958c 100644
--- a/src/gtk/authors.h
+++ b/src/gtk/authors.h
@@ -102,6 +102,7 @@ static char *CONTRIBS_LIST[] = {
 "Ralf Bormann",
 "H. Merijn Brand",
 "Eugene Brevdo",
+"Olivier Brunel",
 "Sean Buckheister",
 "Anton Butanaev",
 "Henrik Carlqvist",
diff --git a/src/imap_gtk.c b/src/imap_gtk.c
index 26e3663..6e41b40 100644
--- a/src/imap_gtk.c
+++ b/src/imap_gtk.c
@@ -308,17 +308,16 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != imap_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE,
-			ngettext(
-				"Select folder to move selected message to",
-				"Select folder to move selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to move folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 	
@@ -329,17 +328,16 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != imap_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE,
-			ngettext(
-				"Select folder to copy selected message to",
-				"Select folder to copy selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to copy folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 	
diff --git a/src/mh_gtk.c b/src/mh_gtk.c
index 605ef13..f4525be 100644
--- a/src/mh_gtk.c
+++ b/src/mh_gtk.c
@@ -298,17 +298,16 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != mh_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE,
-			ngettext(
-				"Select folder to move selected message to",
-				"Select folder to move selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to move folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 	
@@ -319,17 +318,16 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != mh_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE,
-			ngettext(
-				"Select folder to copy selected message to",
-				"Select folder to copy selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to copy folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 	
diff --git a/src/plugins/mailmbox/plugin_gtk.c b/src/plugins/mailmbox/plugin_gtk.c
index 47b7684..d567ec8 100644
--- a/src/plugins/mailmbox/plugin_gtk.c
+++ b/src/plugins/mailmbox/plugin_gtk.c
@@ -363,17 +363,16 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != claws_mailmbox_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE,
-			ngettext(
-				"Select folder to move selected message to",
-				"Select folder to move selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to move folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 
@@ -384,17 +383,16 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != claws_mailmbox_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE,
-			ngettext(
-				"Select folder to copy selected message to",
-				"Select folder to copy selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to copy folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 

commit 3a270eae3cba0dcf506105c58ed7905341bdb9f7
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Mon Apr 24 18:59:10 2017 +0200

    Fix crash in sieve manager window when no account has sieve enabled.
    
    The GtkComboBox gets destroyed in such case, but the 'Refresh'
    button handler didn't check for that.

diff --git a/src/plugins/managesieve/sieve_manager.c b/src/plugins/managesieve/sieve_manager.c
index afdb36a..3120d7e 100644
--- a/src/plugins/managesieve/sieve_manager.c
+++ b/src/plugins/managesieve/sieve_manager.c
@@ -605,6 +605,9 @@ static void account_changed(GtkWidget *widget, SieveManagerPage *page)
 	PrefsAccount *account;
 	SieveSession *session;
 
+	if (page->accounts_menu == NULL)
+		return;
+
 	account_id = combobox_get_active_data(GTK_COMBO_BOX(page->accounts_menu));
 	account = account_find_from_id(account_id);
 	if (!account)
@@ -705,6 +708,7 @@ static SieveManagerPage *sieve_manager_page_new()
 	if (!default_account) {
 		gtk_widget_destroy(label);
 		gtk_widget_destroy(accounts_menu);
+		accounts_menu = NULL;
 	}
 
 	/* status */

commit e7575b5fd6f37c88b592934cbf480d99712ab8d4
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sun Apr 9 18:31:52 2017 +0200

    Fix GUI not updating after deleting a tag.
    
    Fixes bug #3744 - Crash upon deleting tags.

diff --git a/src/edittags.c b/src/edittags.c
index a107c15..bd2cb91 100644
--- a/src/edittags.c
+++ b/src/edittags.c
@@ -225,6 +225,13 @@ static void apply_popup_delete (GtkAction *action, gpointer data)
 	gtk_tree_model_get(model, &sel,
 			   TAG_DATA, &id,
 			   -1);
+
+	/* Even though this is not documented, gtk_tree_model_get()
+	 * seems to invalidate the GtkTreeIter that is passed to it,
+	 * so we need to reacquire it. */
+	if (!gtk_tree_selection_get_selected(selection, NULL, &sel))
+		return;
+
 	gtk_list_store_remove(GTK_LIST_STORE(model), &sel);
 	if (mainwindow_get_mainwindow() != NULL)
 		summaryview = mainwindow_get_mainwindow()->summaryview;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list