[Xfce4-commits] <midori:master> Only use internal res:// server with WebKitGTK+ < 1.1.14
Christian Dywan
noreply at xfce.org
Thu Nov 19 23:44:02 CET 2009
Updating branch refs/heads/master
to 427a482033d6c8d4911dbea02add1f1ab0174c6e (commit)
from 6658afb8858bdd92c1f19dc37edd05150079fe7b (commit)
commit 427a482033d6c8d4911dbea02add1f1ab0174c6e
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Nov 19 23:14:48 2009 +0100
Only use internal res:// server with WebKitGTK+ < 1.1.14
midori/midori-view.c | 13 +++++++++++--
midori/sokoke.c | 2 ++
midori/sokoke.h | 5 +++--
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 11cc85a..1fd8416 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -890,20 +890,22 @@ webkit_web_view_load_error_cb (WebKitWebView* web_view,
g_free (template_file);
if (g_file_get_contents (path, &template, NULL, NULL))
{
+ #if !WEBKIT_CHECK_VERSION (1, 1, 14)
SoupServer* res_server;
guint port;
+ #endif
gchar* res_root;
gchar* stock_root;
gchar* title;
gchar* message;
gchar* result;
- res_server = sokoke_get_res_server ();
- port = soup_server_get_port (res_server);
#if WEBKIT_CHECK_VERSION (1, 1, 14)
res_root = g_strdup ("res:/");
stock_root = g_strdup ("stock:/");
#else
+ res_server = sokoke_get_res_server ();
+ port = soup_server_get_port (res_server);
res_root = g_strdup_printf ("http://localhost:%d/res", port);
stock_root = g_strdup_printf ("http://localhost:%d/stock", port);
#endif
@@ -2869,8 +2871,10 @@ midori_view_set_uri (MidoriView* view,
if (view->speed_dial_in_new_tabs && !g_strcmp0 (uri, ""))
{
+ #if !WEBKIT_CHECK_VERSION (1, 1, 14)
SoupServer* res_server;
guint port;
+ #endif
gchar* res_root;
gchar* speed_dial_head;
gchar* speed_dial_body;
@@ -2884,10 +2888,15 @@ midori_view_set_uri (MidoriView* view,
if (G_UNLIKELY (!speed_dial_head))
speed_dial_head = g_strdup ("");
+ #if WEBKIT_CHECK_VERSION (1, 1, 14)
+ res_root = g_strdup ("res:/");
+ stock_root = g_strdup ("stock:/");
+ #else
res_server = sokoke_get_res_server ();
port = soup_server_get_port (res_server);
res_root = g_strdup_printf ("http://localhost:%d/res", port);
stock_root = g_strdup_printf ("http://localhost:%d/stock", port);
+ #endif
body_fname = g_build_filename (sokoke_set_config_dir (NULL),
"speeddial.json", NULL);
diff --git a/midori/sokoke.c b/midori/sokoke.c
index ce5e3b5..17993b8 100644
--- a/midori/sokoke.c
+++ b/midori/sokoke.c
@@ -1156,6 +1156,7 @@ sokoke_find_data_filename (const gchar* filename)
return g_build_filename (MDATADIR, filename, NULL);
}
+#if !WEBKIT_CHECK_VERSION (1, 1, 14)
static void
res_server_handler_cb (SoupServer* res_server,
SoupMessage* msg,
@@ -1248,6 +1249,7 @@ sokoke_get_res_server (void)
return res_server;
}
+#endif
gchar*
sokoke_replace_variables (const gchar* template,
diff --git a/midori/sokoke.h b/midori/sokoke.h
index 36a59e0..78ef12d 100644
--- a/midori/sokoke.h
+++ b/midori/sokoke.h
@@ -15,8 +15,7 @@
#include <katze/katze.h>
-#include <gtk/gtk.h>
-#include <libsoup/soup.h>
+#include <webkit/webkit.h>
#include <JavaScriptCore/JavaScript.h>
gchar*
@@ -150,8 +149,10 @@ sokoke_find_config_filename (const gchar* folder,
gchar*
sokoke_find_data_filename (const gchar* filename);
+#if !WEBKIT_CHECK_VERSION (1, 1, 14)
SoupServer*
sokoke_get_res_server (void);
+#endif
gchar*
sokoke_replace_variables (const gchar* template,
More information about the Xfce4-commits
mailing list