[devhelp/wip/swilmet/maintenance] Use webkit_navigation_policy_decision_get_navigation_action()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp/wip/swilmet/maintenance] Use webkit_navigation_policy_decision_get_navigation_action()
- Date: Sat, 16 May 2015 12:19:09 +0000 (UTC)
commit d175c190094f572118e64780f58d8747ec594c38
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat May 16 14:03:04 2015 +0200
Use webkit_navigation_policy_decision_get_navigation_action()
Because
webkit_navigation_policy_decision_get_navigation_type() and
webkit_navigation_policy_decision_get_request()
are deprecated.
The replacement is trivial, but requires WebKit2GTK+ version >= 2.6.
Anyway "webkit2gtk-3.0" was not correct, it should have been
"webkitgtk-3.0", so I guess everyone was already using webkit2gtk-4.0.
configure.ac | 12 ++----------
data/libdevhelp-3.0.pc.in | 2 +-
src/dh-assistant-view.c | 6 ++++--
3 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 6934a69..262af50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,25 +47,17 @@ GNOME_COMPILE_WARNINGS([maximum])
AC_CHECK_LIBM
AC_SUBST(LIBM)
-# Pick from supported API versions of WebKit2
-PKG_CHECK_EXISTS([webkit2gtk-4.0], [
- WEBKIT_PKGCONFIG=webkit2gtk-4.0
-], [
- WEBKIT_PKGCONFIG=webkit2gtk-3.0
-])
-AC_SUBST(WEBKIT_PKGCONFIG)
-
PKG_CHECK_MODULES(DEVHELP, [
gthread-2.0 >= 2.10.0
gtk+-3.0 >= 3.13.4
- $WEBKIT_PKGCONFIG >= 2.0.0
+ webkit2gtk-4.0 >= 2.6.0
gio-2.0 >= 2.37.3
])
PKG_CHECK_MODULES(LIBDEVHELP, [
gtk+-3.0 >= 3.12.0
gio-2.0 >= 2.37.3
- $WEBKIT_PKGCONFIG >= 2.0.0
+ webkit2gtk-4.0 >= 2.6.0
])
AC_ARG_WITH(zlib, [ --with-zlib=DIR use zlib in DIR], zlibdir=$with_zlib)
diff --git a/data/libdevhelp-3.0.pc.in b/data/libdevhelp-3.0.pc.in
index 6401ee3..615207f 100644
--- a/data/libdevhelp-3.0.pc.in
+++ b/data/libdevhelp-3.0.pc.in
@@ -5,7 +5,7 @@ includedir= includedir@
Name: devhelp
Description: devhelp
-Requires: gtk+-3.0 @WEBKIT_PKGCONFIG@
+Requires: gtk+-3.0 webkit2gtk-4.0
Version: @VERSION@
Libs: -L${libdir} -ldevhelp-3
Cflags: -I${includedir}/devhelp-3.0
diff --git a/src/dh-assistant-view.c b/src/dh-assistant-view.c
index 5abc0cb..a41e6cd 100644
--- a/src/dh-assistant-view.c
+++ b/src/dh-assistant-view.c
@@ -72,6 +72,7 @@ assistant_decide_policy (WebKitWebView *web_view,
DhAssistantViewPriv *priv;
const gchar *uri;
WebKitNavigationPolicyDecision *navigation_decision;
+ WebKitNavigationAction *navigation_action;
WebKitNavigationType navigation_type;
WebKitURIRequest *request;
@@ -83,7 +84,8 @@ assistant_decide_policy (WebKitWebView *web_view,
priv = GET_PRIVATE (web_view);
navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
- navigation_type = webkit_navigation_policy_decision_get_navigation_type (navigation_decision);
+ navigation_action = webkit_navigation_policy_decision_get_navigation_action (navigation_decision);
+ navigation_type = webkit_navigation_action_get_navigation_type (navigation_action);
if (navigation_type != WEBKIT_NAVIGATION_TYPE_LINK_CLICKED) {
if (! priv->snippet_loaded) {
priv->snippet_loaded = TRUE;
@@ -95,7 +97,7 @@ assistant_decide_policy (WebKitWebView *web_view,
return TRUE;
}
- request = webkit_navigation_policy_decision_get_request (navigation_decision);
+ request = webkit_navigation_action_get_request (navigation_action);
uri = webkit_uri_request_get_uri (request);
if (strcmp (uri, "about:blank") == 0) {
webkit_policy_decision_use (decision);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]