From 5f43d578d3e7b0e7a7f9c647b4c744bf04768718 Mon Sep 17 00:00:00 2001 From: Loric Brevet Date: Sat, 8 Nov 2025 21:34:35 +0100 Subject: [PATCH] Persist conversation list filter switches --- data/gschemas.compiled | Bin 0 -> 976 bytes data/io.elementary.mail.gschema.xml | 11 ++++++++++- src/ConversationList/ConversationList.vala | 8 +++++--- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 data/gschemas.compiled diff --git a/data/gschemas.compiled b/data/gschemas.compiled new file mode 100644 index 0000000000000000000000000000000000000000..288e385c346fba996af1bd5afbdd4f9cdec32de8 GIT binary patch literal 976 zcmZuvO>5Oa6rHM1s}Ho41}hd?>LwAA`~i0^ETW525qCN-8GR#3=8;L8S3!{$p%syb z;D2z_jVm`wK?I?jf*VEf7l?=(6%;)u9~RMp!#O!~Gjr$Od+xH#wag09tZ8ub;qGru z@EEYYICx3s{zKLZ}_6GEFnB`Q@}A@kKB zl{yJz6q)6$usq<;y$BV=(RWL4$h>P@tcY*mpTN!F`$PKF6YwW+z5}%RP&1!tFmqDF zfy`nR(;X9T&ub0;x=CV{*SAaSF#wCd^L(yE`bdKhUrx_6 zj&(SWoJZitz}0K(Q}n54;6DRD2kh)lLZ5mP{x0|}(7utHZzTT!p1ya!GM>7s2|gU) z-qwR2ed;dGnFEJFw0NoVshQ6L_#&`<`%afVrS8DL0yaQ7Gk+FT>0|Kk;^RIr`}x!c zed-hNpMbZ3^P4+M^r@%dzXtCDxk^o;e4WZ0%KBwr7b?*fljWlReH|-*IkT9LT*ZE5 zvK4ek7TRQ0k8mCWdmh?}ZI#9Tz*x;~F=EqP?HvXk1lk_5{#@(@d(;6+oyDf~Q#sVB zzE#gfb#Aj^VKVp=YwWsOdv#{HlK)8x`2+)5^bv~{Y7_1adB`CT(M=04Dv)$Nag4+y ky4HH0OiHqz%f`oVf2GPOE#sB~S literal 0 HcmV?d00001 diff --git a/data/io.elementary.mail.gschema.xml b/data/io.elementary.mail.gschema.xml index 0453634e9..d80f94910 100644 --- a/data/io.elementary.mail.gschema.xml +++ b/data/io.elementary.mail.gschema.xml @@ -32,6 +32,16 @@ Whether to always load remote images without prompting Whether to always load remote images without prompting + + false + Whether to hide read conversations in the list + Stores the last used state of the “Hide read conversations” filter + + + false + Whether to hide unstarred conversations in the list + Stores the last used state of the “Hide unstarred conversations” filter + [] A list of sender addresses for which remote images will be automatically loaded @@ -51,4 +61,3 @@ - diff --git a/src/ConversationList/ConversationList.vala b/src/ConversationList/ConversationList.vala index 2c3159db7..8eaac42e2 100644 --- a/src/ConversationList/ConversationList.vala +++ b/src/ConversationList/ConversationList.vala @@ -88,7 +88,6 @@ public class Mail.ConversationList : Gtk.Box { }; hide_read_switch = new Granite.SwitchModelButton (_("Hide read conversations")); - hide_unstarred_switch = new Granite.SwitchModelButton (_("Hide unstarred conversations")); var filter_menu_popover_box = new Gtk.Box (VERTICAL, 0) { @@ -203,8 +202,11 @@ public class Mail.ConversationList : Gtk.Box { } }); - hide_read_switch.toggled.connect (() => load_folder.begin (folder_info_per_account)); + var settings = new GLib.Settings ("io.elementary.mail"); + settings.bind ("hide-read-conversations", hide_read_switch, "active", DEFAULT); + settings.bind ("hide-unstarred-conversations", hide_unstarred_switch, "active", DEFAULT); + hide_read_switch.toggled.connect (() => load_folder.begin (folder_info_per_account)); hide_unstarred_switch.toggled.connect (() => load_folder.begin (folder_info_per_account)); } @@ -222,7 +224,7 @@ public class Mail.ConversationList : Gtk.Box { } } - public async void load_folder (Gee.Map folder_info_per_account) { + public async void load_folder (Gee.Map folder_info_per_account) requires (folder_info_per_account != null) { lock (this.folder_info_per_account) { this.folder_info_per_account = folder_info_per_account; }