anjuta r3598 - in trunk: . libanjuta/interfaces plugins/class-inheritance plugins/profiler plugins/symbol-browser plugins/symbol-db



Author: sgranjoux
Date: Mon Feb  4 20:45:51 2008
New Revision: 3598
URL: http://svn.gnome.org/viewvc/anjuta?rev=3598&view=rev

Log:
	* plugins/profiler/gprof-view.c,
	plugins/class-inheritance/class-callbacks.c,
	plugins/class-inheritance/class-inherit.c,
	plugins/symbol-browser/an_symbol.c,
	plugins/symbol-db/symbol-db-engine-iterator-node.c,
	libanjuta/interfaces/libanjuta.idl:
	Change ianjuta_symbol_file function to ianjuta_symbol_uri


Modified:
   trunk/ChangeLog
   trunk/libanjuta/interfaces/libanjuta.idl
   trunk/plugins/class-inheritance/class-callbacks.c
   trunk/plugins/class-inheritance/class-inherit.c
   trunk/plugins/profiler/gprof-view.c
   trunk/plugins/symbol-browser/an_symbol.c
   trunk/plugins/symbol-db/symbol-db-engine-iterator-node.c

Modified: trunk/libanjuta/interfaces/libanjuta.idl
==============================================================================
--- trunk/libanjuta/interfaces/libanjuta.idl	(original)
+++ trunk/libanjuta/interfaces/libanjuta.idl	Mon Feb  4 20:45:51 2008
@@ -4366,7 +4366,7 @@
 	const gchar *var_type ();    // Variable type (maps to struct for typedefs)
 	const gchar *access ();      // Access type (public/protected/private/etc.)
 	const gchar *impl ();        // Implementation (e.g. virtual)
-	const gchar *file ();   	 // File in which the symbol occurs
+	const gchar *uri ();   	     // URI in which the symbol occurs
 	gulong line ();              // Line number of the symbol
 	gboolean is_local ();        // Is the symbol of local scope
 	

Modified: trunk/plugins/class-inheritance/class-callbacks.c
==============================================================================
--- trunk/plugins/class-inheritance/class-callbacks.c	(original)
+++ trunk/plugins/class-inheritance/class-callbacks.c	Mon Feb  4 20:45:51 2008
@@ -93,21 +93,21 @@
 on_member_menuitem_clicked (GtkMenuItem *menuitem, gpointer data)
 {
 	NodeData *node;
-	const gchar *file;
+	const gchar *uri;
 	gint line;
 	
 	node = (NodeData*)data;
-	file = g_object_get_data (G_OBJECT (menuitem), "__file");
+	uri = g_object_get_data (G_OBJECT (menuitem), "__uri");
 	line = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), "__line"));
-	if (file)
+	if (uri)
 	{
-		/* Goto file line */
+		/* Goto uri line */
 		IAnjutaDocumentManager *dm;
 		dm = anjuta_shell_get_interface (ANJUTA_PLUGIN (node->plugin)->shell,
 										 IAnjutaDocumentManager, NULL);
 		if (dm)
 		{
-			ianjuta_document_manager_goto_uri_line (dm, file, line, NULL);
+			ianjuta_document_manager_goto_uri_line (dm, uri, line, NULL);
 		}
 	}
 }
@@ -142,20 +142,20 @@
 					g_hash_table_remove (plugin->expansion_node_list, nodedata->name);
 					class_inheritance_update_graph (plugin);
 				}
-			else {		/* it's a class member. Take line && file of definition 
+			else {		/* it's a class member. Take line && uri of definition 
 							 * and reach them */
-				const gchar* file;
+				const gchar* uri;
 				gint line;
 				
-				file = g_object_get_data (G_OBJECT (item), "__file");
+				uri = g_object_get_data (G_OBJECT (item), "__uri");
 				line = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "__line"));
-				if (file) {
-					/* Goto file line */
+				if (uri) {
+					/* Goto uri line */
 					IAnjutaDocumentManager *dm;
 					dm = anjuta_shell_get_interface (ANJUTA_PLUGIN (plugin)->shell,
 											 	IAnjutaDocumentManager, NULL);
 					if (dm) {
-						ianjuta_document_manager_goto_uri_line (dm, file, line, NULL);
+						ianjuta_document_manager_goto_uri_line (dm, uri, line, NULL);
 					}
 				}
 			}

