Re: Broken on building Gtkhtml

jeff cai <[email protected]>
Newsgroups gmane.comp.gnome.evolution.devel
Message-ID <1141192526.10727.0.camel@commissionaire>
Simon:

I think the problem has been resolved.

Jeff Cai

On Wed, 2006-03-01 at 12:14 +0800, simon.zheng wrote:
> Hi,
> 
> I Just updated the code and built, then got the following error
> 
> --------------------------------------------------------------------
> Undefined                       first referenced
>  symbol                             in file
> next_uri                            ./.libs/libgtkhtml-3.8.so
> --------------------------------------------------------------------
> 
> next_uri() seems to be deleted from gtkhtml.c, but it's still referred
> by some function.
> 
> Anyone can take a look?:-)
> 
> Thanks,
> -Simon
> 
> _______________________________________________
> Evolution-hackers mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/evolution-hackers
-- 
jeff cai <[email protected]>

_______________________________________________
Evolution-hackers mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-hackers
patch (text/plain, 9 KB)
>From [email protected] Wed Mar  1 11:01:46 2006
Return-path: <[email protected]>
Received: from fe-apac-05.sun.com ([192.18.19.176]) by
	sedge2-mail1.singapore.sun.com (Sun Java System Messaging Server 6.2-4.02
	(built Sep  9 2005)) with ESMTP id
	<[email protected]>; Wed, 01 Mar 2006
	11:01:46 +0800 (SGT)
Received: from conversion-daemon.mail-apac.sun.com by mail-apac.sun.com
	(Sun Java System Messaging Server 6.2-4.02 (built Sep  9 2005)) id
	<[email protected]>; Wed, 01 Mar 2006 11:01:46 +0800 (SGT)
Received: from phys-sedge2-1.singapore.sun.com ([129.158.123.14]) by
	mail-apac.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep  9
	2005)) with ESMTP id <[email protected]>; Wed, 01 Mar 2006
	11:01:46 +0800 (SGT)
Received: from dm-prc-01.singapore.sun.com ([129.158.71.109]) by
	sedge2-mail1.singapore.sun.com (Sun Java System Messaging Server 6.2-4.02
	(built Sep  9 2005)) with ESMTP id
	<[email protected]>; Wed, 01 Mar 2006
	11:01:45 +0800 (SGT)
