# HG changeset patch # User Sadrul Habib Chowdhury # Date 1183164804 0 # Node ID 65ed0916d3bcdd1fc36ae97148429d77974acd6a # Parent 9b5b0cbde65fe4f532406a28a206a117ac59d505 Allowing specifying different styles for different applications. diff -r 9b5b0cbde65f -r 65ed0916d3bc finch/libgnt/gntstyle.c --- a/finch/libgnt/gntstyle.c Sat Jun 30 00:35:53 2007 +0000 +++ b/finch/libgnt/gntstyle.c Sat Jun 30 00:53:24 2007 +0000 @@ -269,7 +269,8 @@ { GError *error = NULL; gsize nkeys; - char **keys = g_key_file_get_keys(kfile, "general", &nkeys, &error); + const char *prgname = g_get_prgname(); + char **keys = NULL; int i; struct { @@ -282,6 +283,14 @@ {"remember_position", GNT_STYLE_REMPOS}, {NULL, 0}}; + if (prgname && *prgname) + keys = g_key_file_get_keys(kfile, prgname, &nkeys, NULL); + + if (keys == NULL) { + prgname = "general"; + keys = g_key_file_get_keys(kfile, prgname, &nkeys, &error); + } + if (error) { g_printerr("GntStyle: %s\n", error->message); @@ -292,7 +301,7 @@ for (i = 0; styles[i].style; i++) { str_styles[styles[i].en] = - g_key_file_get_string(kfile, "general", styles[i].style, NULL); + g_key_file_get_string(kfile, prgname, styles[i].style, NULL); } } g_strfreev(keys);