2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include <glib/gi18n.h>
37 #include "prefs_gtk.h"
38 #include "prefs_common.h"
41 #include "passcrypt.h"
45 #define CL(x) (((gulong) (x) >> (gulong) 8) & 0xFFUL)
46 #define RGB_FROM_GDK_COLOR(c) \
47 ((CL(c.red) << (gulong) 16) | \
48 (CL(c.green) << (gulong) 8) | \
56 static GHashTable *whole_cache = NULL;
58 static gboolean prefs_read_config_from_cache(PrefParam *param, const gchar *label,
61 void prefs_read_config(PrefParam *param, const gchar *label,
62 const gchar *rcfile, const gchar *encoding)
65 gchar buf[PREFSBUFSIZE];
68 g_return_if_fail(param != NULL);
69 g_return_if_fail(label != NULL);
70 g_return_if_fail(rcfile != NULL);
73 g_warning("Encoding is ignored\n");
75 debug_print("Reading configuration...\n");
77 prefs_set_default(param);
79 if (whole_cache != NULL) {
80 if (prefs_read_config_from_cache(param, label, rcfile) == TRUE)
84 if ((fp = g_fopen(rcfile, "rb")) == NULL) {
85 if (ENOENT != errno) FILE_OP_ERROR(rcfile, "fopen");
89 block_label = g_strdup_printf("[%s]", label);
93 /* search aiming block */
94 while (fgets_unlocked(buf, sizeof(buf), fp) != NULL) {
100 conv_str = conv_codeset_strdup
101 (buf, encoding, CS_INTERNAL);
103 conv_str = g_strdup(buf);
105 (conv_str, block_label, strlen(block_label));
108 val = strncmp(buf, block_label, strlen(block_label));
110 debug_print("Found %s\n", block_label);
116 while (fgets_unlocked(buf, sizeof(buf), fp) != NULL) {
118 /* reached next block */
119 if (buf[0] == '[') break;
120 if (buf[0] == '#') continue;
125 conv_str = conv_codeset_strdup
126 (buf, encoding, CS_INTERNAL);
128 conv_str = g_strdup(buf);
129 prefs_config_parse_one_line(param, conv_str);
132 prefs_config_parse_one_line(param, buf);
135 debug_print("Finished reading configuration.\n");
140 void prefs_config_parse_one_line(PrefParam *param, const gchar *buf)
147 for (i = 0; param[i].name != NULL; i++) {
148 name_len = strlen(param[i].name);
149 if (g_ascii_strncasecmp(buf, param[i].name, name_len))
151 if (buf[name_len] != '=')
153 value = buf + name_len + 1;
154 /* debug_print("%s = %s\n", param[i].name, value); */
156 switch (param[i].type) {
162 if (g_utf8_validate(value, -1, NULL))
163 tmp = g_strdup(value);
165 tmp = conv_codeset_strdup(value,
166 conv_get_locale_charset_str_no_utf8(),
173 g_warning("failed to convert character set.");
174 tmp = g_strdup(value);
176 g_free(*((gchar **)param[i].data));
177 *((gchar **)param[i].data) = tmp;
181 *((gint *)param[i].data) =
185 *((gboolean *)param[i].data) =
186 (*value == '0' || *value == '\0')
190 *((DummyEnum *)param[i].data) =
191 (DummyEnum)atoi(value);
194 *((gushort *)param[i].data) =
195 (gushort)atoi(value);
198 if (gdk_color_parse(value, &color))
199 *((gulong *)param[i].data) = RGB_FROM_GDK_COLOR(color);
201 /* be compatible and accept ints */
202 *((gulong *)param[i].data) = strtoul(value, 0, 10);
205 g_free(*((gchar **)param[i].data));
206 if (value[0] == '!') {
210 len = base64_decode(tmp, &value[1], strlen(value) - 1);
211 passcrypt_decrypt(tmp, len);
213 *((gchar **)param[i].data) =
214 *tmp ? g_strdup(tmp) : NULL;
216 *((gchar **)param[i].data) =
217 *value ? g_strdup(value) : NULL;
229 g_warning("failed to write configuration to file\n"); \
230 if (orig_fp) fclose(orig_fp); \
231 prefs_file_close_revert(pfile); \
233 g_free(block_label); \
237 void prefs_write_config(PrefParam *param, const gchar *label,
243 gchar buf[PREFSBUFSIZE];
244 gchar *block_label = NULL;
245 gboolean block_matched = FALSE;
247 g_return_if_fail(param != NULL);
248 g_return_if_fail(label != NULL);
249 g_return_if_fail(rcfile != NULL);
251 rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, rcfile, NULL);
252 if ((orig_fp = g_fopen(rcpath, "rb")) == NULL) {
253 if (ENOENT != errno) FILE_OP_ERROR(rcpath, "fopen");
256 if ((pfile = prefs_write_open(rcpath)) == NULL) {
257 g_warning("failed to write configuration to file\n");
258 if (orig_fp) fclose(orig_fp);
263 block_label = g_strdup_printf("[%s]", label);
265 /* search aiming block */
267 while (fgets(buf, sizeof(buf), orig_fp) != NULL) {
270 val = strncmp(buf, block_label, strlen(block_label));
272 debug_print("Found %s\n", block_label);
273 block_matched = TRUE;
276 TRY(fputs(buf, pfile->fp) != EOF);
280 TRY(fprintf(pfile->fp, "%s\n", block_label) > 0);
284 /* write all param data to file */
285 TRY(prefs_write_param(param, pfile->fp) == 0);
288 while (fgets(buf, sizeof(buf), orig_fp) != NULL) {
291 TRY(fputc('\n', pfile->fp) != EOF &&
292 fputs(buf, pfile->fp) != EOF);
296 while (fgets(buf, sizeof(buf), orig_fp) != NULL)
297 TRY(fputs(buf, pfile->fp) != EOF);
300 if (orig_fp) fclose(orig_fp);
301 if (prefs_file_close(pfile) < 0)
302 g_warning("failed to write configuration to file\n");
305 debug_print("Configuration is saved.\n");
308 gint prefs_write_param(PrefParam *param, FILE *fp)
311 gchar buf[PREFSBUFSIZE];
313 for (i = 0; param[i].name != NULL; i++) {
314 switch (param[i].type) {
319 if (*((gchar **)param[i].data)) {
320 if (g_utf8_validate(*((gchar **)param[i].data), -1, NULL))
321 tmp = g_strdup(*((gchar **)param[i].data));
323 tmp = conv_codeset_strdup(*((gchar **)param[i].data),
324 conv_get_locale_charset_str_no_utf8(),
327 tmp = g_strdup(*((gchar **)param[i].data));
331 g_snprintf(buf, sizeof(buf), "%s=%s\n", param[i].name,
338 g_snprintf(buf, sizeof(buf), "%s=%d\n", param[i].name,
339 *((gint *)param[i].data));
342 g_snprintf(buf, sizeof(buf), "%s=%d\n", param[i].name,
343 *((gboolean *)param[i].data));
346 g_snprintf(buf, sizeof(buf), "%s=%d\n", param[i].name,
347 *((DummyEnum *)param[i].data));
350 g_snprintf(buf, sizeof(buf), "%s=%d\n", param[i].name,
351 *((gushort *)param[i].data));
354 g_snprintf(buf, sizeof buf, "%s=#%6.6lx\n", param[i].name,
355 *((gulong *) param[i].data));
359 gchar *tmp = NULL, tmp2[1024] = {0};
361 tmp = *((gchar **)param[i].data);
367 passcrypt_encrypt(tmp, len);
368 base64_encode(tmp2, tmp, len);
372 g_snprintf(buf, sizeof(buf), "%s=!%s\n", param[i].name,
378 /* unrecognized, fail */
379 debug_print("Unrecognized parameter type\n");
383 if (buf[0] != '\0') {
384 if (fputs(buf, fp) == EOF) {
394 void prefs_set_default(PrefParam *param)
399 g_return_if_fail(param != NULL);
401 for (i = 0; param[i].name != NULL; i++) {
402 if (!param[i].data) continue;
404 switch (param[i].type) {
407 g_free(*((gchar **)param[i].data));
408 if (param[i].defval != NULL) {
409 if (!strncasecmp(param[i].defval, "ENV_", 4)) {
413 envstr = g_getenv(param[i].defval + 4);
414 tmp = envstr && *envstr ?
415 conv_codeset_strdup(envstr,
416 conv_get_locale_charset_str(),
420 g_warning("faild to convert character set.");
421 tmp = g_strdup(envstr);
423 *((gchar **)param[i].data) = tmp;
424 } else if (param[i].defval[0] == '~')
425 *((gchar **)param[i].data) =
426 g_strconcat(get_home_dir(),
429 else if (param[i].defval[0] != '\0')
430 *((gchar **)param[i].data) =
431 g_strdup(param[i].defval);
433 *((gchar **)param[i].data) = NULL;
435 *((gchar **)param[i].data) = NULL;
438 if (param[i].defval != NULL)
439 *((gint *)param[i].data) =
440 (gint)atoi(param[i].defval);
442 *((gint *)param[i].data) = 0;
445 if (param[i].defval != NULL) {
446 if (!g_ascii_strcasecmp(param[i].defval, "TRUE"))
447 *((gboolean *)param[i].data) = TRUE;
449 *((gboolean *)param[i].data) =
450 atoi(param[i].defval) ? TRUE : FALSE;
452 *((gboolean *)param[i].data) = FALSE;
455 if (param[i].defval != NULL)
456 *((DummyEnum*)param[i].data) =
457 (DummyEnum)atoi(param[i].defval);
459 *((DummyEnum *)param[i].data) = 0;
462 if (param[i].defval != NULL)
463 *((gushort *)param[i].data) =
464 (gushort)atoi(param[i].defval);
466 *((gushort *)param[i].data) = 0;
469 if (param[i].defval != NULL && gdk_color_parse(param[i].defval, &color))
470 *((gulong *)param[i].data) =
471 RGB_FROM_GDK_COLOR(color);
472 else if (param[i].defval)
473 /* be compatible and accept ints */
474 *((gulong *)param[i].data) = strtoul(param[i].defval, 0, 10);
476 *((gulong *)param[i].data) = 0;
484 void prefs_free(PrefParam *param)
488 g_return_if_fail(param != NULL);
490 for (i = 0; param[i].name != NULL; i++) {
491 if (!param[i].data) continue;
493 switch (param[i].type) {
496 g_free(*((gchar **)param[i].data));
504 void prefs_dialog_create(PrefsDialog *dialog)
510 GtkWidget *confirm_area;
512 GtkWidget *cancel_btn;
513 GtkWidget *apply_btn;
515 g_return_if_fail(dialog != NULL);
517 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
518 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
519 gtk_window_set_position (GTK_WINDOW(window), GTK_WIN_POS_CENTER);
520 gtk_window_set_modal (GTK_WINDOW (window), TRUE);
521 gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
523 vbox = gtk_vbox_new (FALSE, 6);
524 gtk_widget_show(vbox);
525 gtk_container_add (GTK_CONTAINER (window), vbox);
527 notebook = gtk_notebook_new ();
528 gtk_widget_show(notebook);
529 gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 0);
530 gtk_container_set_border_width (GTK_CONTAINER (notebook), 2);
531 /* GTK_WIDGET_UNSET_FLAGS (notebook, GTK_CAN_FOCUS); */
532 gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
534 gtk_notebook_popup_enable (GTK_NOTEBOOK (notebook));
536 gtkut_stock_button_set_create(&confirm_area,
537 &ok_btn, GTK_STOCK_OK,
538 &cancel_btn, GTK_STOCK_CANCEL,
539 &apply_btn, GTK_STOCK_APPLY);
540 gtk_widget_show(confirm_area);
541 gtk_box_pack_end (GTK_BOX(vbox), confirm_area, FALSE, FALSE, 0);
542 gtk_widget_grab_default(ok_btn);
544 dialog->window = window;
545 dialog->notebook = notebook;
546 dialog->ok_btn = ok_btn;
547 dialog->cancel_btn = cancel_btn;
548 dialog->apply_btn = apply_btn;
551 void prefs_dialog_destroy(PrefsDialog *dialog)
553 gtk_widget_destroy(dialog->window);
554 dialog->window = NULL;
555 dialog->notebook = NULL;
556 dialog->ok_btn = NULL;
557 dialog->cancel_btn = NULL;
558 dialog->apply_btn = NULL;
561 void prefs_button_toggled(GtkToggleButton *toggle_btn, GtkWidget *widget)
565 is_active = gtk_toggle_button_get_active(toggle_btn);
566 gtk_widget_set_sensitive(widget, is_active);
569 void prefs_button_toggled_reverse(GtkToggleButton *toggle_btn, GtkWidget *widget)
573 is_active = gtk_toggle_button_get_active(toggle_btn);
574 gtk_widget_set_sensitive(widget, !is_active);
577 void prefs_set_dialog(PrefParam *param)
581 for (i = 0; param[i].name != NULL; i++) {
582 if (param[i].widget_set_func)
583 param[i].widget_set_func(¶m[i]);
587 void prefs_set_data_from_dialog(PrefParam *param)
591 for (i = 0; param[i].name != NULL; i++) {
592 if (param[i].data_set_func)
593 param[i].data_set_func(¶m[i]);
597 void prefs_set_dialog_to_default(PrefParam *param)
601 gchar *str_data = NULL;
607 for (i = 0; param[i].name != NULL; i++) {
608 if (!param[i].widget_set_func) continue;
612 switch (tmpparam.type) {
615 if (tmpparam.defval) {
616 if (!g_ascii_strncasecmp(tmpparam.defval, "ENV_", 4)) {
617 str_data = g_strdup(g_getenv(param[i].defval + 4));
618 tmpparam.data = &str_data;
620 } else if (tmpparam.defval[0] == '~') {
622 g_strconcat(get_home_dir(),
625 tmpparam.data = &str_data;
629 tmpparam.data = &tmpparam.defval;
633 int_data = atoi(tmpparam.defval);
636 tmpparam.data = &int_data;
640 ushort_data = atoi(tmpparam.defval);
643 tmpparam.data = &ushort_data;
646 if (tmpparam.defval) {
647 if (!g_ascii_strcasecmp(tmpparam.defval, "TRUE"))
650 bool_data = atoi(tmpparam.defval)
654 tmpparam.data = &bool_data;
658 enum_data = (DummyEnum)atoi(tmpparam.defval);
661 tmpparam.data = &enum_data;
667 tmpparam.widget_set_func(&tmpparam);
673 void prefs_set_data_from_entry(PrefParam *pparam)
676 const gchar *entry_str;
678 g_return_if_fail(*pparam->widget != NULL);
680 entry_str = gtk_entry_get_text(GTK_ENTRY(*pparam->widget));
682 switch (pparam->type) {
685 str = (gchar **)pparam->data;
687 *str = entry_str[0] ? g_strdup(entry_str) : NULL;
690 *((gushort *)pparam->data) = atoi(entry_str);
693 *((gint *)pparam->data) = atoi(entry_str);
696 g_warning("Invalid PrefType for GtkEntry widget: %d\n",
701 void prefs_set_entry(PrefParam *pparam)
705 g_return_if_fail(*pparam->widget != NULL);
707 switch (pparam->type) {
710 str = (gchar **)pparam->data;
711 gtk_entry_set_text(GTK_ENTRY(*pparam->widget),
715 gtk_entry_set_text(GTK_ENTRY(*pparam->widget),
716 itos(*((gint *)pparam->data)));
719 gtk_entry_set_text(GTK_ENTRY(*pparam->widget),
720 itos(*((gushort *)pparam->data)));
723 g_warning("Invalid PrefType for GtkEntry widget: %d\n",
728 void prefs_set_data_from_text(PrefParam *pparam)
731 gchar *text = NULL, *tp = NULL;
734 g_return_if_fail(*pparam->widget != NULL);
736 switch (pparam->type) {
739 str = (gchar **)pparam->data;
741 if (GTK_IS_EDITABLE(*pparam->widget)) { /* need? */
742 tp = text = gtk_editable_get_chars
743 (GTK_EDITABLE(*pparam->widget), 0, -1);
744 } else if (GTK_IS_TEXT_VIEW(*pparam->widget)) {
745 GtkTextView *textview = GTK_TEXT_VIEW(*pparam->widget);
746 GtkTextBuffer *buffer = gtk_text_view_get_buffer(textview);
747 GtkTextIter start, end;
748 gtk_text_buffer_get_start_iter(buffer, &start);
749 gtk_text_buffer_get_iter_at_offset(buffer, &end, -1);
750 tp = text = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
753 g_return_if_fail (tp && text);
755 if (text[0] == '\0') {
761 Xalloca(tmpp = tmp, strlen(text) * 2 + 1,
762 { *str = NULL; break; });
772 *str = g_strdup(tmp);
776 g_warning("Invalid PrefType for GtkText widget: %d\n",
781 void prefs_set_text(PrefParam *pparam)
783 gchar *buf, *sp, *bufp;
786 GtkTextBuffer *buffer;
789 g_return_if_fail(*pparam->widget != NULL);
791 switch (pparam->type) {
794 str = (gchar **)pparam->data;
796 bufp = buf = alloca(strlen(*str) + 1);
801 if (*sp == '\\' && *(sp + 1) == 'n') {
812 text = GTK_TEXT_VIEW(*pparam->widget);
813 buffer = gtk_text_view_get_buffer(text);
814 gtk_text_buffer_set_text(buffer, "", -1);
815 gtk_text_buffer_get_start_iter(buffer, &iter);
816 gtk_text_buffer_insert(buffer, &iter, buf, -1);
819 g_warning("Invalid PrefType for GtkTextView widget: %d\n",
824 void prefs_set_data_from_toggle(PrefParam *pparam)
826 g_return_if_fail(pparam->type == P_BOOL);
827 g_return_if_fail(*pparam->widget != NULL);
829 *((gboolean *)pparam->data) =
830 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(*pparam->widget));
833 void prefs_set_toggle(PrefParam *pparam)
835 g_return_if_fail(pparam->type == P_BOOL);
836 g_return_if_fail(*pparam->widget != NULL);
838 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(*pparam->widget),
839 *((gboolean *)pparam->data));
842 void prefs_set_data_from_spinbtn(PrefParam *pparam)
844 g_return_if_fail(*pparam->widget != NULL);
846 switch (pparam->type) {
848 *((gint *)pparam->data) =
849 gtk_spin_button_get_value_as_int
850 (GTK_SPIN_BUTTON(*pparam->widget));
853 *((gushort *)pparam->data) =
854 (gushort)gtk_spin_button_get_value_as_int
855 (GTK_SPIN_BUTTON(*pparam->widget));
858 g_warning("Invalid PrefType for GtkSpinButton widget: %d\n",
863 void prefs_set_spinbtn(PrefParam *pparam)
865 g_return_if_fail(*pparam->widget != NULL);
867 switch (pparam->type) {
869 gtk_spin_button_set_value(GTK_SPIN_BUTTON(*pparam->widget),
870 (gfloat)*((gint *)pparam->data));
873 gtk_spin_button_set_value(GTK_SPIN_BUTTON(*pparam->widget),
874 (gfloat)*((gushort *)pparam->data));
877 g_warning("Invalid PrefType for GtkSpinButton widget: %d\n",
882 static GSList *prefs_pages = NULL;
884 void prefs_gtk_open(void)
886 prefswindow_open(_("Preferences"), prefs_pages, NULL,
887 &prefs_common.prefswin_width, &prefs_common.prefswin_height);
890 void prefs_gtk_register_page(PrefsPage *page)
892 prefs_pages = g_slist_append(prefs_pages, page);
895 void prefs_gtk_unregister_page(PrefsPage *page)
897 prefs_pages = g_slist_remove(prefs_pages, page);
900 static void prefs_destroy_whole_cache(gpointer to_free)
902 GHashTable *table = (GHashTable *)to_free;
903 g_hash_table_destroy(table);
906 static void prefs_destroy_file_cache(gpointer to_free)
908 GHashTable *table = (GHashTable *)to_free;
909 g_hash_table_destroy(table);
912 static int prefs_cache_sections(GHashTable *file_cache, const gchar *rcfile)
914 FILE *fp = g_fopen(rcfile, "rb");
915 gchar buf[PREFSBUFSIZE];
916 GHashTable *section_cache = NULL;
919 debug_print("cache: %s: %s", rcfile, strerror(errno));
925 while (fgets_unlocked(buf, sizeof(buf), fp) != NULL) {
930 continue; /* comment */
931 if (buf[0] == '[') { /* new section */
932 gchar *blockname = g_strdup(buf+1);
934 if (strrchr(blockname, ']'))
935 *strrchr(blockname, ']') = '\0';
936 debug_print("new section '%s'\n", blockname);
937 section_cache = g_hash_table_new_full(g_str_hash, g_str_equal,
939 g_hash_table_insert(file_cache,
940 blockname, section_cache);
942 if (!section_cache) {
943 debug_print("no table at %s\n", buf);
949 if (!strchr(buf, '=')) {
950 /* plugins do differently */
953 pref = g_strdup(buf);
955 debug_print("new pref '%s'\n", pref);
956 g_hash_table_insert(section_cache, pref, GINT_TO_POINTER(1));
965 static int prefs_cache(const gchar *rcfile)
967 GHashTable *file_cache = g_hash_table_new_full(g_str_hash, g_str_equal,
968 g_free, prefs_destroy_file_cache);
970 debug_print("new file '%s'\n", rcfile);
971 g_hash_table_insert(whole_cache, g_strdup(rcfile), file_cache);
973 return prefs_cache_sections(file_cache, rcfile);
976 void prefs_prepare_cache(void)
978 gchar *sylpheedrc = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMON_RC, NULL);
979 gchar *folderitemrc = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, FOLDERITEM_RC, NULL);
980 gchar *accountrc = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACCOUNT_RC, NULL);
982 if (whole_cache == NULL) {
983 whole_cache = g_hash_table_new_full(g_str_hash, g_str_equal,
984 g_free, prefs_destroy_whole_cache);
986 debug_print("already cached\n");
988 g_free(folderitemrc);
992 if (prefs_cache(sylpheedrc) < 0 ||
993 prefs_cache(folderitemrc) < 0 ||
994 prefs_cache(accountrc) < 0)
995 prefs_destroy_cache();
998 g_free(folderitemrc);
1002 void prefs_destroy_cache(void)
1005 debug_print("no cache\n");
1008 debug_print("destroying cache\n");
1009 g_hash_table_destroy(whole_cache);
1014 static void prefs_parse_cache(gpointer key, gpointer value, gpointer user_data)
1016 gchar *pref = (gchar *)key;
1018 PrefParam *param = (PrefParam *)user_data;
1020 prefs_config_parse_one_line(param, pref);
1023 static gboolean prefs_read_config_from_cache(PrefParam *param, const gchar *label,
1024 const gchar *rcfile)
1026 GHashTable *sections_table = NULL;
1027 GHashTable *values_table = NULL;
1028 sections_table = g_hash_table_lookup(whole_cache, rcfile);
1030 if (sections_table == NULL) {
1031 g_warning("can't find %s in the whole cache", rcfile);
1034 values_table = g_hash_table_lookup(sections_table, label);
1036 if (values_table == NULL) {
1037 debug_print("no '%s' section in '%s' cache", label, rcfile);
1040 g_hash_table_foreach(values_table, prefs_parse_cache, param);