r20531 - in /desktop/unstable/devhelp/debian: changelog patches/05_fix_anchor_loads.patch patches/series

kov at users.alioth.debian.org kov at users.alioth.debian.org
Tue Jun 30 01:07:24 UTC 2009


Author: kov
Date: Tue Jun 30 01:07:23 2009
New Revision: 20531

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=20531
Log:
Import fix from upstream to handle loading uris with anchors

Added:
    desktop/unstable/devhelp/debian/patches/05_fix_anchor_loads.patch
Modified:
    desktop/unstable/devhelp/debian/changelog
    desktop/unstable/devhelp/debian/patches/series

Modified: desktop/unstable/devhelp/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/devhelp/debian/changelog?rev=20531&op=diff
==============================================================================
--- desktop/unstable/devhelp/debian/changelog (original)
+++ desktop/unstable/devhelp/debian/changelog Tue Jun 30 01:07:23 2009
@@ -1,3 +1,11 @@
+devhelp (0.23-3) unstable; urgency=low
+
+  * debian/patches/05_fix_anchor_loads.patch:
+  - imported from upstream git repository, to fix loading files with
+    anchors on their URIs
+
+ -- Gustavo Noronha Silva <kov at debian.org>  Mon, 29 Jun 2009 21:57:16 -0300
+
 devhelp (0.23-2) unstable; urgency=low
 
   [ Emilio Pozuelo Monfort ]

Added: desktop/unstable/devhelp/debian/patches/05_fix_anchor_loads.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/devhelp/debian/patches/05_fix_anchor_loads.patch?rev=20531&op=file
==============================================================================
--- desktop/unstable/devhelp/debian/patches/05_fix_anchor_loads.patch (added)
+++ desktop/unstable/devhelp/debian/patches/05_fix_anchor_loads.patch Tue Jun 30 01:07:23 2009
@@ -1,0 +1,168 @@
+From 0019e1b75a6efaec1a632aef711902b20e78ce14 Mon Sep 17 00:00:00 2001
+From: rhult <rhult at 83ed9f51-ea25-0410-8993-a9ce22047052>
+Date: Thu, 19 Feb 2009 10:02:43 +0000
+Subject: [PATCH] =?utf-8?q?2009-02-19=20=20Enrico=20Tr=C3=B6ge=20=20<enrico.troeger at uvena.de>?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf-8
+Content-Transfer-Encoding: 8bit
+
+	* src/dh-assistant-view.c: (assistant_view_set_link):
+	* src/dh-book-tree.c: (book_tree_find_uri_foreach):
+	* src/dh-link.c: (link_free), (dh_link_new):
+	* src/dh-link.h: Use file: URIs instead of local paths, fixes use
+	with more recent webkit versions.
+
+
+git-svn-id: svn+ssh://svn.gnome.org/svn/devhelp/trunk@1265 83ed9f51-ea25-0410-8993-a9ce22047052
+---
+ ChangeLog               |    8 ++++++++
+ src/dh-assistant-view.c |    8 ++++++--
+ src/dh-book-tree.c      |   10 +---------
+ src/dh-link.c           |   23 ++++++++++++++---------
+ src/dh-link.h           |    2 +-
+ 5 files changed, 30 insertions(+), 21 deletions(-)
+
+diff --git a/src/dh-assistant-view.c b/src/dh-assistant-view.c
+index ec42a2e..c8bab6c 100644
+--- a/src/dh-assistant-view.c
++++ b/src/dh-assistant-view.c
+@@ -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 (
+diff --git a/src/dh-book-tree.c b/src/dh-book-tree.c
+index 9183b98..3207948 100644
+--- a/src/dh-book-tree.c
++++ b/src/dh-book-tree.c
+@@ -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);
+diff --git a/src/dh-link.c b/src/dh-link.c
+index 230af73..f320daa 100644
+--- a/src/dh-link.c
++++ b/src/dh-link.c
+@@ -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;
++
++        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 g_strconcat (link->book->base, "/", link->uri, NULL);
++	return uri;
+ }
+ 
+ DhLinkType
+diff --git a/src/dh-link.h b/src/dh-link.h
+index c28a9b4..aa30df9 100644
+--- a/src/dh-link.h
++++ b/src/dh-link.h
+@@ -51,7 +51,7 @@ DhLink *     dh_link_new                (DhLinkType     type,
+ 					 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);
+-- 
+1.6.3.3
+

Modified: desktop/unstable/devhelp/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/devhelp/debian/patches/series?rev=20531&op=diff
==============================================================================
--- desktop/unstable/devhelp/debian/patches/series (original)
+++ desktop/unstable/devhelp/debian/patches/series Tue Jun 30 01:07:23 2009
@@ -2,3 +2,4 @@
 01_do_not_clober_global_w_on_el.patch
 03html2diff_close_sub.patch
 04_close_correct_tab.patch
+05_fix_anchor_loads.patch




More information about the pkg-gnome-commits mailing list