From c056a9ab28ff1235230af31be3f1f7fe20f98cbf Mon Sep 17 00:00:00 2001 From: wwp Date: Mon, 8 Apr 2024 14:49:12 +0200 Subject: [PATCH 01/16] Fix compiler warning. --- src/prefs_other.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prefs_other.c b/src/prefs_other.c index 7855d9f4f..85e1f23d2 100644 --- a/src/prefs_other.c +++ b/src/prefs_other.c @@ -624,7 +624,7 @@ static void prefs_other_save(PrefsPage *_page) gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(page->checkbtn_real_time_sync)); - prefs_keybind_preset_changed(page->keys_preset_combo); + prefs_keybind_preset_changed(GTK_COMBO_BOX(page->keys_preset_combo)); #ifndef PASSWORD_CRYPTO_OLD /* If we're disabling use of primary passphrase, we need to reencrypt -- 2.25.1 From 45209525fa55d711d3224a8f1171f46b77c47678 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 10 Apr 2024 14:06:06 +0100 Subject: [PATCH 02/16] fix bug 4796, 'URL with wide character doesn't work' --- src/common/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/utils.c b/src/common/utils.c index 8181d5f15..a9aa2cdfa 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -1372,7 +1372,7 @@ gint get_uri_len(const gchar *str) if (is_uri_string(str)) { for (p = str; *p != '\0'; p++) { - if (!g_ascii_isgraph(*p) || strchr("<>\"", *p)) + if (strchr("<>\"", *p)) break; } return p - str; -- 2.25.1 From 27694946ccf065ff2b4cd13100a2ebca4e1f8fa6 Mon Sep 17 00:00:00 2001 From: wwp Date: Wed, 10 Apr 2024 15:44:10 +0200 Subject: [PATCH 03/16] fix bug 4795, 'Please remove -no-cpp-precomp flag for Apple' --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 93a8282fa..1241adcf7 100644 --- a/configure.ac +++ b/configure.ac @@ -212,7 +212,7 @@ fi pthread_name= case "$target" in *-darwin*) - AM_CFLAGS="$AM_CFLAGS -no-cpp-precomp -fno-common" + AM_CFLAGS="$AM_CFLAGS -fno-common" ;; *-*-mingw*) # Note that we need to link to pthread in all cases. This -- 2.25.1 From 0878e5f5548012796e1276cc74daf12dd0c29906 Mon Sep 17 00:00:00 2001 From: wwp Date: Wed, 10 Apr 2024 16:05:47 +0200 Subject: [PATCH 04/16] fix bug 4773, 'remove obsolescent AC_C_CONST' --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1241adcf7..706df3042 100644 --- a/configure.ac +++ b/configure.ac @@ -421,7 +421,6 @@ AC_CHECK_HEADER([execinfo.h], [AC_DEFINE(HAVE_BACKTRACE,1,[Has backtrace*() need AC_SEARCH_LIBS(backtrace_symbols, [execinfo]) dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T -- 2.25.1 From 369f7de8bc497d5c8e42ca7901871f94948cd84a Mon Sep 17 00:00:00 2001 From: wwp Date: Wed, 10 Apr 2024 16:10:23 +0200 Subject: [PATCH 05/16] fix bug 4751, 'summaryview: remove translation hint from debug message' --- src/summaryview.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/summaryview.c b/src/summaryview.c index 1ff6578d7..27b3bec07 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -1950,8 +1950,7 @@ void summary_select_prev_unread(SummaryView *summaryview) val = !G_ALERTALTERNATE; break; default: - debug_print( - _("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n")); + debug_print("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"); } if (val != G_ALERTALTERNATE) return; if (summaryview->sort_type == SORT_ASCENDING) @@ -1999,8 +1998,7 @@ void summary_select_next_unread(SummaryView *summaryview) val = G_ALERTOTHER; break; default: - debug_print( - _("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n")); + debug_print("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"); } if (val == G_ALERTALTERNATE) @@ -2037,8 +2035,7 @@ void summary_select_prev_new(SummaryView *summaryview) val = !G_ALERTALTERNATE; break; default: - debug_print( - _("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n")); + debug_print("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"); } if (val != G_ALERTALTERNATE) return; if (summaryview->sort_type == SORT_ASCENDING) @@ -2086,8 +2083,7 @@ void summary_select_next_new(SummaryView *summaryview) val = G_ALERTOTHER; break; default: - debug_print( - _("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n")); + debug_print("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"); } if (val == G_ALERTALTERNATE) folderview_select_next_with_flag(summaryview->folderview, MSG_NEW); @@ -2155,8 +2151,7 @@ void summary_select_next_marked(SummaryView *summaryview) val = G_ALERTOTHER; break; default: - debug_print( - _("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n")); + debug_print("Internal error: unexpected value for prefs_common.next_unread_msg_dialog\n"); } if (val == G_ALERTALTERNATE) folderview_select_next_with_flag(summaryview->folderview, MSG_MARKED); -- 2.25.1 From 8866fc11593241e97786a61ce129fe0c10403ee7 Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Thu, 11 Apr 2024 11:01:35 +0200 Subject: [PATCH 06/16] Remove support for the obsolete AWN MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The Avant Window Navigator released its latest version exactly fourteen years ago. Package was removed from Debian three years later because of bugs, and seems cairo-dock was the suggested alternative by Fedora. This also removes the somewhat annoying warning: “The name com.google.code.Awn was not provided by any .service files” This partially reverts commit b2c06746b485e0f18834959f6aa2a635d78657e5 --- src/main.c | 107 ----------------------------------------------------- 1 file changed, 107 deletions(-) diff --git a/src/main.c b/src/main.c index 87c9b6549..4e4f446ef 100644 --- a/src/main.c +++ b/src/main.c @@ -156,11 +156,6 @@ static gboolean went_offline_nm; #endif - -#ifdef HAVE_DBUS_GLIB -static DBusGProxy *awn_proxy = NULL; -#endif - gchar *prog_version; #if (defined HAVE_LIBSM || defined CRASH_DIALOG) gchar *argv0; @@ -933,106 +928,6 @@ static void main_dump_features_list(gboolean show_debug_only) #endif } -#ifdef HAVE_DBUS_GLIB -static gulong dbus_item_hook_id = HOOK_NONE; -static gulong dbus_folder_hook_id = HOOK_NONE; - -static void uninstall_dbus_status_handler(void) -{ - if(awn_proxy) - g_object_unref(awn_proxy); - awn_proxy = NULL; - if (dbus_item_hook_id != HOOK_NONE) - hooks_unregister_hook(FOLDER_ITEM_UPDATE_HOOKLIST, dbus_item_hook_id); - if (dbus_folder_hook_id != HOOK_NONE) - hooks_unregister_hook(FOLDER_UPDATE_HOOKLIST, dbus_folder_hook_id); -} - -static void dbus_update(FolderItem *removed_item) -{ - guint new, unread, unreadmarked, marked, total; - guint replied, forwarded, locked, ignored, watched; - gchar *buf; - GError *error = NULL; - - folder_count_total_msgs(&new, &unread, &unreadmarked, &marked, &total, - &replied, &forwarded, &locked, &ignored, - &watched); - if (removed_item) { - total -= removed_item->total_msgs; - new -= removed_item->new_msgs; - unread -= removed_item->unread_msgs; - } - - if (new > 0) { - buf = g_strdup_printf("%d", new); - dbus_g_proxy_call(awn_proxy, "SetInfoByName", &error, - G_TYPE_STRING, "claws-mail", - G_TYPE_STRING, buf, - G_TYPE_INVALID, G_TYPE_INVALID); - g_free(buf); - - } else { - dbus_g_proxy_call(awn_proxy, "UnsetInfoByName", &error, G_TYPE_STRING, - "claws-mail", G_TYPE_INVALID, G_TYPE_INVALID); - } - if (error) { - debug_print("%s\n", error->message); - g_error_free(error); - } -} - -static gboolean dbus_status_update_folder_hook(gpointer source, gpointer data) -{ - FolderUpdateData *hookdata; - hookdata = source; - if (hookdata->update_flags & FOLDER_REMOVE_FOLDERITEM) - dbus_update(hookdata->item); - else - dbus_update(NULL); - - return FALSE; -} - -static gboolean dbus_status_update_item_hook(gpointer source, gpointer data) -{ - dbus_update(NULL); - - return FALSE; -} - -static void install_dbus_status_handler(void) -{ - GError *tmp_error = NULL; - DBusGConnection *connection = dbus_g_bus_get(DBUS_BUS_SESSION, &tmp_error); - - if(!connection) { - /* If calling code doesn't do error checking, at least print some debug */ - debug_print("Failed to open connection to session bus: %s\n", - tmp_error->message); - g_error_free(tmp_error); - return; - } - awn_proxy = dbus_g_proxy_new_for_name(connection, - "com.google.code.Awn", - "/com/google/code/Awn", - "com.google.code.Awn"); - dbus_item_hook_id = hooks_register_hook (FOLDER_ITEM_UPDATE_HOOKLIST, dbus_status_update_item_hook, NULL); - if (dbus_item_hook_id == HOOK_NONE) { - g_warning("failed to register folder item update hook"); - uninstall_dbus_status_handler(); - return; - } - - dbus_folder_hook_id = hooks_register_hook (FOLDER_UPDATE_HOOKLIST, dbus_status_update_folder_hook, NULL); - if (dbus_folder_hook_id == HOOK_NONE) { - g_warning("failed to register folder update hook"); - uninstall_dbus_status_handler(); - return; - } -} -#endif - static void reset_statistics(void) { /* (re-)initialize session statistics */ @@ -1160,7 +1055,6 @@ int main(int argc, char *argv[]) NULL,NULL); } #endif - install_dbus_status_handler(); } #endif @@ -1679,7 +1573,6 @@ int main(int argc, char *argv[]) g_object_unref(nm_proxy); #endif #ifdef HAVE_DBUS_GLIB - uninstall_dbus_status_handler(); if(connection) dbus_g_connection_unref(connection); #endif -- 2.25.1 From 507ce6782cdb711b4c41d36c884b8d2ca48cb29a Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 12 Apr 2024 16:38:43 +0200 Subject: [PATCH 07/16] Fix bug 4786 "remove type confusion in getsockopt call in sock_connect_async_cb" The function getsockopt expects a pointer to an area of memory whose length has to specified in a variable of type socklen_t. Adjust the type of optlen to be socklen_t as mandated by POSIX. Adjust the type of optval pointer to what it really is, it will be automatically converted to become a void * pointer. Signed-off-by: Olaf Hering --- src/common/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/socket.c b/src/common/socket.c index e9d50184b..a63c9a7a8 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -709,7 +709,7 @@ static gboolean sock_connect_async_cb(GIOChannel *source, SockConnectData *conn_data = (SockConnectData *)data; gint fd; gint val; - guint len; + socklen_t len; SockInfo *sockinfo; if (conn_data->io_tag == 0 && conn_data->channel == NULL) @@ -722,7 +722,7 @@ static gboolean sock_connect_async_cb(GIOChannel *source, g_io_channel_unref(source); len = sizeof(val); - if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&val, &len) < 0) { + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &val, &len) < 0) { perror("getsockopt"); close(fd); sock_connect_address_list_async(conn_data); -- 2.25.1 From 2015296f5d228f7b9264dbf57b827fec33aca14a Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 12 Apr 2024 16:42:32 +0200 Subject: [PATCH 08/16] Fix bug 4787 "Use correct function for memory transfer in crypt_cfb_buf" There are really just 8 bytes of memory to transfer from one place to another. No C strings involved. warning: 'strncpy' output truncated before terminating nul copying 8 bytes from a string of the same length [-Wstringop-truncation] Signed-off-by: Olaf Hering --- src/common/passcrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/passcrypt.c b/src/common/passcrypt.c index 73d1b5655..5236fa5a9 100644 --- a/src/common/passcrypt.c +++ b/src/common/passcrypt.c @@ -61,7 +61,7 @@ crypt_cfb_buf(const char key[8], unsigned char *buf, unsigned len, { char des_key[8]; - strncpy(des_key, PASSCRYPT_KEY, 8); + memcpy(des_key, PASSCRYPT_KEY, 8); des_setparity(des_key); if (decrypt) ecb_crypt(des_key, buf, len, DES_DECRYPT); -- 2.25.1 From b02b2726e3865c15953dbd8946d43443444ea3ef Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Fri, 12 Apr 2024 16:46:46 +0200 Subject: [PATCH 09/16] Remove unused defines and normalise header file --- src/common/uuencode.c | 3 +-- src/common/uuencode.h | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/uuencode.c b/src/common/uuencode.c index 6da83767e..52da6b73f 100644 --- a/src/common/uuencode.c +++ b/src/common/uuencode.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999,2000 Hiroyuki Yamamoto + * Copyright (C) 1999-2024 Hiroyuki Yamamoto 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 . - * */ #include "config.h" diff --git a/src/common/uuencode.h b/src/common/uuencode.h index 86b7a2321..670196c53 100644 --- a/src/common/uuencode.h +++ b/src/common/uuencode.h @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999,2000 Hiroyuki Yamamoto + * Copyright (C) 1999-2024 Hiroyuki Yamamoto 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,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ +#ifndef __UUENCODE_H__ +#define __UUENCODE_H__ + int fromuutobits(char *, const char *); -#define X_UUENCODE_END_LINE '`' -#define UUENCODE_END_LINE ' ' +#endif /* __UUENCODE_H__ */ -- 2.25.1 From 471fdc18503eb51ed0c4917ca20701e985e2953e Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Fri, 12 Apr 2024 16:49:18 +0200 Subject: [PATCH 10/16] Refactor definition and remove unused defines --- src/common/utils.h | 3 +++ src/compose.c | 3 --- src/prefs_customheader.c | 2 -- src/procmime.c | 3 --- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/common/utils.h b/src/common/utils.h index ab07def2e..e107805e3 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -54,6 +54,9 @@ #define HOST_NAME_MAX 256 #endif +/* Handling Base64 content in procmime and prefs_customheader */ +#define B64_LINE_SIZE 57 + #ifdef G_OS_WIN32 #define fsync _commit diff --git a/src/compose.c b/src/compose.c index 68b94bdf0..bf2a50a1c 100644 --- a/src/compose.c +++ b/src/compose.c @@ -188,9 +188,6 @@ typedef enum { NO_FIELD_PRESENT } MailField; -#define B64_LINE_SIZE 57 -#define B64_BUFFSIZE 77 - #define MAX_REFERENCES_LEN 999 #define COMPOSE_DRAFT_TIMEOUT_UNSET -1 diff --git a/src/prefs_customheader.c b/src/prefs_customheader.c index c264d7843..9530eec7c 100644 --- a/src/prefs_customheader.c +++ b/src/prefs_customheader.c @@ -544,8 +544,6 @@ static void prefs_custom_header_list_view_set_row(PrefsAccount *ac) } -#define B64_LINE_SIZE 57 -#define B64_BUFFSIZE 77 static void prefs_custom_header_val_from_file_cb(void) { gchar *filename = NULL; diff --git a/src/procmime.c b/src/procmime.c index 0a7cd9549..4baf65528 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -509,9 +509,6 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo) return TRUE; } -#define B64_LINE_SIZE 57 -#define B64_BUFFSIZE 77 - gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding) { FILE *infp = NULL, *outfp; -- 2.25.1 From 50a05744c402a511d5382ddfa723c1be4ca32cb2 Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Mon, 15 Apr 2024 12:35:10 +0200 Subject: [PATCH 11/16] Remove deprecated gtk_tree_view_set_rules_hint MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This call has been deprecated since version 3.14 and removal doesn't change current visual appearance. CSS support for this was removed 8 years ago, and it also seems strips in TreeViews are never going to come back¹. The only option for now seems to use ListBox² after having migrated to GTK 4… ¹ https://gitlab.gnome.org/GNOME/gtk/-/issues/581 ² https://docs.gtk.org/gtk4/class.ListBox.html Removes thirty “warning: ‘gtk_tree_view_set_rules_hint’ is deprecated” --- src/account.c | 4 +--- src/addr_compl.c | 4 +--- src/addrcustomattr.c | 4 +--- src/addrduplicates.c | 4 +--- src/addressadd.c | 1 - src/addressbook_foldersel.c | 4 +--- src/compose.c | 2 -- src/edittags.c | 4 +--- src/foldersel.c | 4 +--- src/gtk/pluginwindow.c | 3 +-- src/gtk/prefswindow.c | 5 ++--- src/gtk/progressdialog.c | 5 +---- src/mimeview.c | 4 +--- src/plugins/att_remover/att_remover.c | 3 +-- src/plugins/notification/notification_foldercheck.c | 4 +--- src/prefs_actions.c | 3 +-- src/prefs_customheader.c | 5 ++--- src/prefs_display_header.c | 8 ++------ src/prefs_filtering.c | 5 ++--- src/prefs_filtering_action.c | 5 ++--- src/prefs_folder_column.c | 5 +---- src/prefs_matcher.c | 5 ++--- src/prefs_summaries.c | 4 +--- src/prefs_summary_column.c | 7 ++----- src/prefs_summary_open.c | 8 ++------ src/prefs_template.c | 3 +-- src/prefs_toolbar.c | 4 +--- src/ssl_manager.c | 5 ++--- src/uri_opener.c | 5 ++--- 29 files changed, 37 insertions(+), 90 deletions(-) diff --git a/src/account.c b/src/account.c index 2a1645473..13cffa9ad 100644 --- a/src/account.c +++ b/src/account.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2023 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ #ifdef HAVE_CONFIG_H @@ -1576,7 +1575,6 @@ static GtkWidget *account_list_view_create(void) #ifdef GENERIC_UMPC g_object_set(list_view, "allow-checkbox-mode", FALSE, NULL); #endif - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); gtk_tree_view_set_reorderable(list_view, TRUE); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/addr_compl.c b/src/addr_compl.c index 1decafd8a..eede0ac6a 100644 --- a/src/addr_compl.c +++ b/src/addr_compl.c @@ -1,7 +1,7 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client * - * Copyright (C) 2000-2021 the Claws Mail team and Alfons Hoogervorst + * Copyright (C) 2000-2024 the Claws Mail team and Alfons Hoogervorst * * 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 @@ -15,7 +15,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ #ifdef HAVE_CONFIG_H @@ -1771,7 +1770,6 @@ static GtkWidget *addr_compl_list_view_create(CompletionWindow *window) list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)); g_object_unref(model); - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); gtk_tree_view_set_headers_visible(list_view, FALSE); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/addrcustomattr.c b/src/addrcustomattr.c index db465683d..7a4d9d513 100644 --- a/src/addrcustomattr.c +++ b/src/addrcustomattr.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2007-2022 The Claws Mail Team + * Copyright (C) 2007-2024 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 @@ -276,8 +276,6 @@ static GtkWidget *custom_attr_window_list_view_create (void) gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), CUSTOM_ATTR_NAME, GTK_SORT_ASCENDING); - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); - selector = gtk_tree_view_get_selection(list_view); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); diff --git a/src/addrduplicates.c b/src/addrduplicates.c index aaf7e0117..e2a753fda 100644 --- a/src/addrduplicates.c +++ b/src/addrduplicates.c @@ -1,5 +1,5 @@ /* Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2007-2022 Holger Berndt + * Copyright (C) 2007-2024 Holger Berndt * and the Claws Mail team * * This program is free software; you can redistribute it and/or modify @@ -436,7 +436,6 @@ static GtkWidget* create_email_view(GtkListStore *store) GtkCellRenderer *renderer; view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), prefs_common.use_stripes_everywhere); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1, @@ -456,7 +455,6 @@ static GtkWidget* create_detail_view(GtkListStore *store) GList *walk; view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), prefs_common.use_stripes_everywhere); renderer = gtk_cell_renderer_text_new(); /* col 1 */ diff --git a/src/addressadd.c b/src/addressadd.c index 34b8b8a58..ecca31e11 100644 --- a/src/addressadd.c +++ b/src/addressadd.c @@ -267,7 +267,6 @@ static void addressadd_create( void ) { tree_folder = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), ADDRADD_COL_NAME, GTK_SORT_ASCENDING); g_object_unref(store); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree_folder), prefs_common.use_stripes_everywhere); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_folder), TRUE); gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(tree_folder), FALSE); gtk_tree_view_set_search_column(GTK_TREE_VIEW(tree_folder), diff --git a/src/addressbook_foldersel.c b/src/addressbook_foldersel.c index dfea3a105..2cf3b359c 100644 --- a/src/addressbook_foldersel.c +++ b/src/addressbook_foldersel.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2001-2022 the Claws Mail team and Match Grun + * Copyright (C) 2001-2024 the Claws Mail team and Match Grun * * 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 . - * */ /* @@ -185,7 +184,6 @@ static void addressbook_foldersel_create( void ) view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), COL_NAME, GTK_SORT_ASCENDING); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), prefs_common.use_stripes_everywhere); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), TRUE); gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(view), FALSE); gtk_tree_view_set_search_column(GTK_TREE_VIEW(view), COL_NAME); diff --git a/src/compose.c b/src/compose.c index bf2a50a1c..8618b2f7c 100644 --- a/src/compose.c +++ b/src/compose.c @@ -7505,8 +7505,6 @@ static GtkWidget *compose_create_attach(Compose *compose) COL_NAME, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(attach_clist), column); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(attach_clist), - prefs_common.use_stripes_everywhere); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(attach_clist)); gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); diff --git a/src/edittags.c b/src/edittags.c index ca1d8d116..9ee64b5e1 100644 --- a/src/edittags.c +++ b/src/edittags.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2007-2022 Colin Leroy and The Claws Mail Team + * Copyright (C) 2007-2024 Colin Leroy 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 @@ -361,8 +361,6 @@ static GtkWidget *tags_window_list_view_create (void) g_object_unref(model); gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), TAG_NAME, GTK_SORT_ASCENDING); - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); - selector = gtk_tree_view_get_selection(list_view); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); diff --git a/src/foldersel.c b/src/foldersel.c index fa8905662..fab33691a 100644 --- a/src/foldersel.c +++ b/src/foldersel.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -295,8 +295,6 @@ static void foldersel_create(const gchar *title) treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(tree_store)); g_object_unref(G_OBJECT(tree_store)); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), - prefs_common.use_stripes_everywhere); gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(treeview), FALSE); gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview), FOLDERSEL_FOLDERNAME); diff --git a/src/gtk/pluginwindow.c b/src/gtk/pluginwindow.c index 413f14f12..4e6baf21a 100644 --- a/src/gtk/pluginwindow.c +++ b/src/gtk/pluginwindow.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail Team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -464,7 +464,6 @@ static GtkWidget *pluginwindow_list_view_create(PluginWindow *pluginwindow) list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)); g_object_unref(model); - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); gtk_tree_view_set_search_column (list_view, 0); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/gtk/prefswindow.c b/src/gtk/prefswindow.c index 6fb84d6aa..aca664b55 100644 --- a/src/gtk/prefswindow.c +++ b/src/gtk/prefswindow.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail Team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -624,8 +624,7 @@ static GtkWidget *prefswindow_tree_view_create(PrefsWindow *prefswindow) model = GTK_TREE_MODEL(prefswindow_create_data_store()); tree_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)); g_object_unref(model); - gtk_tree_view_set_rules_hint(tree_view, prefs_common.use_stripes_everywhere); - + selector = gtk_tree_view_get_selection(tree_view); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); gtk_tree_selection_set_select_function(selector, prefswindow_row_selected, diff --git a/src/gtk/progressdialog.c b/src/gtk/progressdialog.c index b5b638131..15b87ab45 100644 --- a/src/gtk/progressdialog.c +++ b/src/gtk/progressdialog.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2021 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ #ifdef HAVE_CONFIG_H @@ -116,8 +115,6 @@ ProgressDialog *progress_dialog_create(void) treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); g_object_unref(G_OBJECT(store)); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), - prefs_common.use_stripes_everywhere); gtk_widget_show(treeview); gtk_container_add(GTK_CONTAINER(scrolledwin), treeview); gtk_widget_set_size_request(treeview, -1, 120); diff --git a/src/mimeview.c b/src/mimeview.c index a8de83666..cb84b50fb 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2023 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -325,8 +325,6 @@ MimeView *mimeview_create(MainWindow *mainwin) ctree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); g_object_unref(model); gtk_tree_view_set_enable_search(GTK_TREE_VIEW(ctree), FALSE); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(ctree), - prefs_common.use_stripes_everywhere); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(ctree), prefs_common.show_col_headers); diff --git a/src/plugins/att_remover/att_remover.c b/src/plugins/att_remover/att_remover.c index dbfb43cbd..3ef278065 100644 --- a/src/plugins/att_remover/att_remover.c +++ b/src/plugins/att_remover/att_remover.c @@ -352,8 +352,7 @@ static void remove_attachments_dialog(AttRemover *attremover) G_TYPE_BOOLEAN, -1)); list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)); - gtk_tree_view_set_rules_hint(list_view, prefs_common_get_prefs()->use_stripes_everywhere); - + renderer = gtk_cell_renderer_toggle_new(); g_signal_connect(renderer, "toggled", G_CALLBACK(remove_toggled_cb), model); g_object_unref(model); diff --git a/src/plugins/notification/notification_foldercheck.c b/src/plugins/notification/notification_foldercheck.c index 8d6770709..5fa8d4a1e 100644 --- a/src/plugins/notification/notification_foldercheck.c +++ b/src/plugins/notification/notification_foldercheck.c @@ -1,6 +1,6 @@ /* Notification plugin for Claws Mail - * Copyright (C) 2005-2022 Holger Berndt and the Claws Mail Team + * Copyright (C) 2005-2024 Holger Berndt 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 @@ -525,8 +525,6 @@ static void foldercheck_create_window(SpecificFolderArrayEntry *entry) gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(entry->treeview), FALSE); gtk_tree_view_set_search_column(GTK_TREE_VIEW(entry->treeview), FOLDERCHECK_FOLDERNAME); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(entry->treeview), - prefs_common_get_prefs()->use_stripes_everywhere); gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(entry->treeview), FALSE); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(entry->treeview)); diff --git a/src/prefs_actions.c b/src/prefs_actions.c index eac5dcfe7..b37f6c1cb 100644 --- a/src/prefs_actions.c +++ b/src/prefs_actions.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail Team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -1201,7 +1201,6 @@ static GtkWidget *prefs_actions_list_view_create(void) g_signal_connect(G_OBJECT(list_view), "button-press-event", G_CALLBACK(prefs_actions_list_btn_pressed), list_view); - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); gtk_tree_view_set_reorderable(list_view, TRUE); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/prefs_customheader.c b/src/prefs_customheader.c index 9530eec7c..7fa50017b 100644 --- a/src/prefs_customheader.c +++ b/src/prefs_customheader.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -844,8 +844,7 @@ static GtkWidget *prefs_custom_header_list_view_create(void) model = GTK_TREE_MODEL(prefs_custom_header_create_data_store()); list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)); g_object_unref(model); - - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); + gtk_tree_view_set_reorderable(list_view, TRUE); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/prefs_display_header.c b/src/prefs_display_header.c index f6bc931c5..142269bfe 100644 --- a/src/prefs_display_header.c +++ b/src/prefs_display_header.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ #ifdef HAVE_CONFIG_H @@ -766,10 +765,7 @@ static GtkWidget *prefs_display_header_list_view_create(const gchar *name) model = GTK_TREE_MODEL(prefs_display_header_create_store()); list_view = gtk_tree_view_new_with_model(model); g_object_unref(G_OBJECT(model)); - - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(list_view), - prefs_common.use_stripes_everywhere); - + selector = gtk_tree_view_get_selection(GTK_TREE_VIEW(list_view)); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); diff --git a/src/prefs_filtering.c b/src/prefs_filtering.c index 81e0f59bb..6ada266c3 100644 --- a/src/prefs_filtering.c +++ b/src/prefs_filtering.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -1801,8 +1801,7 @@ static GtkWidget *prefs_filtering_list_view_create(void) G_CALLBACK(prefs_filtering_list_popup_menu), list_view); g_signal_connect(G_OBJECT(list_view), "button-press-event", G_CALLBACK(prefs_filtering_list_btn_pressed), list_view); - - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); + gtk_tree_view_set_reorderable(list_view, TRUE); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/prefs_filtering_action.c b/src/prefs_filtering_action.c index 7016af880..622d74854 100644 --- a/src/prefs_filtering_action.c +++ b/src/prefs_filtering_action.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2003-2022 the Claws Mail team + * Copyright (C) 2003-2024 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 @@ -1452,8 +1452,7 @@ static GtkWidget *prefs_filtering_action_list_view_create(void) model = GTK_TREE_MODEL(prefs_filtering_action_create_data_store()); list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)); g_object_unref(model); - - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); + gtk_tree_view_set_reorderable(list_view, TRUE); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/prefs_folder_column.c b/src/prefs_folder_column.c index 5ee397c86..d0633625b 100644 --- a/src/prefs_folder_column.c +++ b/src/prefs_folder_column.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -732,9 +732,6 @@ static GtkWidget *prefs_folder_column_list_view_create(const gchar *name) model = GTK_TREE_MODEL(prefs_folder_column_create_store()); list_view = gtk_tree_view_new_with_model(model); g_object_unref(G_OBJECT(model)); - - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(list_view), - prefs_common.use_stripes_everywhere); selector = gtk_tree_view_get_selection(GTK_TREE_VIEW(list_view)); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); diff --git a/src/prefs_matcher.c b/src/prefs_matcher.c index e1b05478f..1a5521c90 100644 --- a/src/prefs_matcher.c +++ b/src/prefs_matcher.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -2309,8 +2309,7 @@ static GtkWidget *prefs_matcher_list_view_create(void) model = GTK_TREE_MODEL(prefs_matcher_create_data_store()); list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)); g_object_unref(model); - - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); + gtk_tree_view_set_reorderable(list_view, TRUE); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/prefs_summaries.c b/src/prefs_summaries.c index eb75163c8..576174746 100644 --- a/src/prefs_summaries.c +++ b/src/prefs_summaries.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2005-2023 the Claws Mail Team and Colin Leroy + * Copyright (C) 2005-2024 the Claws Mail Team and Colin Leroy * * 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 @@ -257,8 +257,6 @@ static GtkWidget *date_format_create(GtkButton *button, void *data) datefmt_list_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); g_object_unref(G_OBJECT(store)); - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(datefmt_list_view), - prefs_common.use_stripes_everywhere); gtk_widget_show(datefmt_list_view); gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_list_view); diff --git a/src/prefs_summary_column.c b/src/prefs_summary_column.c index b21e4689a..aa5d75e69 100644 --- a/src/prefs_summary_column.c +++ b/src/prefs_summary_column.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -747,10 +747,7 @@ static GtkWidget *prefs_summary_column_list_view_create(const gchar *name) model = GTK_TREE_MODEL(prefs_summary_column_create_store()); list_view = gtk_tree_view_new_with_model(model); g_object_unref(G_OBJECT(model)); - - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(list_view), - prefs_common.use_stripes_everywhere); - + selector = gtk_tree_view_get_selection(GTK_TREE_VIEW(list_view)); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); diff --git a/src/prefs_summary_open.c b/src/prefs_summary_open.c index b2e95093d..1f1563e3b 100644 --- a/src/prefs_summary_open.c +++ b/src/prefs_summary_open.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 1999-2022 the Claws Mail team and Hiroyuki Yamamoto + * Copyright (C) 1999-2024 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 @@ -14,7 +14,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ #ifdef HAVE_CONFIG_H @@ -599,10 +598,7 @@ static GtkWidget *prefs_summary_open_list_view_create(const gchar *name) model = GTK_TREE_MODEL(prefs_summary_open_create_store()); list_view = gtk_tree_view_new_with_model(model); g_object_unref(G_OBJECT(model)); - - gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(list_view), - prefs_common.use_stripes_everywhere); - + selector = gtk_tree_view_get_selection(GTK_TREE_VIEW(list_view)); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); diff --git a/src/prefs_template.c b/src/prefs_template.c index b20683b37..57604ff9a 100644 --- a/src/prefs_template.c +++ b/src/prefs_template.c @@ -1199,8 +1199,7 @@ static GtkWidget *prefs_template_list_view_create(void) G_CALLBACK(prefs_template_list_popup_menu), list_view); g_signal_connect(G_OBJECT(list_view), "button-press-event", G_CALLBACK(prefs_template_list_btn_pressed), list_view); - - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); + gtk_tree_view_set_reorderable(list_view, TRUE); selector = gtk_tree_view_get_selection(list_view); diff --git a/src/prefs_toolbar.c b/src/prefs_toolbar.c index a7626c9cb..5b472d6c3 100644 --- a/src/prefs_toolbar.c +++ b/src/prefs_toolbar.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK based, lightweight, and fast e-mail client - * Copyright (C) 2002-2021 the Claws Mail team + * Copyright (C) 2002-2024 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 @@ -1376,8 +1376,6 @@ static GtkWidget *create_set_list_view(ToolbarPage *prefs_toolbar) gtk_tree_view_append_column(list_view, column); /* various other tree view attributes */ - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); - selector = gtk_tree_view_get_selection(list_view); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); gtk_tree_selection_set_select_function diff --git a/src/ssl_manager.c b/src/ssl_manager.c index b055ecb36..1fbf83d30 100644 --- a/src/ssl_manager.c +++ b/src/ssl_manager.c @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #ifdef HAVE_CONFIG_H # include "config.h" #include "claws-features.h" @@ -149,9 +150,7 @@ static GtkWidget *ssl_manager_list_view_create (void) gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), 0, GTK_SORT_ASCENDING); - g_object_unref(model); - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); - + g_object_unref(model); selector = gtk_tree_view_get_selection(list_view); gtk_tree_selection_set_mode(selector, GTK_SELECTION_BROWSE); diff --git a/src/uri_opener.c b/src/uri_opener.c index cca1ceb92..0f28f7ad9 100644 --- a/src/uri_opener.c +++ b/src/uri_opener.c @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + #ifdef HAVE_CONFIG_H # include "config.h" #include "claws-features.h" @@ -141,9 +142,7 @@ static GtkWidget *uri_opener_list_view_create(void) model = GTK_TREE_MODEL(uri_opener_create_data_store()); list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(model)); g_object_unref(model); - - gtk_tree_view_set_rules_hint(list_view, prefs_common.use_stripes_everywhere); - + selector = gtk_tree_view_get_selection(list_view); gtk_tree_selection_set_mode(selector, GTK_SELECTION_MULTIPLE); -- 2.25.1 From 88d7c29f42cd19ae015617ea2e07da05cab70593 Mon Sep 17 00:00:00 2001 From: Ricardo Mones Date: Mon, 15 Apr 2024 16:36:54 +0200 Subject: [PATCH 12/16] Remove unused includes Completes previous patch :-) --- src/gtk/progressdialog.c | 1 - src/plugins/att_remover/att_remover.c | 1 - src/plugins/notification/notification_foldercheck.c | 1 - src/prefs_customheader.c | 1 - 4 files changed, 4 deletions(-) diff --git a/src/gtk/progressdialog.c b/src/gtk/progressdialog.c index 15b87ab45..ae8f1ab0a 100644 --- a/src/gtk/progressdialog.c +++ b/src/gtk/progressdialog.c @@ -28,7 +28,6 @@ #include "progressdialog.h" #include "gtkutils.h" #include "utils.h" -#include "prefs_common.h" enum { PROGRESS_IMAGE, diff --git a/src/plugins/att_remover/att_remover.c b/src/plugins/att_remover/att_remover.c index 3ef278065..5596d9039 100644 --- a/src/plugins/att_remover/att_remover.c +++ b/src/plugins/att_remover/att_remover.c @@ -43,7 +43,6 @@ #include "menu.h" #include "claws.h" #include "plugin.h" -#include "prefs_common.h" #include "defs.h" #include "prefs_gtk.h" diff --git a/src/plugins/notification/notification_foldercheck.c b/src/plugins/notification/notification_foldercheck.c index 5fa8d4a1e..133756958 100644 --- a/src/plugins/notification/notification_foldercheck.c +++ b/src/plugins/notification/notification_foldercheck.c @@ -44,7 +44,6 @@ #include "common/prefs.h" #include "common/xml.h" #include "common/hooks.h" -#include "prefs_common.h" /* local includes */ #include "notification_foldercheck.h" diff --git a/src/prefs_customheader.c b/src/prefs_customheader.c index 7fa50017b..2c8d44b76 100644 --- a/src/prefs_customheader.c +++ b/src/prefs_customheader.c @@ -35,7 +35,6 @@ #include "main.h" #include "prefs_gtk.h" #include "prefs_customheader.h" -#include "prefs_common.h" #include "prefs_account.h" #include "mainwindow.h" #include "foldersel.h" -- 2.25.1 From 2922f9eff80a4c0c47d07f642445c2ef0112f377 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 16 Apr 2024 10:51:11 +0100 Subject: [PATCH 13/16] remove long unused TODO file --- TODO | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 TODO diff --git a/TODO b/TODO deleted file mode 100644 index fc57638f7..000000000 --- a/TODO +++ /dev/null @@ -1,7 +0,0 @@ -TODO -==== - -* Better error reporting from low-level folder ops to GUI -* Add a Developer manual (describing APIs, and howtos, for - plugins writers) -o full-text search using Namazu (?) -- 2.25.1 From 550ec19a708181e08e5fe4ae6aad5ffc3a0e2303 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 16 Apr 2024 10:54:21 +0100 Subject: [PATCH 14/16] update copyright year --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 1a683a507..4c5c5af19 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Claws Mail - a GTK lightweight and fast e-mail client --------------------------------------------------------------------- - Copyright (C) 1999-2023 The Claws Mail Team and Hiroyuki Yamamoto + Copyright (C) 1999-2024 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 -- 2.25.1 From e7e6d98b71b44c060cd0ec5f62fb8db5dd67b83a Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 22 Apr 2024 11:54:34 +0100 Subject: [PATCH 15/16] re-add Colin's attach pasted files commit, with the necessary fix original commit was 66fccde959a1b4addee971412b35d4b51d8272b1, this includes the patch from Paul Wolneykien (bug 4260) which fixes the bug(s) --- AUTHORS | 1 + src/compose.c | 248 ++++++++++++++++++++++++++++++++++------------ src/gtk/authors.h | 1 + 3 files changed, 188 insertions(+), 62 deletions(-) diff --git a/AUTHORS b/AUTHORS index d08e79b6e..8538f2dca 100644 --- a/AUTHORS +++ b/AUTHORS @@ -349,3 +349,4 @@ contributors (in addition to the above; based on Changelog) Charles Huber nycex Gianni Ceccarelli + Paul Wolneykien diff --git a/src/compose.c b/src/compose.c index 8618b2f7c..cedd1cab0 100644 --- a/src/compose.c +++ b/src/compose.c @@ -10903,60 +10903,196 @@ static void entry_copy_clipboard(GtkWidget *entry) gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)); } +static void paste_text(Compose *compose, GtkWidget *entry, + gboolean wrap, GdkAtom clip, GtkTextIter *insert_place, + const gchar *contents) +{ + GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(entry)); + GtkTextMark *mark_start = gtk_text_buffer_get_insert(buffer); + GtkTextIter start_iter, end_iter; + gint start, end; + + if (contents == NULL) + return; + + /* we shouldn't delete the selection when middle-click-pasting, or we + * can't mid-click-paste our own selection */ + if (clip != GDK_SELECTION_PRIMARY) { + undo_paste_clipboard(GTK_TEXT_VIEW(compose->text), compose->undostruct); + gtk_text_buffer_delete_selection(buffer, FALSE, TRUE); + } + + if (insert_place == NULL) { + /* if insert_place isn't specified, insert at the cursor. + * used for Ctrl-V pasting */ + gtk_text_buffer_get_iter_at_mark(buffer, &start_iter, mark_start); + start = gtk_text_iter_get_offset(&start_iter); + gtk_text_buffer_insert(buffer, &start_iter, contents, strlen(contents)); + } else { + /* if insert_place is specified, paste here. + * used for mid-click-pasting */ + start = gtk_text_iter_get_offset(insert_place); + gtk_text_buffer_insert(buffer, insert_place, contents, strlen(contents)); + if (prefs_common.primary_paste_unselects) + gtk_text_buffer_select_range(buffer, insert_place, insert_place); + } + + if (!wrap) { + /* paste unwrapped: mark the paste so it's not wrapped later */ + end = start + strlen(contents); + gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, start); + gtk_text_buffer_get_iter_at_offset(buffer, &end_iter, end); + gtk_text_buffer_apply_tag_by_name(buffer, "no_wrap", &start_iter, &end_iter); + } else if (wrap && clip == GDK_SELECTION_PRIMARY) { + /* rewrap paragraph now (after a mid-click-paste) */ + mark_start = gtk_text_buffer_get_insert(buffer); + gtk_text_buffer_get_iter_at_mark(buffer, &start_iter, mark_start); + gtk_text_iter_backward_char(&start_iter); + compose_beautify_paragraph(compose, &start_iter, TRUE); + } + compose->modified = TRUE; +} + +static void attach_uri_list(Compose *compose, GtkSelectionData *data) +{ + GList *list, *tmp; + int att = 0; + gchar *warn_files = NULL; + + list = uri_list_extract_filenames( + (const gchar *)gtk_selection_data_get_data(data)); + for (tmp = list; tmp != NULL; tmp = tmp->next) { + gchar *utf8_filename = conv_filename_to_utf8((const gchar *)tmp->data); + gchar *tmp_f = g_strdup_printf("%s%s\n", + warn_files?warn_files:"", + utf8_filename); + g_free(warn_files); + warn_files = tmp_f; + att++; + compose_attach_append + (compose, (const gchar *)tmp->data, + utf8_filename, NULL, NULL); + g_free(utf8_filename); + } + if (list) { + compose_changed_cb(NULL, compose); + alertpanel_notice(ngettext( + "The following file has been attached: \n%s", + "The following files have been attached: \n%s", att), warn_files); + g_free(warn_files); + } + list_free_strings_full(list); +} + +int attach_image(Compose *compose, GtkSelectionData *data, const gchar *subtype) +{ + FILE *fp; + const guchar *contents; + gchar *file; + gchar *type; + size_t len; + int r; + + cm_return_val_if_fail(data != NULL, -1); + + contents = gtk_selection_data_get_data(data); + len = gtk_selection_data_get_length(data); + + file = g_strconcat(get_tmp_file(), "-image.", subtype, NULL); + + debug_print("writing image to %s\n", file); + + if ((fp = claws_fopen(file, "wb")) == NULL) { + FILE_OP_ERROR(file, "claws_fopen"); + return -1; + } + + if (claws_fwrite(contents, 1, len, fp) != len) { + FILE_OP_ERROR(file, "claws_fwrite"); + claws_fclose(fp); + claws_unlink(file); + return -1; + } + + r = claws_safe_fclose(fp); + + if (r == EOF) { + FILE_OP_ERROR(file, "claws_fclose"); + claws_unlink(file); + return -1; + } + + type = g_strconcat("image/", subtype, NULL); + + compose_attach_append(compose, (const gchar *)file, + (const gchar *)file, type, NULL); + + alertpanel_notice(_("The pasted image has been attached as: \n%s"), file); + + g_free(file); + g_free(type); + + return 0; +} + static void entry_paste_clipboard(Compose *compose, GtkWidget *entry, - gboolean wrap, GdkAtom clip, GtkTextIter *insert_place) -{ - if (GTK_IS_TEXT_VIEW(entry)) { - GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(entry)); - GtkTextMark *mark_start = gtk_text_buffer_get_insert(buffer); - GtkTextIter start_iter, end_iter; - gint start, end; - gchar *contents = gtk_clipboard_wait_for_text(gtk_clipboard_get(clip)); - - if (contents == NULL) - return; + gboolean wrap, GdkAtom clip, GtkTextIter *insert_place) +{ + if (GTK_IS_TEXT_VIEW(entry)) { + GdkAtom types = gdk_atom_intern ("TARGETS", FALSE); + GdkAtom *targets = NULL; + int n_targets = 0, i; + gboolean paste_done = FALSE; + GtkClipboard *clipboard = gtk_clipboard_get(clip); + + GtkSelectionData *contents = gtk_clipboard_wait_for_contents( + clipboard, types); + + if (contents != NULL) { + gtk_selection_data_get_targets(contents, &targets, &n_targets); + gtk_selection_data_free(contents); + } + + for (i = 0; i < n_targets; i++) { + GdkAtom atom = targets[i]; + gchar *atom_type = gdk_atom_name(atom); + + if (atom_type != NULL && index(atom_type, '/')) { + GtkSelectionData *data = gtk_clipboard_wait_for_contents( + clipboard, atom); + debug_print("got contents of type %s\n", atom_type); + if (!strcmp(atom_type, "text/plain")) { + /* let the default text handler handle it */ + break; + } else if (!strcmp(atom_type, "text/uri-list")) { + attach_uri_list(compose, data); + + paste_done = TRUE; + break; + } else if (!strncmp(atom_type, "image/", strlen("image/"))) { + gchar *subtype = g_strdup((gchar *)(strstr(atom_type, "/")+1)); + debug_print("image of type %s\n", subtype); + attach_image(compose, data, subtype); + g_free(subtype); - /* we shouldn't delete the selection when middle-click-pasting, or we - * can't mid-click-paste our own selection */ - if (clip != GDK_SELECTION_PRIMARY) { - undo_paste_clipboard(GTK_TEXT_VIEW(compose->text), compose->undostruct); - gtk_text_buffer_delete_selection(buffer, FALSE, TRUE); + paste_done = TRUE; + break; + } + } } - - if (insert_place == NULL) { - /* if insert_place isn't specified, insert at the cursor. - * used for Ctrl-V pasting */ - gtk_text_buffer_get_iter_at_mark(buffer, &start_iter, mark_start); - start = gtk_text_iter_get_offset(&start_iter); - gtk_text_buffer_insert(buffer, &start_iter, contents, strlen(contents)); - } else { - /* if insert_place is specified, paste here. - * used for mid-click-pasting */ - start = gtk_text_iter_get_offset(insert_place); - gtk_text_buffer_insert(buffer, insert_place, contents, strlen(contents)); - if (prefs_common.primary_paste_unselects) - gtk_text_buffer_select_range(buffer, insert_place, insert_place); - } - - if (!wrap) { - /* paste unwrapped: mark the paste so it's not wrapped later */ - end = start + strlen(contents); - gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, start); - gtk_text_buffer_get_iter_at_offset(buffer, &end_iter, end); - gtk_text_buffer_apply_tag_by_name(buffer, "no_wrap", &start_iter, &end_iter); - } else if (wrap && clip == GDK_SELECTION_PRIMARY) { - /* rewrap paragraph now (after a mid-click-paste) */ - mark_start = gtk_text_buffer_get_insert(buffer); - gtk_text_buffer_get_iter_at_mark(buffer, &start_iter, mark_start); - gtk_text_iter_backward_char(&start_iter); - compose_beautify_paragraph(compose, &start_iter, TRUE); - } - } else if (GTK_IS_EDITABLE(entry)) + if (!paste_done) { + gchar *def_text = gtk_clipboard_wait_for_text(clipboard); + paste_text(compose, entry, wrap, clip, + insert_place, def_text); + g_free(def_text); + } + g_free(targets); + } else if (GTK_IS_EDITABLE(entry)) { gtk_editable_paste_clipboard (GTK_EDITABLE(entry)); - - compose->modified = TRUE; + compose->modified = TRUE; + } } - + static void entry_allsel(GtkWidget *entry) { if (GTK_IS_EDITABLE(entry)) @@ -11616,25 +11752,13 @@ static void compose_attach_drag_received_cb (GtkWidget *widget, gpointer user_data) { Compose *compose = (Compose *)user_data; - GList *list, *tmp; GdkAtom type; type = gtk_selection_data_get_data_type(data); if ((gdk_atom_name(type) && !strcmp(gdk_atom_name(type), "text/uri-list")) && gtk_drag_get_source_widget(context) != summary_get_main_widget(mainwindow_get_mainwindow()->summaryview)) { - list = uri_list_extract_filenames( - (const gchar *)gtk_selection_data_get_data(data)); - for (tmp = list; tmp != NULL; tmp = tmp->next) { - gchar *utf8_filename = conv_filename_to_utf8((const gchar *)tmp->data); - compose_attach_append - (compose, (const gchar *)tmp->data, - utf8_filename, NULL, NULL); - g_free(utf8_filename); - } - if (list) - compose_changed_cb(NULL, compose); - list_free_strings_full(list); + attach_uri_list(compose, data); } else if (gtk_drag_get_source_widget(context) == summary_get_main_widget(mainwindow_get_mainwindow()->summaryview)) { /* comes from our summaryview */ diff --git a/src/gtk/authors.h b/src/gtk/authors.h index 64840304d..1fcae613d 100644 --- a/src/gtk/authors.h +++ b/src/gtk/authors.h @@ -333,6 +333,7 @@ static char *CONTRIBS_LIST[] = { "Rafal Weglarz", "Florian Weimer", "Martin Wicke", +"Paul Wolneykien", "Bob Woodside", "YAMAGUCHI", "T. Yamamoto", -- 2.25.1 From 59d1aa181639275f8bd221d8e105b29b5b1fadba Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 23 Apr 2024 09:20:18 +0100 Subject: [PATCH 16/16] fix CID 1596595: Resource leaks, and CID 1596594: (CHECKED_RETURN) --- src/compose.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/compose.c b/src/compose.c index cedd1cab0..ca8530ffe 100644 --- a/src/compose.c +++ b/src/compose.c @@ -11004,13 +11004,16 @@ int attach_image(Compose *compose, GtkSelectionData *data, const gchar *subtype) if ((fp = claws_fopen(file, "wb")) == NULL) { FILE_OP_ERROR(file, "claws_fopen"); + g_free(file); return -1; } if (claws_fwrite(contents, 1, len, fp) != len) { FILE_OP_ERROR(file, "claws_fwrite"); claws_fclose(fp); - claws_unlink(file); + if (claws_unlink(file) < 0) + FILE_OP_ERROR(file, "unlink"); + g_free(file); return -1; } @@ -11018,7 +11021,9 @@ int attach_image(Compose *compose, GtkSelectionData *data, const gchar *subtype) if (r == EOF) { FILE_OP_ERROR(file, "claws_fclose"); - claws_unlink(file); + if (claws_unlink(file) < 0) + FILE_OP_ERROR(file, "unlink"); + g_free(file); return -1; } -- 2.25.1