From: Matthias Clasen Date: Thu, 10 May 2012 23:54:27 +0000 (-0400) Subject: Read pangorc from XDG_CONFIG_HOME X-Git-Tag: 1.30.1~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=926aa9bca4e9b50dcf563318f8eb40a260c90f1f;p=platform%2Fupstream%2Fpango.git 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 --- 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 Pango/ModulesPath in the Pango config database, which is read from sysconfdir/pango/pangorc, - ~/.pangorc and the file specified in the environment - variable PANGO_RC_FILE. + ~/.config/pango/pangorc and the file specified in + the environment variable PANGO_RC_FILE. 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().