diff options
author | fiaxh <git@lightrise.org> | 2022-08-21 00:10:59 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2022-08-21 14:16:31 +0200 |
commit | 054d3fec1627a9ee8d84d636d578aa68d3494d19 (patch) | |
tree | b01b7ab4be03d40ec24275de7cc31b21b76bc18b /libdino/src/plugin | |
parent | d6afa6e8ff4cfb533140d9434b83f18f627f11ca (diff) | |
download | dino-054d3fec1627a9ee8d84d636d578aa68d3494d19.tar.gz dino-054d3fec1627a9ee8d84d636d578aa68d3494d19.zip |
Fix encryption button update and reduce its required GTK version
MenuButton.activate only exists since 4.4
Diffstat (limited to 'libdino/src/plugin')
-rw-r--r-- | libdino/src/plugin/registry.vala | 10 |
1 files changed, 4 insertions, 6 deletions
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<EncryptionListEntry> encryption_list_entries = new ArrayList<EncryptionListEntry>(); + internal HashMap<Entities.Encryption, EncryptionListEntry> encryption_list_entries = new HashMap<Entities.Encryption, EncryptionListEntry>(); internal HashMap<string, CallEncryptionEntry> call_encryption_entries = new HashMap<string, CallEncryptionEntry>(); internal ArrayList<AccountSettingsEntry> account_settings_entries = new ArrayList<AccountSettingsEntry>(); internal ArrayList<ContactDetailsProvider> contact_details_entries = new ArrayList<ContactDetailsProvider>(); @@ -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; } } |