From 78f4ee9510a093b84551c75f9f59231c0cb62f3c82a3946741bbbae4fd35d066 Mon Sep 17 00:00:00 2001 From: Luciano Santos Date: Tue, 14 Aug 2018 14:46:36 +0000 Subject: [PATCH] Accepting request 629212 from home:mcepl - Add evolution-3.28.5-dont-expand-archive-folder.patch (bgo#795567). OBS-URL: https://build.opensuse.org/request/show/629212 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/evolution?expand=0&rev=378 --- ...on-3.28.5-dont-expand-archive-folder.patch | 162 ++++++++++++++++++ evolution.changes | 6 + evolution.spec | 4 +- 3 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 evolution-3.28.5-dont-expand-archive-folder.patch diff --git a/evolution-3.28.5-dont-expand-archive-folder.patch b/evolution-3.28.5-dont-expand-archive-folder.patch new file mode 100644 index 0000000..04ade82 --- /dev/null +++ b/evolution-3.28.5-dont-expand-archive-folder.patch @@ -0,0 +1,162 @@ +From dd4cd78c96c7e91d17f7cd9c1d7d220ac8504f3e Mon Sep 17 00:00:00 2001 +From: Milan Crha +Date: Thu, 26 Apr 2018 11:48:47 +0200 +Subject: [PATCH] Bug 795567 - Do not expand archive folder in Copy/Move + message to folder dialog + +--- + data/org.gnome.evolution.mail.gschema.xml.in | 4 + + src/mail/e-mail-reader.c | 1 + + src/mail/em-folder-selector.c | 98 ++++++++++++++++++++ + src/mail/em-folder-selector.h | 2 + + src/modules/mail/e-mail-shell-view-actions.c | 1 + + 5 files changed, 106 insertions(+) + +--- a/data/org.gnome.evolution.mail.gschema.xml.in ++++ b/data/org.gnome.evolution.mail.gschema.xml.in +@@ -728,6 +728,10 @@ + <_summary>Visually wrap long lines in composer + <_description>Whether to visually wrap long lines of text to avoid horizontal scrolling + ++ ++ false ++ <_summary>collapse archive folders in move/copy message to folder and go to folder selectors. ++ + + + +--- a/src/mail/e-mail-reader.c ++++ b/src/mail/e-mail-reader.c +@@ -363,6 +363,7 @@ mail_reader_copy_or_move_selected_messag + EMFT_EXCLUDE_VIRTUAL | + EMFT_EXCLUDE_VTRASH); + gtk_tree_view_expand_all (GTK_TREE_VIEW (folder_tree)); ++ em_folder_selector_maybe_collapse_archive_folders (selector); + + if (default_xfer_messages_uri != NULL) { + em_folder_tree_set_selected ( +--- a/src/mail/em-folder-selector.c ++++ b/src/mail/em-folder-selector.c +@@ -825,3 +825,101 @@ em_folder_selector_new_activity (EMFolde + return activity; + } + ++void ++em_folder_selector_maybe_collapse_archive_folders (EMFolderSelector *selector) ++{ ++ EMFolderTreeModel *model; ++ EMailSession *mail_session; ++ ESourceRegistry *registry; ++ CamelSession *session; ++ GSettings *settings; ++ GList *services, *link; ++ GHashTable *archives; ++ gchar *local_archive_folder; ++ ++ g_return_if_fail (EM_IS_FOLDER_SELECTOR (selector)); ++ ++ settings = e_util_ref_settings ("org.gnome.evolution.mail"); ++ if (!g_settings_get_boolean (settings, "collapse-archive-folders-in-selectors")) { ++ g_object_unref (settings); ++ return; ++ } ++ local_archive_folder = g_settings_get_string (settings, "local-archive-folder"); ++ g_object_unref (settings); ++ ++ model = em_folder_selector_get_model (selector); ++ mail_session = em_folder_tree_model_get_session (model); ++ registry = e_mail_session_get_registry (mail_session); ++ session = CAMEL_SESSION (mail_session); ++ ++ archives = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); ++ ++ if (local_archive_folder && *local_archive_folder) { ++ g_hash_table_insert (archives, local_archive_folder, NULL); ++ } else { ++ g_free (local_archive_folder); ++ } ++ ++ services = camel_session_list_services (session); ++ for (link = services; link; link = g_list_next (link)) { ++ CamelService *service = link->data; ++ ++ if (CAMEL_IS_STORE (service)) { ++ ESource *source; ++ ++ source = e_source_registry_ref_source (registry, camel_service_get_uid (service)); ++ if (source && e_source_has_extension (source, E_SOURCE_EXTENSION_MAIL_ACCOUNT)) { ++ ESourceMailAccount *account_ext; ++ gchar *archive_folder; ++ ++ account_ext = e_source_get_extension (source, E_SOURCE_EXTENSION_MAIL_ACCOUNT); ++ ++ archive_folder = e_source_mail_account_dup_archive_folder (account_ext); ++ if (archive_folder && *archive_folder) { ++ g_hash_table_insert (archives, archive_folder, NULL); ++ } else { ++ g_free (archive_folder); ++ } ++ } ++ ++ g_clear_object (&source); ++ } ++ } ++ ++ g_list_free_full (services, g_object_unref); ++ ++ if (g_hash_table_size (archives)) { ++ GtkTreeView *tree_view; ++ GHashTableIter iter; ++ gpointer key; ++ ++ tree_view = GTK_TREE_VIEW (em_folder_selector_get_folder_tree (selector)); ++ ++ g_hash_table_iter_init (&iter, archives); ++ ++ while (g_hash_table_iter_next (&iter, &key, NULL)) { ++ const gchar *folder_uri = key; ++ CamelStore *store = NULL; ++ gchar *folder_name = NULL; ++ ++ if (folder_uri && *folder_uri && ++ e_mail_folder_uri_parse (session, folder_uri, &store, &folder_name, NULL)) { ++ GtkTreeRowReference *row; ++ ++ row = em_folder_tree_model_get_row_reference (model, store, folder_name); ++ if (row) { ++ GtkTreePath *path; ++ ++ path = gtk_tree_row_reference_get_path (row); ++ gtk_tree_view_collapse_row (tree_view, path); ++ gtk_tree_path_free (path); ++ } ++ ++ g_clear_object (&store); ++ g_free (folder_name); ++ } ++ } ++ } ++ ++ g_hash_table_destroy (archives); ++} +--- a/src/mail/em-folder-selector.h ++++ b/src/mail/em-folder-selector.h +@@ -96,6 +96,8 @@ void em_folder_selector_set_selected (E + const gchar * em_folder_selector_get_selected_uri + (EMFolderSelector *selector); + EActivity * em_folder_selector_new_activity (EMFolderSelector *selector); ++void em_folder_selector_maybe_collapse_archive_folders ++ (EMFolderSelector *selector); + + G_END_DECLS + +--- a/src/modules/mail/e-mail-shell-view-actions.c ++++ b/src/modules/mail/e-mail-shell-view-actions.c +@@ -1145,6 +1145,7 @@ action_mail_goto_folder_cb (GtkAction *a + + folder_tree = em_folder_selector_get_folder_tree (selector); + gtk_tree_view_expand_all (GTK_TREE_VIEW (folder_tree)); ++ em_folder_selector_maybe_collapse_archive_folders (selector); + + if (folder) { + gchar *uri = e_mail_folder_uri_from_folder (folder); diff --git a/evolution.changes b/evolution.changes index 7d64df7..18578bb 100644 --- a/evolution.changes +++ b/evolution.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Aug 9 22:56:27 UTC 2018 - mcepl@suse.com + +- Add evolution-3.28.5-dont-expand-archive-folder.patch + (bgo#795567). + ------------------------------------------------------------------- Tue Jul 31 06:27:24 UTC 2018 - bjorn.lie@gmail.com diff --git a/evolution.spec b/evolution.spec index 7b5de18..2109fb4 100644 --- a/evolution.spec +++ b/evolution.spec @@ -33,6 +33,8 @@ License: LGPL-2.0-only AND LGPL-3.0-only Group: Productivity/Networking/Email/Clients URL: http://wiki.gnome.org/Apps/Evolution/ Source0: http://download.gnome.org/sources/evolution/%{evolution_base_version}/%{name}-%{version}.tar.xz +# PATCH-FIX-UPSTREAM evolution-3.28.5-dont-expand-archive-folder.patch mcepl@suse.cz -- Do not expand archive folder in Copy/Move message to folder dialog (bgo#795567) +Patch0: evolution-3.28.5-dont-expand-archive-folder.patch # The icon we rely on is from adwaita-icon-theme BuildRequires: adwaita-icon-theme @@ -117,7 +119,7 @@ This package provides a catalog for Glade, to allow the use of Evolution widgets in Glade. %package -n evolution-plugin-bogofilter -Summary: bogofilter plugin for the Evolution groupware suite +Summary: Bogofilter plugin for the Evolution groupware suite Group: Productivity/Networking/Email/Clients Requires: %{name} Requires: bogofilter