Received: from sunmail2.sfbay.sun.com (sunmail2.SFBay.Sun.COM
	[129.149.246.180])	by dm-prc-01.singapore.sun.com
	(8.13.4+Sun/8.13.3/ENSMAIL,v2.2) with ESMTP id k2131d6D003023; Wed, 01 Mar
	2006 11:01:39 +0800 (SGT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM
	[129.147.4.11])	by sunmail2.sfbay.sun.com
	(8.11.7p1+Sun/8.11.7/ENSMAIL,v2.2) with ESMTP id k2131bm16768; Tue, 28 Feb
	2006 19:01:38 -0800 (PST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
	brm-avmta-1.central.sun.com (Sun Java System Messaging Server 6.2-3.04
	(built Jul 15 2005)) id <[email protected]>;
	Tue, 28 Feb 2006 20:01:37 -0700 (MST)
Received: from nwkea-mail-2.sun.com ([192.18.42.14]) by
	brm-avmta-1.central.sun.com (Sun Java System Messaging Server 6.2-3.04
	(built Jul 15 2005)) with ESMTP id
	<[email protected]>; Tue, 28 Feb 2006 20:01:37
	-0700 (MST)
Received: from relay23.sun.com (relay23.sun.com [192.12.251.54] (may be
	forged))	by nwkea-mail-2.sun.com (8.12.10/8.12.9) with ESMTP id
	k2131a4u003831; Tue, 28 Feb 2006 19:01:36 -0800 (PST)
Received: from mms25es.sun.com (mms25es.sun.com [150.143.232.94]) by
	relay23.sun.com with ESMTP; Wed, 01 Mar 2006 03:01:36 +0000 (Z)
Received: from relay21.sun.com (relay21.sun.com [192.12.251.14]) by
	mms25es.sun.com with ESMTP; Wed, 01 Mar 2006 03:01:35 +0000 (Z)
Received: from menubar.gnome.org (menubar.gnome.org [209.132.176.177]) by
	relay21.sun.com with ESMTP; Wed, 01 Mar 2006 03:01:34 +0000 (Z)
Received: from localhost (unknown [127.0.0.1])	by menubar.gnome.org
	(Postfix) with ESMTP	id 845D23B3B14; Tue, 28 Feb 2006 22:01:33 -0500 (EST)
Received: from menubar.gnome.org ([127.0.0.1]) by localhost
	(menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id
	03560-02; Tue, 28 Feb 2006 22:01:30 -0500 (EST)
Received: from menubar.gnome.org (localhost.localdomain [127.0.0.1]) by
	menubar.gnome.org (Postfix) with ESMTP	id 5A97B3B3B26; Tue, 28 Feb 2006
	22:01:30 -0500 (EST)
Received: from localhost (unknown [127.0.0.1])	by menubar.gnome.org
	(Postfix) with ESMTP id 744C53B3B12	for <[email protected]>; Tue,
	28 Feb 2006 22:01:28 -0500 (EST)
Received: from menubar.gnome.org ([127.0.0.1]) by localhost
	(menubar.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id
	03525-03 for <[email protected]>; Tue, 28 Feb 2006 22:01:27 -0500
	(EST)
Received: from gw01.mail.saunalahti.fi
	(gw01.mail.saunalahti.fi	[195.197.172.115])	by menubar.gnome.org (Postfix)
	with ESMTP id 0459D3B3B1C	for <[email protected]>; Tue, 28 Feb
	2006 22:01:26 -0500 (EST)
Received: from pettson (MMCDLX.tun.saunalahti.fi [213.169.2.60]) by
	gw01.mail.saunalahti.fi (Postfix) with ESMTP id CE3DB116A8D	for
	<[email protected]>; Wed, 01 Mar 2006 05:01:24 +0200 (EET)
Date: Wed, 01 Mar 2006 05:01:20 +0200
From: Tor Lillqvist <[email protected]>
Subject: [evolution-patches] Fix for gtkhtml
Sender: [email protected]
To: [email protected]
Errors-to: [email protected]
Message-id: <1141182080.2344.8.camel@pettson>
MIME-version: 1.0
X-Mailer: Evolution 2.5.91
Content-type: multipart/mixed; boundary="Boundary_(ID_X0NIsO8qk0BOEpP4ud0MRA)"
Precedence: list
X-BeenThere: [email protected]
Delivered-to: [email protected]
X-PMX-Version: 5.1.2.240295
X-Original-To: [email protected]
X-Virus-Scanned: by amavisd-new at gnome.org
X-Virus-Scanned: by amavisd-new at gnome.org
X-Mailman-Version: 2.1.5
List-Post: <mailto:[email protected]>
List-Subscribe: <http://mail.gnome.org/mailman/listinfo/evolution-patches>,
	<mailto:[email protected]?subject=subscribe>
List-Unsubscribe:
	<http://mail.gnome.org/mailman/listinfo/evolution-patches>,
	<mailto:[email protected]?subject=unsubscribe>
List-Archive: <http://mail.gnome.org/archives/evolution-patches>
List-Help: <mailto:[email protected]?subject=help>
List-Id: list for patches against evolution and evolution-data-server
	<evolution-patches.gnome.org>
X-Evolution-Source: imap://[email protected]/


--Boundary_(ID_X0NIsO8qk0BOEpP4ud0MRA)
Content-type: text/plain
Content-Transfer-Encoding: 8bit

kmaraas's recent change to gtkhtml.c broke it. 

This patch unbreaks it: 

-- Reinstate the function get_class_properties() (although I rename it
to setup_class_properties() as its return value isn't used, it's needed
only for side effect), and reinstate the call to
setup_class_properties() in init_properties_widget().

-- Reinstate the next_uri() function which *is* used.

-- Remove the known_protocols[] array, though, which is not used.

(I still see the problem of #319407, this isn't related to that...)

--tml


--Boundary_(ID_X0NIsO8qk0BOEpP4ud0MRA)
Content-type: text/x-patch; charset=cp1252; name=gtkhtml.c.diff
Content-disposition: attachment; filename=gtkhtml.c.diff
Content-Transfer-Encoding: 8bit

? src/koe1.c
? src/libgtkhtml-3.8.pc
Index: src/gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.616
diff -p -u -2 -r1.616 gtkhtml.c
--- src/gtkhtml.c	28 Feb 2006 20:51:54 -0000	1.616
+++ src/gtkhtml.c	1 Mar 2006 02:51:57 -0000
@@ -2317,4 +2317,39 @@ client_notify_spell_widget (GConfClient*
 
 static void
+setup_class_properties (GtkHTML *html)
+{
+	GtkHTMLClass *klass;
+  
+	klass = GTK_HTML_CLASS (GTK_WIDGET_GET_CLASS (html));
+	if (!klass->properties) {
+		klass->properties = gtk_html_class_properties_new (GTK_WIDGET (html));
+		
+		if (!gconf_is_initialized ()) {
+			char *argv[] = { "gtkhtml", NULL };
+			
+			g_warning ("gconf is not initialized, please call gconf_init before using GtkHTML library. "
+				   "Meanwhile it's initialized by gtkhtml itself.");
+			gconf_init (1, argv, &gconf_error);
+			if (gconf_error)
+				g_error ("gconf error: %s\n", gconf_error->message);
+		}
+		
+		gconf_client = gconf_client_get_default ();
+		if (!gconf_client)
+			g_error ("cannot create gconf_client\n");
+		gconf_client_add_dir (gconf_client, GTK_HTML_GCONF_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, &gconf_error);
+		if (gconf_error)
+			g_error ("gconf error: %s\n", gconf_error->message);
+		gconf_client_add_dir (gconf_client, GNOME_SPELL_GCONF_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, &gconf_error);
+		if (gconf_error)
+			g_error ("gconf error: %s\n", gconf_error->message);
+		gtk_html_class_properties_load (klass->properties, gconf_client);
+
+		if (gconf_error)
+			g_warning ("gconf error: %s\n", gconf_error->message);
+	}
+}
+
+static void
 set_focus_child (GtkContainer *containter, GtkWidget *w)
 {
@@ -2507,19 +2542,30 @@ drag_data_delete (GtkWidget *widget, Gdk
 }
 
-static gchar *known_protocols [] = {
-	"http://",
-	"ftp://",
-	"nntp://",
-	"news://",
-	"mailto:",
-	"file:",
-	NULL
-};
+static gchar *
+next_uri (guchar **uri_list, gint *len, gint *list_len)
+{
+	guchar *uri, *begin;
+
+	begin = *uri_list;
+	*len = 0;
+	while (**uri_list && **uri_list != '\n' && **uri_list != '\r' && *list_len) {
+		(*uri_list) ++;
+		(*len) ++;
+		(*list_len) --;
+	}
+
+	uri = g_strndup (begin, *len);
+
+	while ((!**uri_list || **uri_list == '\n' || **uri_list == '\r') && *list_len) {
+		(*uri_list) ++;
+		(*list_len) --;
+	}	
+
+	return uri;
+}
 
 static HTMLObject *
 new_img_obj_from_uri (HTMLEngine *e, char *uri, char *title, gint len)
 {
-	gint i;
-
 	if (!strncmp (uri, "file:", 5)) {
 		if (!HTML_IS_PLAIN_PAINTER(e->painter)) {
@@ -3064,4 +3110,6 @@ static void
 init_properties_widget (GtkHTML *html)
 {
+	setup_class_properties (html);
+
 	if (!gconf_client)
 		gconf_client = gconf_client_get_default ();

--Boundary_(ID_X0NIsO8qk0BOEpP4ud0MRA)
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-disposition: inline
Content-Transfer-Encoding: 8bit

_______________________________________________
Evolution-patches mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-patches

--Boundary_(ID_X0NIsO8qk0BOEpP4ud0MRA)--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.