- bring in some patches from SVN to fix use with our recent webkit

This commit is contained in:
ajacoutot 2009-03-19 14:36:53 +00:00
parent 5ada9540b4
commit 6e14ea7b50
5 changed files with 159 additions and 2 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.17 2009/03/18 08:23:59 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.18 2009/03/19 14:36:53 ajacoutot Exp $
COMMENT= API documentation browser for GNOME
GNOME_PROJECT= devhelp
GNOME_VERSION= 0.22
PKGNAME= ${DISTNAME}p3
PKGNAME= ${DISTNAME}p4
SHARED_LIBS += devhelp-1 1.0 # .0.0
CATEGORIES= textproc

View File

@ -0,0 +1,37 @@
$OpenBSD: patch-src_dh-assistant-view_c,v 1.1 2009/03/19 14:36:53 ajacoutot Exp $
From upstream SVN rev 1265:
Use file: URIs instead of local paths, fixes use with more recent webkit
versions.
--- src/dh-assistant-view.c.orig Fri Nov 28 16:56:04 2008
+++ src/dh-assistant-view.c Thu Mar 19 15:28:11 2009
@@ -169,6 +169,7 @@ assistant_view_set_link (DhAssistantView *view,
gsize length;
gchar *key;
gsize key_length;
+ gsize offset = 0;
const gchar *start;
const gchar *end;
@@ -203,7 +204,10 @@ assistant_view_set_link (DhAssistantView *view,
return;
}
- file = g_mapped_file_new (filename, FALSE, NULL);
+ if (g_str_has_prefix (filename, "file://"))
+ offset = 7;
+
+ file = g_mapped_file_new (filename + offset, FALSE, NULL);
if (!file) {
g_free (filename);
return;
@@ -326,7 +330,7 @@ assistant_view_set_link (DhAssistantView *view,
* anchor links are handled internally in webkit.
*/
tmp = g_path_get_dirname (filename);
- base = g_strconcat ("file://", tmp, "/fake", NULL);
+ base = g_strconcat (tmp, "/fake", NULL);
g_free (tmp);
webkit_web_view_load_html_string (

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-src_dh-book-tree_c,v 1.1 2009/03/19 14:36:53 ajacoutot Exp $
From upstream SVN rev 1265:
Use file: URIs instead of local paths, fixes use with more recent webkit
versions.
--- src/dh-book-tree.c.orig Sat Oct 4 19:17:19 2008
+++ src/dh-book-tree.c Thu Mar 19 15:28:28 2009
@@ -245,22 +245,14 @@ book_tree_find_uri_foreach (GtkTreeModel *model,
FindURIData *data)
{
DhLink *link;
- const gchar *uri;
gchar *link_uri;
gtk_tree_model_get (model, iter,
COL_LINK, &link,
-1);
- /* A bit hackish, could be made more generic. */
- if (g_str_has_prefix (data->uri, "file://")) {
- uri = data->uri + 7;
- } else {
- uri = data->uri;
- }
-
link_uri = dh_link_get_uri (link);
- if (g_str_has_prefix (uri, link_uri)) {
+ if (g_str_has_prefix (data->uri, link_uri)) {
data->found = TRUE;
data->iter = *iter;
data->path = gtk_tree_path_copy (path);

View File

@ -0,0 +1,71 @@
$OpenBSD: patch-src_dh-link_c,v 1.1 2009/03/19 14:36:53 ajacoutot Exp $
From upstream SVN rev 1265:
Use file: URIs instead of local paths, fixes use with more recent webkit
versions.
--- src/dh-link.c.orig Fri Oct 10 23:33:20 2008
+++ src/dh-link.c Thu Mar 19 15:28:33 2009
@@ -33,7 +33,7 @@ struct _DhLink {
gchar *base;
gchar *name;
- gchar *uri;
+ gchar *filename;
DhLink *book;
DhLink *page;
@@ -64,7 +64,7 @@ link_free (DhLink *link)
g_free (link->base);
g_free (link->id);
g_free (link->name);
- g_free (link->uri);
+ g_free (link->filename);
if (link->book) {
dh_link_unref (link->book);
@@ -83,12 +83,12 @@ dh_link_new (DhLinkType type,
const gchar *name,
DhLink *book,
DhLink *page,
- const gchar *uri)
+ const gchar *filename)
{
DhLink *link;
g_return_val_if_fail (name != NULL, NULL);
- g_return_val_if_fail (uri != NULL, NULL);
+ g_return_val_if_fail (filename != NULL, NULL);
if (type == DH_LINK_TYPE_BOOK) {
g_return_val_if_fail (base != NULL, NULL);
@@ -110,7 +110,7 @@ dh_link_new (DhLinkType type,
}
link->name = g_strdup (name);
- link->uri = g_strdup (uri);
+ link->filename = g_strdup (filename);
if (book) {
link->book = dh_link_ref (book);
@@ -205,11 +205,16 @@ dh_link_get_book_id (DhLink *link)
gchar *
dh_link_get_uri (DhLink *link)
{
- if (link->type == DH_LINK_TYPE_BOOK) {
- return g_strconcat (link->base, "/", link->uri, NULL);
- }
+ gchar *base, *uri;
- return g_strconcat (link->book->base, "/", link->uri, NULL);
+ if (link->type == DH_LINK_TYPE_BOOK)
+ base = link->base;
+ else
+ base = link->book->base;
+
+ uri = g_strconcat ("file://", base, "/", link->filename, NULL, NULL);
+
+ return uri;
}
DhLinkType

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-src_dh-link_h,v 1.1 2009/03/19 14:36:53 ajacoutot Exp $
From upstream SVN rev 1265:
Use file: URIs instead of local paths, fixes use with more recent webkit
versions.
--- src/dh-link.h.orig Thu Mar 19 15:26:22 2009
+++ src/dh-link.h Thu Mar 19 15:26:39 2009
@@ -51,7 +51,7 @@ DhLink * dh_link_new (DhLinkType
const gchar *name,
DhLink *book,
DhLink *page,
- const gchar *uri);
+ const gchar *filename);
void dh_link_free (DhLink *link);
gint dh_link_compare (gconstpointer a,
gconstpointer b);