changeset 18366:1aa08373442f

merge of '4f8ab97003711152439b821c5bfa99036761afe9' and 'faad7a14fc692e8d3799948d63c004314395738b'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 30 Jun 2007 00:55:43 +0000
parents 65ed0916d3bc (diff) 1cd1e00e059c (current diff)
children 1648cd94dddf
files
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/finch/finch.c	Fri Jun 29 21:17:17 2007 +0000
+++ b/finch/finch.c	Sat Jun 30 00:55:43 2007 +0000
@@ -381,6 +381,7 @@
 {
 	signal(SIGPIPE, SIG_IGN);
 
+	g_set_prgname("Finch");
 	g_set_application_name(_("Finch"));
 
 	/* Initialize the libpurple stuff */
--- a/finch/libgnt/gntstyle.c	Fri Jun 29 21:17:17 2007 +0000
+++ b/finch/libgnt/gntstyle.c	Sat Jun 30 00:55:43 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);