summaryrefslogtreecommitdiff
path: root/recipes/devhelp/files/devhelp-webkit.patch
blob: 5ba3f3d5a821efe1e005b3be5d0176c4d9f67f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
http://bugzilla.gnome.org/show_bug.cgi?id=586559
Comment #6 from Daniel Macks    (reporter, points: 15)
2009-07-15 17:27 UTC [reply]

Created an attachment (id=138458) [edit]
Prepend file://

Here's the patch we're using in fink. Not "complete" (only minimal change to
work, not *every* use of webkit_web_view_open()) and doesn't resolve the
inconsistent meaning of "uri", but also doesn't change anything in webkit lib
API or behavior so no interface chaos (unlike webkit:)

diff -Nurd -x'*~' devhelp-0.23.orig/src/dh-window.c devhelp-0.23/src/dh-window.c
--- devhelp-0.23.orig/src/dh-window.c	2008-11-28 10:56:04.000000000 -0500
+++ devhelp-0.23/src/dh-window.c	2009-07-08 03:36:23.000000000 -0400
@@ -133,6 +133,20 @@
 #define GET_PRIVATE(instance) G_TYPE_INSTANCE_GET_PRIVATE \
   (instance, DH_TYPE_WINDOW, DhWindowPriv);
 
+
+static void
+_webkit_web_view_open_compat (WebKitWebView *view,
+                              const gchar   *uri)
+{
+        gchar *real_uri;
+        if (g_path_is_absolute(uri))
+                real_uri = g_strdup_printf ("file://%s", uri);
+        else
+                real_uri = g_strdup (uri);
+        webkit_web_view_load_uri (view, real_uri);
+        g_free(real_uri);
+}
+
 static void
 window_activate_new_window (GtkAction *action,
                             DhWindow  *window)
@@ -803,7 +817,7 @@
                                          window);
 
         uri = dh_link_get_uri (link);
-        webkit_web_view_open (view, uri);
+        _webkit_web_view_open_compat (view, uri);
         g_free (uri);
 
         g_signal_handlers_unblock_by_func (view,
@@ -827,7 +841,7 @@
         view = window_get_active_web_view (window);
 
         uri = dh_link_get_uri (link);
-        webkit_web_view_open (view, uri);
+        _webkit_web_view_open_compat (view, uri);
         g_free (uri);
 
         window_check_history (window, view);
@@ -1093,7 +1107,7 @@
         }
 
         if (location) {
-                webkit_web_view_open (WEBKIT_WEB_VIEW (view), location);
+                _webkit_web_view_open_compat (WEBKIT_WEB_VIEW (view), location);
         } else {
                 webkit_web_view_open (WEBKIT_WEB_VIEW (view), "about:blank");
         }
@@ -1357,6 +1371,6 @@
         priv = window->priv;
 
         web_view = window_get_active_web_view (window);
-        webkit_web_view_open (web_view, uri);
+        _webkit_web_view_open_compat (web_view, uri);
         dh_book_tree_select_uri (DH_BOOK_TREE (priv->book_tree), uri);
 }