[anjuta] devhelp: update plugin to avoid DhBase, no longer available in libdevhelp



commit 59886ed8b128f6c52eef798c49274db77939f3da
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Tue Jun 26 17:37:52 2012 +0200

    devhelp: update plugin to avoid DhBase, no longer available in libdevhelp
    
    See relevant Devhelp changes at:
    https://bugzilla.gnome.org/show_bug.cgi?id=677927
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=678898

 plugins/devhelp/plugin.c |   29 ++++++++++++-----------------
 plugins/devhelp/plugin.h |    4 ++--
 2 files changed, 14 insertions(+), 19 deletions(-)
---
diff --git a/plugins/devhelp/plugin.c b/plugins/devhelp/plugin.c
index 0465710..2b75f25 100644
--- a/plugins/devhelp/plugin.c
+++ b/plugins/devhelp/plugin.c
@@ -30,13 +30,11 @@
 #include <libanjuta/interfaces/ianjuta-editor.h>
 #include <libanjuta/interfaces/ianjuta-help.h>
 
+#include <devhelp/devhelp.h>
 #include "plugin.h"
 
 #ifndef DISABLE_EMBEDDED_DEVHELP
 
-#include <devhelp/dh-book-tree.h>
-#include <devhelp/dh-search.h>
-#include <devhelp/dh-base.h>
 #include <webkit/webkit.h>
 
 #define ONLINE_API_DOCS "http://library.gnome.org/devel";
@@ -313,7 +311,6 @@ devhelp_activate (AnjutaPlugin *plugin)
 
 #ifndef DISABLE_EMBEDDED_DEVHELP
 	static gboolean init = FALSE;
-	DhBookManager *book_manager;
 	GtkWidget *label;
 	GtkWidget *books_sw;
 	
@@ -417,8 +414,6 @@ devhelp_activate (AnjutaPlugin *plugin)
 	/*
 	 * Notebook
 	 */
-	book_manager = dh_base_get_book_manager (devhelp->base);
-	
 	books_sw = gtk_scrolled_window_new (NULL, NULL);
 	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (books_sw),
 									GTK_POLICY_NEVER,
@@ -426,10 +421,10 @@ devhelp_activate (AnjutaPlugin *plugin)
 	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (books_sw),
 									     GTK_SHADOW_NONE);
 	gtk_container_set_border_width (GTK_CONTAINER (books_sw), 2);
-	
-	devhelp->book_tree = dh_book_tree_new (book_manager);
-	
-	devhelp->search = dh_search_new (book_manager);
+
+	devhelp->book_tree = dh_book_tree_new (devhelp->book_manager);
+
+	devhelp->search = dh_search_new (devhelp->book_manager);
 	gtk_widget_set_size_request (devhelp->search, 0, 0);
 	
 	g_signal_connect (devhelp->book_tree,
@@ -545,12 +540,8 @@ devhelp_dispose (GObject *obj)
 	
 #ifndef DISABLE_EMBEDDED_DEVHELP
 	AnjutaDevhelp* devhelp = ANJUTA_PLUGIN_DEVHELP (obj);
-	
-	if (devhelp->base)
-	{
-		g_object_unref(G_OBJECT(devhelp->base));
-		devhelp->base = NULL;
-	}
+
+	g_clear_object (&devhelp->book_manager);
 #endif /* DISABLE_EMBEDDED_DEVHELP */
 
 	/* Disposition codes */
@@ -564,8 +555,12 @@ devhelp_instance_init (GObject *obj)
 	
 #ifndef DISABLE_EMBEDDED_DEVHELP
 
+	/* Initialize Devhelp support */
+	dh_init ();
+
 	/* Create devhelp */
-	plugin->base = dh_base_new ();
+	plugin->book_manager = dh_book_manager_new ();
+	dh_book_manager_populate (plugin->book_manager);
 
 #endif /* DISABLE_EMBEDDED_DEVHELP */
 	
diff --git a/plugins/devhelp/plugin.h b/plugins/devhelp/plugin.h
index ec89758..abaa039 100644
--- a/plugins/devhelp/plugin.h
+++ b/plugins/devhelp/plugin.h
@@ -29,7 +29,7 @@
 #include <libanjuta/interfaces/ianjuta-editor.h>
 
 #ifndef DISABLE_EMBEDDED_DEVHELP
-#include <devhelp/dh-base.h>
+#include <devhelp/devhelp.h>
 #endif /* DISABLE_EMBEDDED_DEVHELP */
 
 extern GType devhelp_get_type (GTypeModule *module);
@@ -47,7 +47,7 @@ struct _AnjutaDevhelp{
 	AnjutaPlugin parent;
 	
 #ifndef DISABLE_EMBEDDED_DEVHELP
-	DhBase         *base;
+	DhBookManager  *book_manager;
 #endif /* DISABLE_EMBEDDED_DEVHELP */
 	GtkWidget      *view;
 	GtkWidget      *view_sw;



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