X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=config-ui%2Fbrowser-switchboard-cp.c;h=be9b5b1926629ba12942fe19f542381af9bd5b14;hb=refs%2Fheads%2Fmaster;hp=d4e89fd5d6f65cb50663c86c3f24fefa33efea5a;hpb=1e3c4733ddcd3c38575a700906f368bb0ead6177;p=browser-switch diff --git a/config-ui/browser-switchboard-cp.c b/config-ui/browser-switchboard-cp.c index d4e89fd..be9b5b1 100644 --- a/config-ui/browser-switchboard-cp.c +++ b/config-ui/browser-switchboard-cp.c @@ -52,6 +52,7 @@ #endif /* HILDON */ #include "config.h" +#include "save-config.h" #include "browsers.h" #define CONTINUOUS_MODE_DEFAULT 0 @@ -162,7 +163,7 @@ static void load_config(void) { static void save_config(void) { struct swb_config new_cfg; - swb_config_copy(&new_cfg, &orig_cfg); + new_cfg = orig_cfg; #ifndef FREMANTLE if (get_continuous_mode() != orig_cfg.continuous_mode) { @@ -185,15 +186,9 @@ static void save_config(void) { } swb_config_save(&new_cfg); -} - -static void do_reconfig(void) { - save_config(); - /* Try to send SIGHUP to any running browser-switchboard process - This causes it to reread config files if in continuous_mode, or - die so that the config will be reloaded on next start otherwise */ - system("kill -HUP `pidof browser-switchboard` > /dev/null 2>&1"); + /* Reconfigure a running browser-switchboard, if present */ + swb_reconfig(&orig_cfg, &new_cfg); } @@ -422,7 +417,7 @@ osso_return_t execute(osso_context_t *osso, response = gtk_dialog_run(dialog); if (response == GTK_RESPONSE_OK) - do_reconfig(); + save_config(); gtk_widget_destroy(GTK_WIDGET(dialog)); @@ -451,7 +446,7 @@ int main(int argc, char *argv[]) { response = gtk_dialog_run(dialog); if (response == GTK_RESPONSE_OK) - do_reconfig(); + save_config(); gtk_widget_destroy(GTK_WIDGET(dialog));