aboutsummaryrefslogtreecommitdiff
path: root/src/prefsparser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/prefsparser.cc')
-rw-r--r--src/prefsparser.cc31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/prefsparser.cc b/src/prefsparser.cc
index 95f98c16..bf973225 100644
--- a/src/prefsparser.cc
+++ b/src/prefsparser.cc
@@ -24,6 +24,7 @@ typedef enum {
PREFS_BOOL,
PREFS_COLOR,
PREFS_STRING,
+ PREFS_STRINGS,
PREFS_URL,
PREFS_INT32,
PREFS_DOUBLE,
@@ -81,11 +82,12 @@ int PrefsParser::parseOption(char *name, char *value)
PREFS_BOOL },
{ "middle_click_opens_new_tab", &prefs.middle_click_opens_new_tab,
PREFS_BOOL },
+ { "right_click_closes_tab", &prefs.right_click_closes_tab, PREFS_BOOL },
{ "no_proxy", &prefs.no_proxy, PREFS_STRING },
{ "panel_size", &prefs.panel_size, PREFS_PANEL_SIZE },
{ "parse_embedded_css", &prefs.parse_embedded_css, PREFS_BOOL },
{ "save_dir", &prefs.save_dir, PREFS_STRING },
- { "search_url", &prefs.search_url, PREFS_STRING },
+ { "search_url", &prefs.search_urls, PREFS_STRINGS },
{ "show_back", &prefs.show_back, PREFS_BOOL },
{ "show_bookmarks", &prefs.show_bookmarks, PREFS_BOOL },
{ "show_clear_url", &prefs.show_clear_url, PREFS_BOOL },
@@ -133,6 +135,19 @@ int PrefsParser::parseOption(char *name, char *value)
dFree(*(char **)node->pref);
*(char **)node->pref = dStrdup(value);
break;
+ case PREFS_STRINGS:
+ {
+ Dlist *lp = *(Dlist **)node->pref;
+ if (dList_length(lp) == 2 && !dList_nth_data(lp, 1)) {
+ /* override the default */
+ void *data = dList_nth_data(lp, 0);
+ dList_remove(lp, data);
+ dList_remove(lp, NULL);
+ dFree(data);
+ }
+ dList_append(lp, dStrdup(value));
+ break;
+ }
case PREFS_URL:
a_Url_free(*(DilloUrl **)node->pref);
*(DilloUrl **)node->pref = a_Url_new(value, NULL);
@@ -170,13 +185,6 @@ int PrefsParser::parseOption(char *name, char *value)
MSG_WARN("prefs: {%s} IS recognized but not handled!\n", name);
break; /* Not reached */
}
-
- if (prefs.limit_text_width) {
- /* BUG: causes 100% CPU usage with <button> or <input type="image"> */
- MSG_WARN("Disabling limit_text_width preference (currently broken).\n");
- prefs.limit_text_width = FALSE;
- }
-
return 0;
}
@@ -212,4 +220,11 @@ void PrefsParser::parse(FILE *fp)
// restore the old numeric locale
setlocale(LC_NUMERIC, oldLocale);
dFree(oldLocale);
+
+
+ if (prefs.limit_text_width) {
+ /* BUG: causes 100% CPU usage with <button> or <input type="image"> */
+ MSG_WARN("Disabling limit_text_width preference (currently broken).\n");
+ prefs.limit_text_width = FALSE;
+ }
}