Config UI: Only offer the user browsers that are installed
[browser-switch] / launcher.c
index 935db63..2c4fbbe 100644 (file)
@@ -517,7 +517,7 @@ void launch_microb(struct swb_context *ctx, char *uri) {
        if (kill_browserd)
                system("kill `pidof browserd`");
 
-       if (!ctx || !ctx->continuous_mode) 
+       if (!ctx || !ctx->continuous_mode)
                exit(0);
 
        dbus_request_osso_browser_name(ctx);
@@ -590,7 +590,7 @@ static void launch_other_browser(struct swb_context *ctx, char *uri) {
                        /* Parent process or error in fork() */
                        if (urilen > 0)
                                free(quoted_uri);
-                       free(command);  
+                       free(command);
                        return;
                }
                /* Child process */
@@ -656,12 +656,13 @@ void update_default_browser(struct swb_context *ctx, char *default_browser) {
                if (!strcmp(default_browser, browser->name)) {
                        /* Make sure the user's choice is installed on the
                           system */
-                       if (browser->binary && !access(browser->binary, X_OK)) {
-                               use_launcher_as_default(ctx, browser);
-                               return;
-                       } else
+                       if (browser->binary && access(browser->binary, X_OK)) {
                                log_msg("%s appears not to be installed\n",
                                        default_browser);
+                       } else {
+                               use_launcher_as_default(ctx, browser);
+                               return;
+                       }
                }
 
        /* Deal with default_browser = "other" */