aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-12 14:42:04 +0100
committerMarvin W <git@larma.de>2017-03-12 14:42:04 +0100
commitdbbe5e39d069196aa17951b12575492cfa8c7976 (patch)
treeba48c4d0204604f689acb97e281dc47d360a6ebf /main
parente8f11178ecc1a333976ba713f532fcae11931b16 (diff)
downloaddino-dbbe5e39d069196aa17951b12575492cfa8c7976.tar.gz
dino-dbbe5e39d069196aa17951b12575492cfa8c7976.zip
Automatically compile and use gsettings schema
Diffstat (limited to 'main')
-rw-r--r--main/CMakeLists.txt2
-rw-r--r--main/src/main.vala9
2 files changed, 9 insertions, 2 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 34d26c3f..839d5c50 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -112,5 +112,5 @@ OPTIONS
set(CFLAGS ${VALA_CFLAGS} ${MAIN_CFLAGS})
add_definitions(${CFLAGS})
add_executable(dino ${MAIN_VALA_C} ${MAIN_GRESOURCES_TARGET})
-add_dependencies(dino dino-vapi)
+add_dependencies(dino dino-vapi dino-gsettings-schema-compiled)
target_link_libraries(dino libdino ${MAIN_LIBRARIES}) \ No newline at end of file
diff --git a/main/src/main.vala b/main/src/main.vala
index bec2d752..ba326ad8 100644
--- a/main/src/main.vala
+++ b/main/src/main.vala
@@ -5,7 +5,14 @@ namespace Dino {
void main(string[] args) {
try{
- Plugins.Loader loader = new Plugins.Loader(args.length > 0 ? args[0] : null);
+ string? exec_path = args.length > 0 ? args[0] : null;
+ 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);
+ }
+ }
+ Plugins.Loader loader = new Plugins.Loader(exec_path);
Gtk.init(ref args);
Dino.Ui.Application app = new Dino.Ui.Application();
foreach (string plugin in new string[]{"omemo", "openpgp"}) {