From: Sébastien Marie Date: Wed, 29 Oct 2014 04:24:31 +0000 (+0100) Subject: Revert "connect `request-queued` signal conditionnally" X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=030ce3bb0d23c8e2feb6d72eef4507ca842e7eb0;p=vimb.git Revert "connect `request-queued` signal conditionnally" This reverts commit c441ec7aaf4fabc1a32a618bbab3b688d7804628. As discuted with @fanglingsu, the problem isn't an overhead introduced by `request-queued` signal. So the conditionnal connection isn"t need. --- diff --git a/src/autocmd.c b/src/autocmd.c index 7fa5798..58698e5 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -222,9 +222,6 @@ gboolean autocmd_add(char *name, gboolean delete) /* if ther was at least one command removed - rebuilt the used bits */ if (removed) { rebuild_used_bits(); - - /* update signals dependants of autocmd */ - vb_update_signals(); } return true; @@ -240,9 +237,6 @@ gboolean autocmd_add(char *name, gboolean delete) /* merge the autocmd bits into the used bits */ usedbits |= cmd->bits; - - /* update signals dependants of autocmd */ - vb_update_signals(); } return true; diff --git a/src/main.c b/src/main.c index 3eda51d..ae4009f 100644 --- a/src/main.c +++ b/src/main.c @@ -402,43 +402,6 @@ void vb_update_urlbar(const char *uri) #endif } -void vb_update_signals() -{ - /** - * search the signal handler for signal associated to vb.session - * and matching function session_request_queued_cb - */ - gulong hdl = g_signal_handler_find(vb.session, - G_SIGNAL_MATCH_FUNC, - 0, 0, NULL, session_request_queued_cb, NULL); - - if ((vb.config.contentsecuritypolicy && *vb.config.contentsecuritypolicy != '\0') -#ifdef FEATURE_AUTOCMD - || autocmd_in_use(AU_REQUEST_QUEUED) -#endif - ) { - /** - * content-security-policy OR AU_REQUEST_QUEUED are in used: - * the signal should be connected - */ - if (hdl == 0) { - /* the signal wasn't found: connect it */ - g_signal_connect(vb.session, "request-queued", G_CALLBACK(session_request_queued_cb), NULL); - - PRINT_DEBUG("request-queued connected"); - } - - } else { - /* the signal should not be here */ - if (hdl != 0) { - /* the signal was found: disconnect it */ - g_signal_handler_disconnect(vb.session, hdl); - - PRINT_DEBUG("request-queued disconnected"); - } - } -} - void vb_quit(gboolean force) { /* if not forced quit - don't quit if there are still running downloads */ @@ -999,6 +962,8 @@ static void setup_signals() NULL ); + g_signal_connect(vb.session, "request-queued", G_CALLBACK(session_request_queued_cb), NULL); + #ifdef FEATURE_NO_SCROLLBARS WebKitWebFrame *frame = webkit_web_view_get_main_frame(vb.gui.webview); g_signal_connect(G_OBJECT(frame), "scrollbars-policy-changed", G_CALLBACK(gtk_true), NULL); diff --git a/src/main.h b/src/main.h index da28d6b..ab0dbf6 100644 --- a/src/main.h +++ b/src/main.h @@ -382,7 +382,6 @@ void vb_update_statusbar(void); void vb_update_status_style(void); void vb_update_input_style(void); void vb_update_urlbar(const char *uri); -void vb_update_signals(void); void vb_register_add(char buf, const char *value); const char *vb_register_get(char buf); gboolean vb_download(WebKitWebView *view, WebKitDownload *download, const char *path); diff --git a/src/setting.c b/src/setting.c index 374e60e..ecb13a3 100644 --- a/src/setting.c +++ b/src/setting.c @@ -48,9 +48,8 @@ typedef enum { } SettingType; enum { - FLAG_LIST = (1<<1), /* setting contains a ',' separated list of values */ - FLAG_NODUP = (1<<2), /* don't allow duplicate strings within list values */ - FLAG_SIGNAL = (1<<3), /* changing the setting need call vb_update_signals() */ + FLAG_LIST = (1<<1), /* setting contains a ',' separated list of values */ + FLAG_NODUP = (1<<2), /* don't allow duplicate strings within list values */ }; extern VbCore vb; @@ -204,7 +203,7 @@ void setting_init() setting_add("history-max-items", TYPE_INTEGER, &i, internal, 0, &vb.config.history_max); setting_add("editor-command", TYPE_CHAR, &"x-terminal-emulator -e -vi '%s'", NULL, 0, NULL); setting_add("header", TYPE_CHAR, &"", headers, FLAG_LIST|FLAG_NODUP, NULL); - setting_add("content-security-policy", TYPE_CHAR, &"", internal, FLAG_SIGNAL, &vb.config.contentsecuritypolicy); + setting_add("content-security-policy", TYPE_CHAR, &"", internal, 0, &vb.config.contentsecuritypolicy); setting_add("nextpattern", TYPE_CHAR, &"/\\bnext\\b/i,/^(>\\|>>\\|»)$/,/^(>\\|>>\\|»)/,/(>\\|>>\\|»)$/,/\\bmore\\b/i", prevnext, FLAG_LIST|FLAG_NODUP, NULL); setting_add("previouspattern", TYPE_CHAR, &"/\\bprev\\|previous\\b/i,/^(<\\|<<\\|«)$/,/^(<\\|<<\\|«)/,/(<\\|<<\\|«)$/", prevnext, FLAG_LIST|FLAG_NODUP, NULL); setting_add("fullscreen", TYPE_BOOLEAN, &off, fullscreen, 0, NULL); @@ -366,11 +365,6 @@ static int setting_set_value(Setting *prop, void *value, SettingType type) break; } - /* update signals if requested */ - if (prop->flags & FLAG_SIGNAL) { - vb_update_signals(); - } - free: if (free_newvalue) { g_free(newvalue);