From: Steven Luo Date: Sun, 30 May 2010 09:17:11 +0000 (-0700) Subject: Config UI: leave other_browser_cmd unset instead of configuring an empty value X-Git-Tag: v3.3b1~1 X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=commitdiff_plain;h=cb1fde430bf96d9c60b5dcd6e754e5028545b853;hp=e384055689c962201c32e19eb0f3808419ae92c5 Config UI: leave other_browser_cmd unset instead of configuring an empty value It used to be that when the user cleared the value of other_browser_cmd in the UI, the setting would be removed from the config file instead of writing an empty value. Restore this behavior. --- diff --git a/config-ui/browser-switchboard-cp.c b/config-ui/browser-switchboard-cp.c index d4fcc8d..0c768e1 100644 --- a/config-ui/browser-switchboard-cp.c +++ b/config-ui/browser-switchboard-cp.c @@ -175,10 +175,12 @@ static void save_config(void) { new_cfg.default_browser = get_default_browser(); new_cfg.flags |= SWB_CONFIG_DEFAULT_BROWSER_SET; } - if ((orig_cfg.other_browser_cmd && - strcmp(get_other_browser_cmd(), orig_cfg.other_browser_cmd)) || - (!orig_cfg.other_browser_cmd && - strlen(get_other_browser_cmd()) > 0)) { + if (strlen(get_other_browser_cmd()) == 0) { + new_cfg.other_browser_cmd = NULL; + new_cfg.flags &= ~SWB_CONFIG_OTHER_BROWSER_CMD_SET; + } else if (!(orig_cfg.other_browser_cmd && + !strcmp(get_other_browser_cmd(), + orig_cfg.other_browser_cmd))) { new_cfg.other_browser_cmd = get_other_browser_cmd(); new_cfg.flags |= SWB_CONFIG_OTHER_BROWSER_CMD_SET; }