diff options
Diffstat (limited to 'libdino/src')
-rw-r--r-- | libdino/src/plugin/loader.vala | 18 | ||||
-rw-r--r-- | libdino/src/settings.vala | 2 |
2 files changed, 16 insertions, 4 deletions
diff --git a/libdino/src/plugin/loader.vala b/libdino/src/plugin/loader.vala index 42d7fa9b..8c633ef1 100644 --- a/libdino/src/plugin/loader.vala +++ b/libdino/src/plugin/loader.vala @@ -20,18 +20,30 @@ public class Loader : Object { public Loader(string? exec_str = null) { search_paths += Application.get_storage_dir(); - if (exec_str != null) { - string exec_path = exec_str; + string? exec_path = exec_str; + if (exec_path != null) { if (!exec_path.contains(Path.DIR_SEPARATOR_S)) { exec_path = Environment.find_program_in_path(exec_str); } - if (exec_path[0:5] != "/usr") { + // TODO: more robust is detection if installed + if (!exec_path.has_prefix("/usr/")) { search_paths += Path.get_dirname(exec_path); } } foreach (string dir in Environment.get_system_data_dirs()) { search_paths += Path.build_filename(dir, "dino"); } + if (exec_path != null) { + if (Path.get_basename(Path.get_dirname(exec_path)) == "bin") { + search_paths += Path.build_filename(Path.get_dirname(Path.get_dirname(exec_path)), "share", "dino"); + } + } + } + + public void print_search_paths() { + foreach (string prefix in search_paths) { + print(@"$prefix/plugins\n"); + } } public RootInterface load(string name, Dino.Application app) throws Error { diff --git a/libdino/src/settings.vala b/libdino/src/settings.vala index 17177232..3700583b 100644 --- a/libdino/src/settings.vala +++ b/libdino/src/settings.vala @@ -20,7 +20,7 @@ public class Settings { public static Settings instance() { SettingsSchemaSource sss = SettingsSchemaSource.get_default(); - SettingsSchema schema = sss.lookup("org.dino-im", false); + SettingsSchema? schema = sss.lookup("org.dino-im", true); return new Settings(new GLib.Settings.full(schema, null, null)); } } |