Simplify check for webkigtk API version

Instead of using our own define, we can simplify our CMakeLists by
using webkitgtk's version macro to check the API. This also makes
it more clear which webkitgtk API version we require.

Reviewed-by: Alexandre Viau <alexandre.viau@savoirfairelinux.com>
Change-Id: Ic65f60fd690d69a13f5c36b7d6e70f03b1894f28
diff --git a/src/config.h.in b/src/config.h.in
index 68130ef..463f7a0 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -7,7 +7,6 @@
 #define USE_LIBNOTIFY @USE_LIBNOTIFY@
 #define USE_APPINDICATOR @HAVE_APPINDICATOR@
 #define USE_LIBNM @USE_LIBNM@
-#define HAVE_WEBKIT2GTK4 @HAVE_WEBKIT2GTK4@
 
 #define RING_CLIENT_APP_ID "cx.ring.RingGnome"
 
diff --git a/src/webkitchatcontainer.cpp b/src/webkitchatcontainer.cpp
index cd9cf65..e3ee1a8 100644
--- a/src/webkitchatcontainer.cpp
+++ b/src/webkitchatcontainer.cpp
@@ -178,7 +178,7 @@
     return QString(QJsonDocument(message_object).toJson(QJsonDocument::Compact));
 }
 
-#if HAVE_WEBKIT2GTK4
+#if WEBKIT_CHECK_VERSION(2, 6, 0)
 static gboolean
 webview_chat_decide_policy (G_GNUC_UNUSED WebKitWebView *web_view,
                             WebKitPolicyDecision *decision,
@@ -390,7 +390,7 @@
 
     g_signal_connect(priv->webview_chat, "load-changed", G_CALLBACK(webview_chat_load_changed), view);
     g_signal_connect_swapped(priv->webview_chat, "context-menu", G_CALLBACK(webview_chat_context_menu), view);
-#if HAVE_WEBKIT2GTK4
+#if WEBKIT_CHECK_VERSION(2, 6, 0)
     g_signal_connect(priv->webview_chat, "decide-policy", G_CALLBACK(webview_chat_decide_policy), view);
 #endif