From: Daniel Carl Date: Sun, 7 Sep 2014 18:29:47 +0000 (+0200) Subject: Don't provide uri for LoadProvisional event (#100). X-Git-Url: https://git.owens.tech/assets/me.jpg/assets/me.jpg/git?a=commitdiff_plain;h=0db6383dff9c5ceeca3c2940fb46ef74d5c12c8c;p=vimb.git Don't provide uri for LoadProvisional event (#100). --- diff --git a/src/main.c b/src/main.c index 78cc9aa..215107a 100644 --- a/src/main.c +++ b/src/main.c @@ -507,12 +507,12 @@ static void webview_download_progress_cb(WebKitWebView *view, GParamSpec *pspec) static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec) { - const char *uri = webkit_web_view_get_uri(view); + const char *uri; switch (webkit_web_view_get_load_status(view)) { case WEBKIT_LOAD_PROVISIONAL: #ifdef FEATURE_AUTOCMD - autocmd_run(NULL, AU_PAGE_LOAD_PROVISIONAL, uri); + autocmd_run(NULL, AU_PAGE_LOAD_PROVISIONAL, NULL); #endif /* update load progress in statusbar */ vb.state.progress = 0; @@ -521,6 +521,7 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec) break; case WEBKIT_LOAD_COMMITTED: + uri = webkit_web_view_get_uri(view); #ifdef FEATURE_AUTOCMD autocmd_run(NULL, AU_PAGE_LOAD_COMMITED, uri); #endif @@ -559,6 +560,7 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec) case WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT: #ifdef FEATURE_AUTOCMD + uri = webkit_web_view_get_uri(view); autocmd_run(NULL, AU_PAGE_LOAD_FIRST_LAYOUT, uri); #endif /* if we load a page from a submitted form, leave the insert mode */ @@ -568,6 +570,7 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec) break; case WEBKIT_LOAD_FINISHED: + uri = webkit_web_view_get_uri(view); #ifdef FEATURE_AUTOCMD autocmd_run(NULL, AU_PAGE_LOAD_FINISHED, uri); #endif @@ -584,6 +587,7 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec) case WEBKIT_LOAD_FAILED: #ifdef FEATURE_AUTOCMD + uri = webkit_web_view_get_uri(view); autocmd_run(NULL, AU_PAGE_LOAD_FAILED, uri); #endif break;