[latexila] Do not modify internally the XDG_DATA_DIRS env variable



commit 3493873ae4099dffa205017949e6c268876b4245
Author: SÃbastien Wilmet <swilmet gnome org>
Date:   Sat Oct 27 22:06:35 2012 +0200

    Do not modify internally the XDG_DATA_DIRS env variable
    
    If the GSettings schema directory is not a standard directory, the
    XDG_DATA_DIRS environment variable should be ajusted accordingly.
    
    It is done by jhbuild for example.

 configure.ac     |    5 -----
 src/main.vala    |   21 ---------------------
 vapi/config.vapi |    1 -
 3 files changed, 0 insertions(+), 27 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8abc605..b586379 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,11 +128,6 @@ YELP_HELP_INIT
 # GSettings
 GLIB_GSETTINGS
 
-adl_RECURSIVE_EVAL(["${datadir}"], [SCHEMA_DIR])
-AC_DEFINE_UNQUOTED([SCHEMA_DIR],
-                   ["${SCHEMA_DIR}"],
-		   [GSettings schemas directory])
-
 # Generate files
 AC_CONFIG_FILES([Makefile
 		 data/Makefile
diff --git a/src/main.vala b/src/main.vala
index 29f789e..5ef897f 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -28,26 +28,6 @@ private struct CmdLineData
     Variant? files_to_open;
 }
 
-private void check_xdg_data_dirs ()
-{
-    // GSettings looks for compiled schemas in locations specified by the XDG_DATA_DIRS
-    // environment variable.
-
-    // Environment.get_system_data_dirs() is not used because this function store the
-    // value in a cache. If we change the value of the environment variable, the cache is
-    // not modified...
-    string? data_dirs_env = Environment.get_variable ("XDG_DATA_DIRS");
-    if (data_dirs_env == null)
-        data_dirs_env = "/usr/local/share:/usr/share";
-
-    string[] data_dirs = data_dirs_env.split (":");
-    if (! (Config.SCHEMA_DIR in data_dirs))
-    {
-        Environment.set_variable ("XDG_DATA_DIRS",
-            Config.SCHEMA_DIR + ":" + data_dirs_env, true);
-    }
-}
-
 private void init_i18n ()
 {
     Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.LOCALE_DIR);
@@ -129,7 +109,6 @@ private CmdLineData parse_cmd_line_options (string[] args)
 
 int main (string[] args)
 {
-    check_xdg_data_dirs ();
     init_i18n ();
 
     CmdLineData data = parse_cmd_line_options (args);
diff --git a/vapi/config.vapi b/vapi/config.vapi
index 03895bf..6b86e0e 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -6,6 +6,5 @@ namespace Config
     public const string DATA_DIR;
     public const string LOCALE_DIR;
     public const string GETTEXT_PACKAGE;
-    public const string SCHEMA_DIR;
     public const string ICONS_DIR;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]