X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=blobdiff_plain;f=config-ui%2Fbrowser-switchboard-cp.c;h=0c768e15c8b0a3f7c88fb55f92eb569bb70f1767;hp=6866c84cb0de80fe0601e9c7bd92fc667a171eb6;hb=ae6c9c8e89fccfa6703853a6ecf1f8053a6e9c1d;hpb=ec8b58af1b1cf22f34478faf476047e7ce996245;ds=sidebyside diff --git a/config-ui/browser-switchboard-cp.c b/config-ui/browser-switchboard-cp.c index 6866c84..0c768e1 100644 --- a/config-ui/browser-switchboard-cp.c +++ b/config-ui/browser-switchboard-cp.c @@ -64,7 +64,7 @@ struct browser_entry { char *displayname; }; struct browser_entry browsers[] = { - { "microb", "MicroB" }, /* First entry is the default! */ + { "microb", "MicroB (stock browser)" }, /* First entry is the default! */ { "tear", "Tear" }, { "fennec", "Mobile Firefox (Fennec)" }, { "opera", "Opera Mobile" }, @@ -163,7 +163,9 @@ static void load_config(void) { } static void save_config(void) { - struct swb_config new_cfg = orig_cfg; + struct swb_config new_cfg; + + swb_config_copy(&new_cfg, &orig_cfg); if (get_continuous_mode() != orig_cfg.continuous_mode) { new_cfg.continuous_mode = get_continuous_mode(); @@ -173,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; }