Merge commit 'diablo-package-3.3b1-1' into fremantle-package
[browser-switch] / config-ui / browser-switchboard-cp.c
index 6866c84..b11fd2c 100644 (file)
@@ -64,10 +64,9 @@ 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" },
        { "midori", "Midori" },
        { "other", "Other" },
        { NULL, NULL },
@@ -163,7 +162,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 +174,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;
        }