[gnome-builder] Fix running projects using GSettings
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] Fix running projects using GSettings
- Date: Tue, 6 Sep 2016 19:30:26 +0000 (UTC)
commit 6c1f8cc11e77d44f4ec63753ea0e3747406bdb37
Author: Patrick Griffis <tingping tingping se>
Date: Tue Aug 23 18:24:58 2016 -0400
Fix running projects using GSettings
libide/runtimes/ide-runtime.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libide/runtimes/ide-runtime.c b/libide/runtimes/ide-runtime.c
index 05cdfc9..19a9136 100644
--- a/libide/runtimes/ide-runtime.c
+++ b/libide/runtimes/ide-runtime.c
@@ -175,10 +175,14 @@ ide_runtime_real_create_runner (IdeRuntime *self,
{
g_autofree gchar *name = NULL;
g_autofree gchar *binpath = NULL;
+ g_autofree gchar *schemadir = NULL;
+ g_autofree gchar *parentpath = NULL;
g_autoptr(GFile) installdir = NULL;
+ g_autoptr(GFile) parentdir = NULL;
g_autoptr(GFile) bin = NULL;
IdeContext *context;
IdeRunner *runner;
+ IdeEnvironment *env;
gchar *slash;
g_assert (IDE_IS_RUNTIME (self));
@@ -205,6 +209,18 @@ ide_runtime_real_create_runner (IdeRuntime *self,
name = tmp;
}
+ /* GSettings requires an env var for non-standard dirs */
+ parentdir = g_file_get_parent (installdir);
+ if (parentdir)
+ {
+ parentpath = g_file_get_path (parentdir);
+ schemadir = g_build_filename (parentpath, "share",
+ "glib-2.0", "schemas", NULL);
+
+ env = ide_runner_get_environment (runner);
+ ide_environment_setenv (env, "GSETTINGS_SCHEMA_DIR", schemadir);
+ }
+
bin = g_file_get_child (installdir, name);
binpath = g_file_get_path (bin);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]