[pango] Read pangorc from XDG_CONFIG_HOME



commit 926aa9bca4e9b50dcf563318f8eb40a260c90f1f
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu May 10 19:54:27 2012 -0400

    Read pangorc from XDG_CONFIG_HOME
    
    Look for the rcfile in $XDG_CONFIG_HOME/pango/pangorc
    instead of ~/.pangorc.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=675400

 docs/pango-querymodules.xml |    4 ++--
 pango/pango-utils.c         |   17 ++++++-----------
 2 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/docs/pango-querymodules.xml b/docs/pango-querymodules.xml
index ee4030b..38b482c 100644
--- a/docs/pango-querymodules.xml
+++ b/docs/pango-querymodules.xml
@@ -37,8 +37,8 @@ The Pango module path is specified by the key
 <literal>Pango/ModulesPath</literal> in the Pango config database, which is
 read from
       <filename><replaceable>sysconfdir</replaceable>/pango/pangorc</filename>,
-      <filename>~/.pangorc</filename> and the file specified in the environment
-      variable <envar>PANGO_RC_FILE</envar>. 
+      <filename>~/.config/pango/pangorc</filename> and the file specified in
+      the environment variable <envar>PANGO_RC_FILE</envar>.
 </para>
 </refsect1>
 
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 8177dab..c68e2d4 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -631,7 +631,6 @@ static void
 read_config (void)
 {
   char *filename;
-  const char *home;
   const char *envvar;
 
   read_config_system ();
@@ -639,18 +638,14 @@ read_config (void)
   if (!did_read_user_config)
     {
       did_read_user_config = TRUE;
-  
-      home = g_get_home_dir ();
-      if (home && *home)
-	{
-	  filename = g_build_filename (home, ".pangorc", NULL);
-	  read_config_file (filename, FALSE);
-	  g_free (filename);
-	}
+
+      filename = g_build_filename (g_get_user_config_dir (), "pango", "pangorc", NULL);
+      read_config_file (filename, FALSE);
+      g_free (filename);
 
       envvar = g_getenv ("PANGO_RC_FILE");
       if (envvar)
-	read_config_file (envvar, TRUE);
+        read_config_file (envvar, TRUE);
     }
 }
 
@@ -680,7 +675,7 @@ pango_config_key_get_system (const char *key)
  *
  * Looks up a key in the Pango config database
  * (pseudo-win.ini style, read from $sysconfdir/pango/pangorc,
- *  ~/.pangorc, and getenv (PANGO_RC_FILE).)
+ *  $XDG_CONFIG_HOME/pango/pangorc, and getenv (PANGO_RC_FILE).)
  *
  * Return value: the value, if found, otherwise %NULL. The value is a
  * newly-allocated string and must be freed with g_free().



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