Fix a broken merge
[browser-switch] / config-ui / browser-switchboard-cp.c
index 6866c84..0c768e1 100644 (file)
@@ -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;
        }