Modified: trunk/plugins/class-inheritance/class-inherit.c
==============================================================================
--- trunk/plugins/class-inheritance/class-inherit.c	(original)
+++ trunk/plugins/class-inheritance/class-inherit.c	Mon Feb  4 20:45:51 2008
@@ -94,13 +94,13 @@
 				IAnjutaSymbol *symbol = IANJUTA_SYMBOL (iter);
 				do
 				{
-					const gchar *name, *file;
+					const gchar *name, *uri;
 					GdkPixbuf *pixbuf;
 					gint line;
 					
 					name = ianjuta_symbol_name (symbol, NULL);
 					pixbuf = ianjuta_symbol_icon (symbol, NULL);
-					file = ianjuta_symbol_file (symbol, NULL);
+					uri = ianjuta_symbol_uri (symbol, NULL);
 					line = ianjuta_symbol_line (symbol, NULL);
 					
 					item = gtk_image_menu_item_new_with_label (name);
@@ -108,10 +108,10 @@
 					gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM
 												   (item), image);
 					
-					if (file)
+					if (uri)
 					{
-						g_object_set_data_full (G_OBJECT (item), "__file",
-												g_strdup (file), g_free);
+						g_object_set_data_full (G_OBJECT (item), "__uri",
+												g_strdup (uri), g_free);
 						g_object_set_data (G_OBJECT (item), "__line",
 										   GINT_TO_POINTER (line));
 					}
@@ -449,7 +449,7 @@
 								   &plugin->canvas->style->base[GTK_STATE_ACTIVE],
 								   NULL);
 									
-			/* add to the nodelist: we'll set the __file and __line properites later
+			/* add to the nodelist: we'll set the __uri and __line properites later
 			 * on this loop, when we'll parse symbols. */			
 			plugin->node_list = g_list_prepend (plugin->node_list, node_data);
 
@@ -506,11 +506,11 @@
 			/* go on with the icons */
 			if (symbol_iter && ianjuta_iterable_get_length (symbol_iter, NULL) > 0) {
 				GdkPixbuf *pixbuf;
-				const gchar* file;
+				const gchar* uri;
 				gint line;
 				IAnjutaSymbol *symbol = IANJUTA_SYMBOL (symbol_iter);
 
-				file = ianjuta_symbol_file (symbol, NULL);
+				uri = ianjuta_symbol_uri (symbol, NULL);
 				line = ianjuta_symbol_line (symbol, NULL);
 				pixbuf = ianjuta_symbol_icon (symbol, NULL);
 				
@@ -528,9 +528,9 @@
 
 				/* set now the object properties on node_data. We still have a 
 				 * reference to it so we can access its canvas_item */
-				if (file) {
-					g_object_set_data_full (G_OBJECT (node_data->canvas_item), "__file",
-											g_strdup (file), g_free);
+				if (uri) {
+					g_object_set_data_full (G_OBJECT (node_data->canvas_item), "__uri",
+											g_strdup (uri), g_free);
 					g_object_set_data (G_OBJECT (node_data->canvas_item), "__line",
 									   GINT_TO_POINTER (line));
 				}

Modified: trunk/plugins/profiler/gprof-view.c
==============================================================================
--- trunk/plugins/profiler/gprof-view.c	(original)
+++ trunk/plugins/profiler/gprof-view.c	Mon Feb  4 20:45:51 2008
@@ -117,7 +117,7 @@
 {
 	IAnjutaIterable *symbol_iter;
 	IAnjutaSymbol *symbol;
-	const gchar *file;
+	const gchar *uri;
 	guint line;
 	
 	if (self->priv->symbol_manager &&
@@ -134,11 +134,11 @@
 			ianjuta_iterable_get_length (symbol_iter, NULL) > 0)
 		{
 			symbol = IANJUTA_SYMBOL (symbol_iter);
-			file = ianjuta_symbol_file (symbol, NULL);
+			uri = ianjuta_symbol_uri (symbol, NULL);
 			line = ianjuta_symbol_line (symbol, NULL);
 			
 			ianjuta_document_manager_goto_uri_line (self->priv->document_manager, 
-													 file, line, NULL);
+													 uri, line, NULL);
 			
 			g_object_unref (symbol_iter);
 		}

Modified: trunk/plugins/symbol-browser/an_symbol.c
==============================================================================
--- trunk/plugins/symbol-browser/an_symbol.c	(original)
+++ trunk/plugins/symbol-browser/an_symbol.c	Mon Feb  4 20:45:51 2008
@@ -28,6 +28,7 @@
 struct _AnjutaSymbolPriv
 {
 	const TMTag *tm_tag;
+	gchar* uri;
 };
 
 static gpointer parent_class;
@@ -39,6 +40,8 @@
 {
 	AnjutaSymbol *s = ANJUTA_SYMBOL (obj);
 	
+	if (s->priv->uri)
+		g_free (s->priv->uri);
 	g_free (s->priv);
 	GNOME_CALL_PARENT (G_OBJECT_CLASS, finalize, (obj));
 }
@@ -75,6 +78,7 @@
 	
 	s = g_object_new (ANJUTA_TYPE_SYMBOL, NULL);
 	s->priv->tm_tag = tm_tag;
+	s->priv->uri = NULL;
 	return s;
 }
 
@@ -83,6 +87,11 @@
 {
 	g_return_if_fail (ANJUTA_IS_SYMBOL (symbol));
 	symbol->priv->tm_tag = NULL;
+	if (symbol->priv->uri)
+	{
+		g_free(symbol->priv->uri);
+		symbol->priv->uri = NULL;
+	}
 	if (tm_tag != NULL)
 	{
 		g_return_if_fail (tm_tag->type < tm_tag_max_t);
@@ -197,7 +206,7 @@
 }
 
 static const gchar*
-isymbol_file (IAnjutaSymbol *isymbol, GError **err)
+isymbol_uri (IAnjutaSymbol *isymbol, GError **err)
 {
 	AnjutaSymbol *s;
 
@@ -206,7 +215,13 @@
 	g_return_val_if_fail (s->priv->tm_tag != NULL, NULL);
 	if (s->priv->tm_tag->atts.entry.file == NULL)
 		return NULL;
-	return s->priv->tm_tag->atts.entry.file->work_object.file_name;
+	if (s->priv->uri == NULL)
+	{
+		const gchar *file_path;
+		file_path = s->priv->tm_tag->atts.entry.file->work_object.file_name;
+		s->priv->uri = gnome_vfs_get_uri_from_local_path (file_path);
+	}
+	return s->priv->uri;
 }
 
 static gulong
@@ -256,7 +271,7 @@
 	iface->inheritance = isymbol_inheritance;	
 	iface->access = isymbol_access;
 	iface->impl = isymbol_impl;
-	iface->file = isymbol_file;
+	iface->uri = isymbol_uri;
 	iface->line = isymbol_line;
 	iface->is_local = isymbol_is_local;
 	iface->icon = isymbol_icon;

Modified: trunk/plugins/symbol-db/symbol-db-engine-iterator-node.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-engine-iterator-node.c	(original)
+++ trunk/plugins/symbol-db/symbol-db-engine-iterator-node.c	Mon Feb  4 20:45:51 2008
@@ -34,6 +34,7 @@
 {
 	GdaDataModelIter *data_iter;	
 	const GHashTable *sym_type_conversion_hash;
+	gchar *uri;
 };
 
 static GObjectClass* parent_class = NULL;
@@ -46,6 +47,7 @@
 	SymbolDBEngineIteratorNode *s;
 	s = g_object_new (SYMBOL_TYPE_DB_ENGINE_ITERATOR_NODE, NULL);
 	s->priv->data_iter = (GdaDataModelIter *)data;
+	s->priv->uri = NULL;
 	
 	return s;
 }
@@ -60,6 +62,7 @@
 	
 	sdbin->priv = g_new0 (SymbolDBEngineIteratorNodePriv, 1);
 	sdbin->priv->sym_type_conversion_hash = NULL;
+	sdbin->priv->uri = NULL;
 }
 
 static void
