aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/plugin/registry.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-11 01:25:45 +0100
committerMarvin W <git@larma.de>2017-03-11 02:04:38 +0100
commit4c48bdc07291f55d7320721a5b0a29c092f7daa0 (patch)
tree2b7debd52adbbf25ebceb2721014e5dc6c61679f /libdino/src/plugin/registry.vala
parent1ccad732b9a783d8f0140373602b7c1b84d04198 (diff)
downloaddino-4c48bdc07291f55d7320721a5b0a29c092f7daa0.tar.gz
dino-4c48bdc07291f55d7320721a5b0a29c092f7daa0.zip
Improve Plugin API (allow to move encryption into plugin)
Diffstat (limited to 'libdino/src/plugin/registry.vala')
-rw-r--r--libdino/src/plugin/registry.vala20
1 files changed, 20 insertions, 0 deletions
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
new file mode 100644
index 00000000..8c75784e
--- /dev/null
+++ b/libdino/src/plugin/registry.vala
@@ -0,0 +1,20 @@
+using Gee;
+
+namespace Dino.Plugins {
+
+public class Registry {
+ internal ArrayList<EncryptionListEntry> encryption_list_entries = new ArrayList<EncryptionListEntry>();
+
+ 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));
+ return true;
+ }
+ }
+}
+
+} \ No newline at end of file