devhelp-2 fixes



Two small fixes for devhelp-2 making it work as expected with old books
installed for devhelp 1.

------------------------------------------------------------------------
Search for name-version instead of name in books directory for old books.

diff -u -u -r1.3 dh-book-old.c
--- src/dh-book-old.c	9 Nov 2002 21:49:46 -0000	1.3
+++ src/dh-book-old.c	25 Dec 2002 12:26:51 -0000
@@ -289,6 +289,16 @@
 	name = g_strdup (xml_str);
 	xmlFree (xml_str);
 	
+	xml_str = xmlGetProp (root_node, "version");
+	if(xml_str)
+	{
+		char * tmpname;
+		tmpname = g_strconcat(name,"-",xml_str,NULL);
+		g_free(name);
+		name = tmpname;
+	}
+	xmlFree(xml_str);
+	
 	xml_str = xmlGetProp (root_node, "base");
 	if (!xml_str) {
 		g_warning ("Book '%s' misses the base URL, fix the book file",
-------------------------------------------------------------------------
Improved error message and clearing of error while loading books.

diff -u -u -r1.4 dh-profile.c
--- src/dh-profile.c	9 Nov 2002 15:25:15 -0000	1.4
+++ src/dh-profile.c	25 Dec 2002 12:26:51 -0000
@@ -202,8 +202,9 @@
 				   priv->contents,
 				   &priv->keywords,
 				   error)) {
-			g_print ("Reading book '%s' failed with error message\n",
-				 (*error)->message);
+			g_print ("Reading book '%s' failed with error message '%s'\n",
+				 (const char *) l->data, (*error)->message);
+			g_clear_error(error);
 		}
 	}
 
------------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]