@@ -73,6 +76,8 @@
 	
 	dbin = SYMBOL_DB_ENGINE_ITERATOR_NODE (object);	
 	priv = dbin->priv;
+	if (priv->uri)
+		g_free (priv->uri);
 
 	g_free (priv);
 
@@ -303,6 +308,11 @@
 	
 	priv = dbin->priv;
 	priv->data_iter = GDA_DATA_MODEL_ITER (data);
+	if (priv->uri != NULL)
+	{
+		g_free (priv->uri);
+		priv->uri = NULL;
+	}
 }
 
 
@@ -431,14 +441,20 @@
 }
 
 static const gchar*
-isymbol_file (IAnjutaSymbol *isymbol, GError **err)
+isymbol_uri (IAnjutaSymbol *isymbol, GError **err)
 {
 	SymbolDBEngineIteratorNode *s;
 
 	g_return_val_if_fail (SYMBOL_IS_DB_ENGINE_ITERATOR (isymbol),  NULL);
 	s = SYMBOL_DB_ENGINE_ITERATOR_NODE (isymbol);
-	return symbol_db_engine_iterator_node_get_symbol_extra_string (s, 
+	if (s->priv->uri == NULL)
+	{
+		const cgchar* file_path;
+		file_path = symbol_db_engine_iterator_node_get_symbol_extra_string (s, 
 													SYMINFO_FILE_PATH);
+		s->priv->uri = gnome_vfs_get_uri_from_local_path (file_path);
+	}
+	return s->priv->uri;
 }
 
 static gulong
@@ -488,7 +504,7 @@
 	iface->inheritance = isymbol_inheritance;	
 	iface->access = isymbol_access;
 	iface->impl = isymbol_impl;
-	iface->file = isymbol_file;
+	iface->uri = isymbol_uri;
 	iface->line = isymbol_line;
 	iface->is_local = isymbol_is_local;
 	iface->icon = isymbol_icon;



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