Commit b52dbc57 authored by Stepan Salenikovich's avatar Stepan Salenikovich Committed by Alexandre Viau

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: default avatarAlexandre Viau <alexandre.viau@savoirfairelinux.com>
Change-Id: Ic65f60fd690d69a13f5c36b7d6e70f03b1894f28
parent 7d8548c0
......@@ -97,11 +97,8 @@ PKG_CHECK_MODULES(LIBQRENCODE libqrencode>=3.4)
PKG_CHECK_MODULES(LIBNM libnm-glib>=0.9.8.8) #optional to detect changes in the network
PKG_CHECK_MODULES(WEBKIT webkit2gtk-4.0)
IF(WEBKIT_FOUND)
SET(HAVE_WEBKIT2GTK4 1)
ELSE()
IF(NOT WEBKIT_FOUND)
PKG_CHECK_MODULES(WEBKIT REQUIRED webkit2gtk-3.0)
SET(HAVE_WEBKIT2GTK4 0)
ENDIF()
IF(USE_APPINDICATOR)
......
......@@ -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"
......
......@@ -178,7 +178,7 @@ message_index_to_json_message_object(const QModelIndex &idx)
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 @@ build_view(WebKitChatContainer *view)
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment