From 054d3fec1627a9ee8d84d636d578aa68d3494d19 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 21 Aug 2022 00:10:59 +0200 Subject: Fix encryption button update and reduce its required GTK version MenuButton.activate only exists since 4.4 --- libdino/src/plugin/registry.vala | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libdino') diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala index e28c4de7..e2801508 100644 --- a/libdino/src/plugin/registry.vala +++ b/libdino/src/plugin/registry.vala @@ -3,7 +3,7 @@ using Gee; namespace Dino.Plugins { public class Registry { - internal ArrayList encryption_list_entries = new ArrayList(); + internal HashMap encryption_list_entries = new HashMap(); internal HashMap call_encryption_entries = new HashMap(); internal ArrayList account_settings_entries = new ArrayList(); internal ArrayList contact_details_entries = new ArrayList(); @@ -17,11 +17,9 @@ public class Registry { public bool register_encryption_list_entry(EncryptionListEntry entry) { lock(encryption_list_entries) { - foreach(var e in encryption_list_entries) { - if (e.encryption == entry.encryption) return false; - } - encryption_list_entries.add(entry); - encryption_list_entries.sort((a,b) => b.name.collate(a.name)); + if (encryption_list_entries.has_key(entry.encryption)) return false; + + encryption_list_entries[entry.encryption] = entry; return true; } } -- cgit v1.2.3-70-g09d2