Mercurial > pidgin
changeset 18314:7a8283c1eb75
merge of '475a8ca28dabbffcdd32005dfbc33c853b1eb7de'
and 'c200e222f8c30806d0c046ea71b4f3a8a86b0f72'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 27 Jun 2007 18:33:28 +0000 |
parents | 4434e5c9d247 (current diff) cf2fbfa205b1 (diff) |
children | e659842fe66d c7d344acd1ff |
files | |
diffstat | 3 files changed, 9 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/libgnt/gntstyle.c Wed Jun 27 18:11:30 2007 +0000 +++ b/finch/libgnt/gntstyle.c Wed Jun 27 18:33:28 2007 +0000 @@ -36,7 +36,6 @@ static GKeyFile *gkfile; #endif -static GHashTable *unknowns; static char * str_styles[GNT_STYLES]; static int int_styles[GNT_STYLES]; static int bool_styles[GNT_STYLES]; @@ -46,9 +45,11 @@ return str_styles[style]; } -const char *gnt_style_get_from_name(const char *name) +const char *gnt_style_get_from_name(const char *group, const char *key) { - return g_hash_table_lookup(unknowns, name); +#if GLIB_CHECK_VERSION(2,6,0) + return g_key_file_get_value(gkfile, group, key, NULL); +#endif } gboolean gnt_style_get_bool(GntStyle style, gboolean def) @@ -293,10 +294,6 @@ str_styles[styles[i].en] = g_key_file_get_string(kfile, "general", styles[i].style, NULL); } - - for (i = 0; i < nkeys; i++) - g_hash_table_replace(unknowns, g_strdup(keys[i]), - g_strdup(g_key_file_get_string(kfile, "general", keys[i], NULL))); } g_strfreev(keys); } @@ -307,9 +304,9 @@ #if GLIB_CHECK_VERSION(2,6,0) GError *error = NULL; gkfile = g_key_file_new(); - unknowns = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - if (!g_key_file_load_from_file(gkfile, filename, G_KEY_FILE_NONE, &error)) + if (!g_key_file_load_from_file(gkfile, filename, + G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, &error)) { g_printerr("GntStyle: %s\n", error->message); g_error_free(error); @@ -337,7 +334,6 @@ for (i = 0; i < GNT_STYLES; i++) g_free(str_styles[i]); - g_hash_table_destroy(unknowns); #if GLIB_CHECK_VERSION(2,6,0) g_key_file_free(gkfile); #endif
--- a/finch/libgnt/gntstyle.h Wed Jun 27 18:11:30 2007 +0000 +++ b/finch/libgnt/gntstyle.h Wed Jun 27 18:33:28 2007 +0000 @@ -45,7 +45,7 @@ const char *gnt_style_get(GntStyle style); -const char *gnt_style_get_from_name(const char *key); +const char *gnt_style_get_from_name(const char *group, const char *key); /** *
--- a/finch/libgnt/wms/irssi.c Wed Jun 27 18:11:30 2007 +0000 +++ b/finch/libgnt/wms/irssi.c Wed Jun 27 18:33:28 2007 +0000 @@ -280,10 +280,10 @@ irssi = g_object_new(TYPE_IRSSI, NULL); *wm = GNT_WM(irssi); - style = gnt_style_get_from_name("irssi-split-v"); + style = gnt_style_get_from_name("irssi", "split-v"); irssi->vert = style ? atoi(style) : 1; - style = gnt_style_get_from_name("irssi-split-h"); + style = gnt_style_get_from_name("irssi", "split-h"); irssi->horiz = style ? atoi(style) : 1; irssi->vert = MAX(irssi->vert, 1);