anjuta r3522 - in trunk: . plugins/symbol-browser



Author: sgranjoux
Date: Sat Jan 26 10:54:45 2008
New Revision: 3522
URL: http://svn.gnome.org/viewvc/anjuta?rev=3522&view=rev

Log:
	* plugins/symbol-browser/plugin.c,
	plugins/symbol-browser/an_symbol_view.c:
	use gnome_vfs_get_uri_from_local_path to get local path from uri
	This takes care of escaping some characters


Modified:
   trunk/ChangeLog
   trunk/plugins/symbol-browser/an_symbol_view.c
   trunk/plugins/symbol-browser/plugin.c

Modified: trunk/plugins/symbol-browser/an_symbol_view.c
==============================================================================
--- trunk/plugins/symbol-browser/an_symbol_view.c	(original)
+++ trunk/plugins/symbol-browser/an_symbol_view.c	Sat Jan 26 10:54:45 2008
@@ -1237,17 +1237,15 @@
 anjuta_symbol_view_workspace_add_file (AnjutaSymbolView * sv,
 									   const gchar * file_uri)
 {
-	const gchar *uri;
+	gchar *uri;
 	TMWorkObject *tm_file;
 	GtkTreeModel *store = NULL;
 
 	g_return_if_fail (ANJUTA_IS_SYMBOL_VIEW (sv));
 	g_return_if_fail (file_uri != NULL);
 
-	if (strncmp (file_uri, "file://", 7) == 0)
-		uri = &file_uri[7];
-	else
-		return;
+	uri = gnome_vfs_get_local_path_from_uri (file_uri);
+	if (uri == NULL) return;	/* Not a local path */
 	
 	store = g_hash_table_lookup (sv->priv->tm_files, uri);
 	if (!store)
@@ -1286,6 +1284,7 @@
 								 g_strdup (uri), store);
 		}
 	}
+	g_free (uri);
 	sv->priv->file_symbol_model = store;
 }
 
@@ -1293,19 +1292,18 @@
 anjuta_symbol_view_workspace_remove_file (AnjutaSymbolView * sv,
 										  const gchar * file_uri)
 {
-	const gchar *uri;
+	gchar *uri;
 
 	g_return_if_fail (ANJUTA_IS_SYMBOL_VIEW (sv));
 	g_return_if_fail (file_uri != NULL);
 
 	DEBUG_PRINT ("Removing Symbol URI: %s", file_uri);
-	if (strncmp (file_uri, "file://", 7) == 0)
-		uri = &file_uri[7];
-	else
-		uri = file_uri;
+	uri = gnome_vfs_get_local_path_from_uri (file_uri);
+	if (uri == NULL) return;	/* Not a local path */
 	
 	if (g_hash_table_lookup (sv->priv->tm_files, uri))
 		g_hash_table_remove (sv->priv->tm_files, uri);
+	g_free (uri);
 }
 
 

Modified: trunk/plugins/symbol-browser/plugin.c
==============================================================================
--- trunk/plugins/symbol-browser/plugin.c	(original)
+++ trunk/plugins/symbol-browser/plugin.c	Sat Jan 26 10:54:45 2008
@@ -87,16 +87,16 @@
 goto_file_line (AnjutaPlugin *plugin, const gchar *filename, gint lineno)
 {
 	gchar *uri;
-	IAnjutaFileLoader *loader;
+	IAnjutaDocumentManager *docman;
 	
 	g_return_if_fail (filename != NULL);
 		
 	/* Go to file and line number */
-	loader = anjuta_shell_get_interface (plugin->shell, IAnjutaFileLoader,
+	docman = anjuta_shell_get_interface (plugin->shell, IAnjutaDocumentManager,
 										 NULL);
 		
-	uri = g_strdup_printf ("file:///%s#%d", filename, lineno);
-	ianjuta_file_loader_load (loader, uri, FALSE, NULL);
+	uri = gnome_vfs_get_uri_from_local_path (filename);
+	ianjuta_document_manager_goto_file_line (docman, uri, lineno, NULL);
 	g_free (uri);
 }
 



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