[Commits] [SCM] claws branch, master, updated. 4.3.0-65-g9426214cf

paul at claws-mail.org paul at claws-mail.org
Wed Feb 5 17:17:27 UTC 2025


The branch, master has been updated
       via  9426214cf5c4c841f647a421273bc85db6c6a8ec (commit)
      from  4a0f97d327ceba2e40c575ddba66349a9c23ff13 (commit)

Summary of changes:
 src/mh.c           | 39 ++++++++++++++++++++++++---------------
 src/prefs_common.c |  8 +++++---
 src/prefs_common.h |  1 +
 3 files changed, 30 insertions(+), 18 deletions(-)


- Log -----------------------------------------------------------------
commit 9426214cf5c4c841f647a421273bc85db6c6a8ec
Author: Paul <paul at claws-mail.org>
Date:   Wed Feb 5 17:17:22 2025 +0000

    make the creation and updating of .mh_sequences optional and disabled by default

diff --git a/src/mh.c b/src/mh.c
index d11b6c499..7a49bffe4 100644
--- a/src/mh.c
+++ b/src/mh.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2024 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2025 the Claws Mail team and Hiroyuki Yamamoto
  *
  * 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
@@ -43,6 +43,7 @@
 #include "timing.h"
 #include "msgcache.h"
 #include "file-utils.h"
+#include "prefs_common.h"
 
 /* Define possible missing constants for Windows. */
 #ifdef G_OS_WIN32
@@ -458,7 +459,9 @@ static gint mh_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
 		g_free(destfile);
 		dest->last_num++;
 	}
-	mh_write_sequences(dest, TRUE);
+	if (prefs_common.mh_compat_mode)
+		mh_write_sequences(dest, TRUE);
+
 	return dest->last_num;
 }
 
@@ -603,7 +606,8 @@ static gint mh_copy_msgs(Folder *folder, FolderItem *dest, MsgInfoList *msglist,
 	}
 
 	g_free(srcpath);
-	mh_write_sequences(dest, TRUE);
+	if (prefs_common.mh_compat_mode)
+		mh_write_sequences(dest, TRUE);
 
 	if (dest->mtime == last_dest_mtime && !dest_need_scan) {
 		mh_set_mtime(folder, dest);
@@ -620,7 +624,8 @@ static gint mh_copy_msgs(Folder *folder, FolderItem *dest, MsgInfoList *msglist,
 	return dest->last_num;
 err_reset_status:
 	g_free(srcpath);
-	mh_write_sequences(dest, TRUE);
+	if (prefs_common.mh_compat_mode)
+		mh_write_sequences(dest, TRUE);
 	if (total > 100) {
 		statusbar_progress_all(0,0,0);
 		statusbar_pop_all();
@@ -728,7 +733,8 @@ static gint mh_remove_all_msg(Folder *folder, FolderItem *item)
 	val = remove_all_numbered_files(path);
 	g_free(path);
 
-	mh_write_sequences(item, TRUE);
+	if (prefs_common.mh_compat_mode)
+		mh_write_sequences(item, TRUE);
 
 	return val;
 }
@@ -976,8 +982,8 @@ static FolderItem *mh_create_folder(Folder *folder, FolderItem *parent,
 	gchar *path, *real_name;
 	gchar *fullpath;
 	FolderItem *new_item;
-	gchar *mh_sequences_filename;
-	FILE *mh_sequences_file;
+	gchar *mh_sequences_filename = NULL;
+	FILE *mh_sequences_file = NULL;
 
 	cm_return_val_if_fail(folder != NULL, NULL);
 	cm_return_val_if_fail(parent != NULL, NULL);
@@ -1022,14 +1028,16 @@ static FolderItem *mh_create_folder(Folder *folder, FolderItem *parent,
 
 	g_free(path);
 
-	path = folder_item_get_path(new_item);
-	mh_sequences_filename = g_strconcat(path, G_DIR_SEPARATOR_S,
-					    ".mh_sequences", NULL);
-	if ((mh_sequences_file = claws_fopen(mh_sequences_filename, "a+b")) != NULL) {
-		claws_fclose(mh_sequences_file);
+	if (prefs_common.mh_compat_mode) {
+		path = folder_item_get_path(new_item);
+		mh_sequences_filename = g_strconcat(path, G_DIR_SEPARATOR_S,
+						".mh_sequences", NULL);
+		if ((mh_sequences_file = claws_fopen(mh_sequences_filename, "a+b")) != NULL) {
+			claws_fclose(mh_sequences_file);
+		}
+		g_free(mh_sequences_filename);
+		g_free(path);
 	}
-	g_free(mh_sequences_filename);
-	g_free(path);
 
 	return new_item;
 }
@@ -1461,7 +1469,8 @@ static int mh_item_close(Folder *folder, FolderItem *item)
 	gboolean need_scan = mh_scan_required(item->folder, item);
 	last_mtime = item->mtime;
 
-	mh_write_sequences(item, FALSE);
+	if (prefs_common.mh_compat_mode)
+		mh_write_sequences(item, FALSE);
 
 	if (item->mtime == last_mtime && !need_scan) {
 		mh_set_mtime(folder, item);
diff --git a/src/prefs_common.c b/src/prefs_common.c
index 3b01fe6b0..c389f243a 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2024 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2025 the Claws Mail team and Hiroyuki Yamamoto
  *
  * 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
@@ -1324,8 +1324,10 @@ static PrefParam param[] = {
 	{"qs_press_timeout", "500", &prefs_common.qs_press_timeout, P_INT,
 	 NULL, NULL, NULL},
 
-	 {"passphrase_dialog_msg_title_switch", "FALSE", &prefs_common.passphrase_dialog_msg_title_switch,
-	  P_BOOL, NULL, NULL, NULL},
+	{"passphrase_dialog_msg_title_switch", "FALSE", &prefs_common.passphrase_dialog_msg_title_switch,
+	 P_BOOL, NULL, NULL, NULL},
+
+	{"mh_compat_mode", "FALSE", &prefs_common.mh_compat_mode, P_BOOL, NULL, NULL, NULL},
 
 	{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
diff --git a/src/prefs_common.h b/src/prefs_common.h
index 5961cac9e..3c51290c3 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -592,6 +592,7 @@ struct _PrefsCommon
 #endif
 
 	gboolean passphrase_dialog_msg_title_switch;
+	gboolean mh_compat_mode;
 
 	/* Proxy */
 	gboolean use_proxy;

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list