aboutsummaryrefslogtreecommitdiff
path: root/libdino/src
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-12 02:28:23 +0100
committerMarvin W <git@larma.de>2017-03-12 03:17:21 +0100
commita9ea0e9f87e71c60bc570066525d3e3634fbdcc0 (patch)
treee0db0fdd3cae07ee731de8e6ea1b112537323ebc /libdino/src
parent7e1ecb34cb1eca2b74949c7ddc2ad52fb02e3a77 (diff)
downloaddino-a9ea0e9f87e71c60bc570066525d3e3634fbdcc0.tar.gz
dino-a9ea0e9f87e71c60bc570066525d3e3634fbdcc0.zip
Split OMEMO plug-in into files, various fixes
Diffstat (limited to 'libdino/src')
-rw-r--r--libdino/src/plugin/loader.vala15
1 files changed, 4 insertions, 11 deletions
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);