diff options
author | Marvin W <git@larma.de> | 2017-08-29 21:47:53 +0200 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-08-29 22:08:31 +0200 |
commit | 7c2023803ebdc83393d6ea56287222a223febc3d (patch) | |
tree | 664eca9da51a87ac5903ee625a2baf90780743a6 /main | |
parent | 82a8f5c38df5abf2848084c8a6743d4d7cd40208 (diff) | |
download | dino-7c2023803ebdc83393d6ea56287222a223febc3d.tar.gz dino-7c2023803ebdc83393d6ea56287222a223febc3d.zip |
libdino: try to load all plugins found in the respective folders
Diffstat (limited to 'main')
-rw-r--r-- | main/src/main.vala | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/main/src/main.vala b/main/src/main.vala index c4c441a1..46b3affd 100644 --- a/main/src/main.vala +++ b/main/src/main.vala @@ -11,36 +11,14 @@ void main(string[] args) { try{ string? exec_path = args.length > 0 ? args[0] : null; SearchPathGenerator search_path_generator = new SearchPathGenerator(exec_path); - if (exec_path != null && exec_path.contains(Path.DIR_SEPARATOR_S)) { - string bindir = Path.get_dirname(exec_path); - if (FileUtils.test(Path.build_filename(bindir, "gschemas.compiled"), FileTest.IS_REGULAR)) { - Environment.set_variable("GSETTINGS_SCHEMA_DIR", Path.get_dirname(exec_path), false); - } - } Intl.textdomain(GETTEXT_PACKAGE); internationalize(GETTEXT_PACKAGE, search_path_generator.get_locale_path(GETTEXT_PACKAGE, LOCALE_INSTALL_DIR)); - Plugins.Loader loader = new Plugins.Loader(exec_path); Gtk.init(ref args); Dino.Ui.Application app = new Dino.Ui.Application() { search_path_generator=search_path_generator }; + Plugins.Loader loader = new Plugins.Loader(app); + loader.loadAll(); - app.add_main_option("plugin-paths", 0, 0, OptionArg.NONE, "Display plugin search paths and exit", null); - app.handle_local_options.connect((options) => { - Variant v = options.lookup_value("plugin-paths", VariantType.BOOLEAN); - if (v != null && v.get_boolean()) { - loader.print_search_paths(); - return 0; - } - return -1; - }); - - foreach (string plugin in new string[]{"omemo", "openpgp", "http-files"}) { - try { - loader.load(plugin, app); - } catch (Error e) { - print(@"Error loading plugin $plugin: $(e.message)\n"); - } - } app.run(args); loader.shutdown(); } catch (Error e) { |