diff options
author | Marvin W <git@larma.de> | 2017-03-12 02:28:23 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-03-12 03:17:21 +0100 |
commit | a9ea0e9f87e71c60bc570066525d3e3634fbdcc0 (patch) | |
tree | e0db0fdd3cae07ee731de8e6ea1b112537323ebc /libdino | |
parent | 7e1ecb34cb1eca2b74949c7ddc2ad52fb02e3a77 (diff) | |
download | dino-a9ea0e9f87e71c60bc570066525d3e3634fbdcc0.tar.gz dino-a9ea0e9f87e71c60bc570066525d3e3634fbdcc0.zip |
Split OMEMO plug-in into files, various fixes
Diffstat (limited to 'libdino')
-rw-r--r-- | libdino/CMakeLists.txt | 1 | ||||
-rw-r--r-- | libdino/src/plugin/loader.vala | 15 |
2 files changed, 4 insertions, 12 deletions
diff --git a/libdino/CMakeLists.txt b/libdino/CMakeLists.txt index 10972b9a..08bf88d6 100644 --- a/libdino/CMakeLists.txt +++ b/libdino/CMakeLists.txt @@ -4,7 +4,6 @@ include(${VALA_USE_FILE}) set(LIBDINO_PACKAGES gee-0.8 - gio-2.0 glib-2.0 gtk+-3.0 gmodule-2.0 diff --git a/libdino/src/plugin/loader.vala b/libdino/src/plugin/loader.vala index 43ce0801..acb26ff4 100644 --- a/libdino/src/plugin/loader.vala +++ b/libdino/src/plugin/loader.vala @@ -1,12 +1,5 @@ namespace Dino.Plugins { -public errordomain Error { - NOT_SUPPORTED, - UNEXPECTED_TYPE, - NO_REGISTRATION_FUNCTION, - FAILED -} - private class Info : Object { public Module module; public Type gtype; @@ -26,24 +19,24 @@ public class Loader : Object { public RootInterface load(string name, Dino.Application app) throws Error { if (Module.supported () == false) { - throw new Error.NOT_SUPPORTED ("Plugins are not supported"); + throw new Error (-1, 0, "Plugins are not supported"); } Module module = Module.open ("plugins/" + name, ModuleFlags.BIND_LAZY); if (module == null) { - throw new Error.FAILED (Module.error ()); + throw new Error (-1, 1, Module.error ()); } void* function; module.symbol ("register_plugin", out function); if (function == null) { - throw new Error.NO_REGISTRATION_FUNCTION ("register_plugin () not found"); + throw new Error (-1, 2, "register_plugin () not found"); } RegisterPluginFunction register_plugin = (RegisterPluginFunction) function; Type type = register_plugin (module); if (type.is_a (typeof (RootInterface)) == false) { - throw new Error.UNEXPECTED_TYPE ("Unexpected type"); + throw new Error (-1, 3, "Unexpected type"); } Info info = new Plugins.Info (type, (owned) module); |