anjuta r3590 - in trunk: . libanjuta/interfaces plugins/build-basic-autotools plugins/class-inheritance plugins/debug-manager plugins/document-manager plugins/profiler plugins/search plugins/symbol-browser plugins/tools



Author: sgranjoux
Date: Sun Feb  3 18:56:53 2008
New Revision: 3590
URL: http://svn.gnome.org/viewvc/anjuta?rev=3590&view=rev

Log:
	* plugins/profiler/gprof-view.c,
	plugins/symbol-browser/plugin.c,
	plugins/class-inheritance/class-callbacks.c,
	plugins/debug-manager/plugin.c,
	plugins/tools/editor.c,
	plugins/search/search-replace.c,
	plugins/search/search-replace_backend.c,
	plugins/search/search-replace_backend.h,
	plugins/build-basic-autotools/build-basic-autotools.c,
	plugins/document-manager/plugin.c,
	plugins/document-manager/file_history.c,
	plugins/document-manager/anjuta-docman.c,
	plugins/document-manager/anjuta-docman.h,
	plugins/document-manager/action-callbacks.c,
	libanjuta/interfaces/libanjuta.idl:
	Rename IAnjutaDocumentManager functions:
	find_document_with_path, goto_file_line, goto_file_line_mark
	and get_full_filename into
	find_document_with_uri, goto_uri_line, goto_uri_line_mark
	and get_uri
	Fix search plugin to use an URI instead of a file path
	Fix anjuta_docman_get_uri to always return an URI


Modified:
   trunk/ChangeLog
   trunk/libanjuta/interfaces/libanjuta.idl
   trunk/plugins/build-basic-autotools/build-basic-autotools.c
   trunk/plugins/class-inheritance/class-callbacks.c
   trunk/plugins/debug-manager/plugin.c
   trunk/plugins/document-manager/action-callbacks.c
   trunk/plugins/document-manager/anjuta-docman.c
   trunk/plugins/document-manager/anjuta-docman.h
   trunk/plugins/document-manager/file_history.c
   trunk/plugins/document-manager/plugin.c
   trunk/plugins/profiler/gprof-view.c
   trunk/plugins/search/search-replace.c
   trunk/plugins/search/search-replace_backend.c
   trunk/plugins/search/search-replace_backend.h
   trunk/plugins/symbol-browser/plugin.c
   trunk/plugins/tools/editor.c

Modified: trunk/libanjuta/interfaces/libanjuta.idl
==============================================================================
--- trunk/libanjuta/interfaces/libanjuta.idl	(original)
+++ trunk/libanjuta/interfaces/libanjuta.idl	Sun Feb  3 18:56:53 2008
@@ -2185,37 +2185,37 @@
 	}
 
 	/**
-	* ianjuta_document_manager_get_full_filename:
+	* ianjuta_document_manager_get_uri:
 	* @obj: Self
 	* @file: short filename
 	* @err: Error propagation and reporting.
 	* 
-	* Given the short filename, finds the full path of the file, if the
+	* Given the short filename, finds the URI of the file, if the
 	* editor that has it loaded is found. If there is no editor that has
 	* this file opened, returns NULL.
 	* 
-	* Return value: the full path of the file, if an editor is found for it.
+	* Return value: the URI of the file, if an editor is found for it.
 	*/
-	gchar* get_full_filename (const gchar *file);
+	gchar* get_uri (const gchar *file);
 	
 	/**
-	* ianjuta_document_manager_find_document_with_path:
+	* ianjuta_document_manager_find_document_with_uri:
 	* @obj: Self
-	* @file_path: the file path.
+	* @uri: the file uri.
 	* @err: Error propagation and reporting.
 	* 
-	* Finds the document that has the file with path @file_path loaded. Only
-	* the editor that matches the file path will be searched.
+	* Finds the document that has the file with URI @uri loaded. Only
+	* the editor that matches the URI will be searched.
 	* 
-	* Return value: the document that corresponds to given file path. NULL if
-	* there is no editor loaded with this file path.
+	* Return value: the document that corresponds to given URI. NULL if
+	* there is no editor loaded with this URI.
 	*/
-	IAnjutaDocument* find_document_with_path (const gchar *file_path);
+	IAnjutaDocument* find_document_with_uri (const gchar *uri);
 	
 	/**
-	* ianjuta_document_manager_goto_file_line:
+	* ianjuta_document_manager_goto_uri_line:
 	* @obj: Self
-	* @file: the file to go to.
+	* @uri: URI of the file to go to.
 	* @lineno: the line number in the file to go to.
 	* @err: Error propagation and reporting.
 	* 
@@ -2224,12 +2224,12 @@
 	* 
 	* Return value: the editor where the mark has been put. NULL if none.
 	*/
-	IAnjutaEditor* goto_file_line (const gchar *file, gint lineno);
+	IAnjutaEditor* goto_uri_line (const gchar *uri, gint lineno);
 	
 	/** 
-	* ianjuta_document_manager_goto_file_line_mark:
+	* ianjuta_document_manager_goto_uri_line_mark:
 	* @obj: Self
-	* @file: the file to go to.
+	* @uri: URI of the file to go to.
 	* @lineno: the line number in the file to go to.
 	* @mark: TRUE if the line should be marked with a marker.
 	* @err: Error propagation and reporting
@@ -2240,7 +2240,7 @@
 	* 
 	* Return value: the editor where the mark has been put. NULL if none.
 	*/
-	IAnjutaEditor* goto_file_line_mark (const gchar *file, gint lineno, gboolean mark);
+	IAnjutaEditor* goto_uri_line_mark (const gchar *uri, gint lineno, gboolean mark);
 	
 	/**
 	* ianjuta_document_manager_get_current_document:

Modified: trunk/plugins/build-basic-autotools/build-basic-autotools.c
==============================================================================
--- trunk/plugins/build-basic-autotools/build-basic-autotools.c	(original)
+++ trunk/plugins/build-basic-autotools/build-basic-autotools.c	Sun Feb  3 18:56:53 2008
@@ -740,7 +740,7 @@
 		g_free(filename);
 		if (uri)
 		{
-			ianjuta_document_manager_goto_file_line_mark(docman, uri, lineno, TRUE, NULL);
+			ianjuta_document_manager_goto_uri_line_mark(docman, uri, lineno, TRUE, NULL);
 			g_free(uri);
 		}
 	}

Modified: trunk/plugins/class-inheritance/class-callbacks.c
==============================================================================
--- trunk/plugins/class-inheritance/class-callbacks.c	(original)
+++ trunk/plugins/class-inheritance/class-callbacks.c	Sun Feb  3 18:56:53 2008
@@ -107,7 +107,7 @@
 										 IAnjutaDocumentManager, NULL);
 		if (dm)
 		{
-			ianjuta_document_manager_goto_file_line (dm, file, line, NULL);
+			ianjuta_document_manager_goto_uri_line (dm, file, line, NULL);
 		}
 	}
 }
@@ -155,7 +155,7 @@
 					dm = anjuta_shell_get_interface (ANJUTA_PLUGIN (plugin)->shell,
 											 	IAnjutaDocumentManager, NULL);
 					if (dm) {
-						ianjuta_document_manager_goto_file_line (dm, file, line, NULL);
+						ianjuta_document_manager_goto_uri_line (dm, file, line, NULL);
 					}
 				}
 			}

Modified: trunk/plugins/debug-manager/plugin.c
==============================================================================
--- trunk/plugins/debug-manager/plugin.c	(original)
+++ trunk/plugins/debug-manager/plugin.c	Sun Feb  3 18:56:53 2008
@@ -211,7 +211,7 @@
 		{
 			IAnjutaEditor* editor;
 		
-			editor = ianjuta_document_manager_goto_file_line(docman, file_uri, line, NULL);
+			editor = ianjuta_document_manager_goto_uri_line(docman, file_uri, line, NULL);
 		
 			if (editor != NULL)
 			{
@@ -570,7 +570,7 @@
         docman = anjuta_shell_get_interface (ANJUTA_PLUGIN(self)->shell, IAnjutaDocumentManager, NULL);
         if (docman)
         {
-			ianjuta_document_manager_goto_file_line (docman, uri, line, NULL);
+			ianjuta_document_manager_goto_uri_line (docman, uri, line, NULL);
         }
 	}
 }

Modified: trunk/plugins/document-manager/action-callbacks.c
==============================================================================
--- trunk/plugins/document-manager/action-callbacks.c	(original)
+++ trunk/plugins/document-manager/action-callbacks.c	Sun Feb  3 18:56:53 2008
@@ -1009,7 +1009,7 @@
 			g_free (uri);
 			if (newfname)
 			{
-				anjuta_docman_goto_file_line (docman, newfname, -1);
+				anjuta_docman_goto_uri_line (docman, newfname, -1);
 				g_free (newfname);
 			}
 		}

Modified: trunk/plugins/document-manager/anjuta-docman.c
==============================================================================
--- trunk/plugins/document-manager/anjuta-docman.c	(original)
+++ trunk/plugins/document-manager/anjuta-docman.c	Sun Feb  3 18:56:53 2008
@@ -405,7 +405,7 @@
 			uri = g_slist_nth_data (list, i);
 			if (uri)
 			{
-				anjuta_docman_goto_file_line (docman, uri, -1);
+				anjuta_docman_goto_uri_line (docman, uri, -1);
 				g_free (uri);
 			}
 		}
@@ -1092,15 +1092,15 @@
 }
 
 IAnjutaEditor *
-anjuta_docman_goto_file_line (AnjutaDocman *docman, const gchar *uri, gint lineno)
+anjuta_docman_goto_uri_line (AnjutaDocman *docman, const gchar *uri, gint lineno)
 {
-	return anjuta_docman_goto_file_line_mark (docman, uri, lineno, FALSE);
+	return anjuta_docman_goto_uri_line_mark (docman, uri, lineno, FALSE);
 }
 
 /* file_uri must be an escaped URI string such as returned by
 	gnome_vfs_get_uri_from_local_path() */
 IAnjutaEditor *
-anjuta_docman_goto_file_line_mark (AnjutaDocman *docman, const gchar *file_uri,
+anjuta_docman_goto_uri_line_mark (AnjutaDocman *docman, const gchar *file_uri,
 								   gint line, gboolean mark)
 {
 	GnomeVFSURI* vfs_uri;
@@ -1170,7 +1170,7 @@
 	doc = anjuta_docman_get_document_for_uri (docman, uri);
 	if (doc == NULL)
 	{
-		DEBUG_PRINT("open new");
+		DEBUG_PRINT("open new %s", uri);
 		/* no deal, open a new document */
 		te = anjuta_docman_add_editor (docman, uri, NULL); /* CHECKME NULL if not IANJUTA_IS_EDITOR () ? */
 		doc = IANJUTA_DOCUMENT (te);
@@ -1212,7 +1212,7 @@
 }
 
 gchar *
-anjuta_docman_get_full_filename (AnjutaDocman *docman, const gchar *fn)
+anjuta_docman_get_uri (AnjutaDocman *docman, const gchar *fn)
 {
 	IAnjutaDocument *doc;
 	GList *node;
@@ -1226,12 +1226,24 @@
 	go further, even if the file is not found*/
 	if (fn[0] == '/')
 	{
-		return real_path;
+		gchar *uri;
+		
+		uri = gnome_vfs_get_uri_from_local_path(real_path);
+		g_free (real_path);
+		
+		return uri;
 	}
 	
 	/* First, check if we can get the file straightaway */
 	if (g_file_test (real_path, G_FILE_TEST_IS_REGULAR))
-		return real_path;
+	{
+		gchar *uri;
+		
+		uri = gnome_vfs_get_uri_from_local_path(real_path);
+		g_free (real_path);
+		
+		return uri;
+	}
 	g_free(real_path);
 
 	/* Get the name part of the file */

Modified: trunk/plugins/document-manager/anjuta-docman.h
==============================================================================
--- trunk/plugins/document-manager/anjuta-docman.h	(original)
+++ trunk/plugins/document-manager/anjuta-docman.h	Sun Feb  3 18:56:53 2008
@@ -75,10 +75,10 @@
 
 void anjuta_docman_set_current_document (AnjutaDocman *docman, IAnjutaDocument *doc);
 
-IAnjutaEditor *anjuta_docman_goto_file_line (AnjutaDocman *docman,
+IAnjutaEditor *anjuta_docman_goto_uri_line (AnjutaDocman *docman,
 											const gchar *uri,
 											gint lineno);
-IAnjutaEditor *anjuta_docman_goto_file_line_mark (AnjutaDocman *docman,
+IAnjutaEditor *anjuta_docman_goto_uri_line_mark (AnjutaDocman *docman,
 												const gchar *uri,
 												gint lineno,
 												gboolean mark);
@@ -93,7 +93,7 @@
 
 gboolean anjuta_docman_set_editor_properties (AnjutaDocman *docman);
 
-gchar *anjuta_docman_get_full_filename (AnjutaDocman *docman, const gchar *fn);
+gchar *anjuta_docman_get_uri (AnjutaDocman *docman, const gchar *filename);
 
 GList *anjuta_docman_get_all_doc_widgets (AnjutaDocman *docman);
 

Modified: trunk/plugins/document-manager/file_history.c
==============================================================================
--- trunk/plugins/document-manager/file_history.c	(original)
+++ trunk/plugins/document-manager/file_history.c	Sun Feb  3 18:56:53 2008
@@ -125,7 +125,7 @@
 
 	s_history->current = s_history->current->next;
 	h_file = (AnHistFile *) s_history->current->data;
-	anjuta_docman_goto_file_line_mark (docman, h_file->uri,
+	anjuta_docman_goto_uri_line_mark (docman, h_file->uri,
 									   h_file->line, FALSE);
 }
 
@@ -138,7 +138,7 @@
 	
 	s_history->current = s_history->current->prev;
 	h_file = (AnHistFile *) s_history->current->data;
-	anjuta_docman_goto_file_line_mark(docman, h_file->uri,
+	anjuta_docman_goto_uri_line_mark(docman, h_file->uri,
 									  h_file->line, FALSE);
 }
 

Modified: trunk/plugins/document-manager/plugin.c
==============================================================================
--- trunk/plugins/document-manager/plugin.c	(original)
+++ trunk/plugins/document-manager/plugin.c	Sun Feb  3 18:56:53 2008
@@ -1840,12 +1840,12 @@
 
 /* Implement IAnjutaDocumentManager interfaces */
 static gchar*
-ianjuta_docman_get_full_filename (IAnjutaDocumentManager *plugin,
-		const gchar *file, GError **e)
+ianjuta_docman_get_uri (IAnjutaDocumentManager *plugin,
+		const gchar *filename, GError **e)
 {
 	AnjutaDocman *docman;
 	docman = ANJUTA_DOCMAN ((ANJUTA_PLUGIN_DOCMAN (plugin)->docman));
-	return anjuta_docman_get_full_filename (docman, file);
+	return anjuta_docman_get_uri (docman, filename);
 }
 
 static IAnjutaDocument*
@@ -1883,21 +1883,21 @@
 }
 
 static IAnjutaEditor*
-ianjuta_docman_goto_file_line (IAnjutaDocumentManager *plugin,
+ianjuta_docman_goto_uri_line (IAnjutaDocumentManager *plugin,
 							   const gchar *uri, gint linenum, GError **e)
 {
 	AnjutaDocman *docman;
 	docman = ANJUTA_DOCMAN ((ANJUTA_PLUGIN_DOCMAN (plugin)->docman));
-	return anjuta_docman_goto_file_line (docman, uri, linenum);
+	return anjuta_docman_goto_uri_line (docman, uri, linenum);
 }
 
 static IAnjutaEditor*
-ianjuta_docman_goto_file_line_mark (IAnjutaDocumentManager *plugin,
+ianjuta_docman_goto_uri_line_mark (IAnjutaDocumentManager *plugin,
 		const gchar *uri, gint linenum, gboolean mark, GError **e)
 {
 	AnjutaDocman *docman;
 	docman = ANJUTA_DOCMAN ((ANJUTA_PLUGIN_DOCMAN (plugin)->docman));
-	return anjuta_docman_goto_file_line_mark (docman, uri, linenum, mark);
+	return anjuta_docman_goto_uri_line_mark (docman, uri, linenum, mark);
 }
 
 /**
@@ -1968,12 +1968,12 @@
 {
 	iface->add_buffer = ianjuta_docman_add_buffer;
 	iface->add_document = ianjuta_docman_add_document;
-	iface->find_document_with_path = ianjuta_docman_get_document_for_uri;
+	iface->find_document_with_uri = ianjuta_docman_get_document_for_uri;
 	iface->get_current_document = ianjuta_docman_get_current_document;
 	iface->get_doc_widgets = ianjuta_docman_get_doc_widgets;
-	iface->get_full_filename = ianjuta_docman_get_full_filename;
-	iface->goto_file_line = ianjuta_docman_goto_file_line;
-	iface->goto_file_line_mark = ianjuta_docman_goto_file_line_mark;
+	iface->get_uri = ianjuta_docman_get_uri;
+	iface->goto_uri_line = ianjuta_docman_goto_uri_line;
+	iface->goto_uri_line_mark = ianjuta_docman_goto_uri_line_mark;
 	iface->remove_document = ianjuta_docman_remove_document;
 	iface->set_current_document = ianjuta_docman_set_current_document;
 }
@@ -1985,7 +1985,7 @@
 	AnjutaDocman *docman;
 	
 	docman = ANJUTA_DOCMAN ((ANJUTA_PLUGIN_DOCMAN (plugin)->docman));
-	anjuta_docman_goto_file_line_mark (docman, uri, -1, FALSE);
+	anjuta_docman_goto_uri_line_mark (docman, uri, -1, FALSE);
 }
 
 static gchar*

Modified: trunk/plugins/profiler/gprof-view.c
==============================================================================
--- trunk/plugins/profiler/gprof-view.c	(original)
+++ trunk/plugins/profiler/gprof-view.c	Sun Feb  3 18:56:53 2008
@@ -137,7 +137,7 @@
 			file = ianjuta_symbol_file (symbol, NULL);
 			line = ianjuta_symbol_line (symbol, NULL);
 			
-			ianjuta_document_manager_goto_file_line (self->priv->document_manager, 
+			ianjuta_document_manager_goto_uri_line (self->priv->document_manager, 
 													 file, line, NULL);
 			
 			g_object_unref (symbol_iter);

Modified: trunk/plugins/search/search-replace.c
==============================================================================
--- trunk/plugins/search/search-replace.c	(original)
+++ trunk/plugins/search/search-replace.c	Sun Feb  3 18:56:53 2008
@@ -451,8 +451,8 @@
 							if (fb->te)
 								ianjuta_editor_goto_line (fb->te, mi->line, NULL);
 							else
-								fb->te = ianjuta_document_manager_goto_file_line_mark
-									(sr->docman, fb->path, mi->line, FALSE, NULL);
+								fb->te = ianjuta_document_manager_goto_uri_line_mark
+									(sr->docman, fb->uri, mi->line, FALSE, NULL);
 							found_line = mi->line;
 						}
 						{
@@ -477,8 +477,8 @@
 							if (fb->te)
 								ianjuta_editor_goto_line (fb->te, mi->line, NULL);
 							else
-								fb->te = ianjuta_document_manager_goto_file_line_mark
-									(sr->docman, fb->path, mi->line, FALSE, NULL);
+								fb->te = ianjuta_document_manager_goto_uri_line_mark
+									(sr->docman, fb->uri, mi->line, FALSE, NULL);
 							found_line = mi->line;
 							}
 
@@ -702,7 +702,7 @@
 	line = atoi(nline);
 	
 	uri = gnome_vfs_get_uri_from_local_path (path);  
-	ianjuta_document_manager_goto_file_line_mark (sr->docman, uri, line, TRUE, NULL);
+	ianjuta_document_manager_goto_uri_line_mark (sr->docman, uri, line, TRUE, NULL);
 	g_free(uri);
 	g_free(path);
 	g_free(nline);

Modified: trunk/plugins/search/search-replace_backend.c
==============================================================================
--- trunk/plugins/search/search-replace_backend.c	(original)
+++ trunk/plugins/search/search-replace_backend.c	Sun Feb  3 18:56:53 2008
@@ -152,6 +152,8 @@
 	{
 		if (fb->path)
 			g_free(fb->path);
+		if (fb->uri)
+			g_free (fb->uri);
 		if (fb->buf)
 			g_free(fb->buf);
 		if (fb->lines)
@@ -166,6 +168,7 @@
 {
 	FileBuffer *fb;
 	gchar* uri;
+	gchar* path;
 	
 	g_return_val_if_fail(te, NULL);
 	fb = g_new0(FileBuffer, 1);
@@ -173,11 +176,13 @@
 	fb->te = te;
 	
 	uri = ianjuta_file_get_uri(IANJUTA_FILE(te), NULL);
-	if (uri)
+	path = gnome_vfs_get_local_path_from_uri(uri);
+	if (path)
 	{
-		fb->path = tm_get_real_path(uri);
-		g_free (uri);
+		fb->path = tm_get_real_path(path);
+		g_free (path);
 	}
+	fb->uri = uri;
 	fb->len = ianjuta_editor_get_length(te, NULL);
 	fb->buf = ianjuta_editor_get_text_all (fb->te, NULL);
 	fb->pos = ianjuta_editor_get_offset(fb->te, NULL);
@@ -193,6 +198,7 @@
 	IAnjutaEditor *te;
 	IAnjutaDocument* doc;
 	char *real_path;
+	char *uri;
 	int i;
 	int lineno;
 
@@ -200,8 +206,10 @@
 	real_path = tm_get_real_path(path);
 	
 	/* There might be an already open TextEditor with this path */
-	doc = ianjuta_document_manager_find_document_with_path (sr->docman,
-														 real_path, NULL);
+	uri = gnome_vfs_get_uri_from_local_path (real_path);
+	doc = ianjuta_document_manager_find_document_with_uri (sr->docman,
+														 uri, NULL);
+
 	if (doc && IANJUTA_IS_EDITOR (doc))
 	{
 		te = IANJUTA_EDITOR (doc);
@@ -211,6 +219,7 @@
 	fb = g_new0(FileBuffer, 1);
 	fb->type = FB_FILE;
 	fb->path = real_path;
+	fb->uri = uri;
 	fb->name = strrchr(path, '/');
 	if (fb->name)
 		++ fb->name;

Modified: trunk/plugins/search/search-replace_backend.h
==============================================================================
--- trunk/plugins/search/search-replace_backend.h	(original)
+++ trunk/plugins/search/search-replace_backend.h	Sun Feb  3 18:56:53 2008
@@ -157,6 +157,7 @@
 	/* The following are valid only for files loaded from disk */
 	gchar *name; /* Name of the file */
 	gchar *path; /* Full path to the file */
+	gchar *uri;  /* URI to the file */
 	gchar *buf; /* Contents of the file */
 	gint len; /* Length of the buffer */
 	gint pos; /* Current position */

Modified: trunk/plugins/symbol-browser/plugin.c
==============================================================================
--- trunk/plugins/symbol-browser/plugin.c	(original)
+++ trunk/plugins/symbol-browser/plugin.c	Sun Feb  3 18:56:53 2008
@@ -90,7 +90,7 @@
 										 NULL);
 		
 	uri = gnome_vfs_get_uri_from_local_path (filename);
-	ianjuta_document_manager_goto_file_line (docman, uri, lineno, NULL);
+	ianjuta_document_manager_goto_uri_line (docman, uri, lineno, NULL);
 	g_free (uri);
 }
 

Modified: trunk/plugins/tools/editor.c
==============================================================================
--- trunk/plugins/tools/editor.c	(original)
+++ trunk/plugins/tools/editor.c	Sun Feb  3 18:56:53 2008
@@ -821,7 +821,7 @@
 			uri = gnome_vfs_get_uri_from_local_path(data);
 			g_free (data);
 			doc =
-				ianjuta_document_manager_find_document_with_path 
+				ianjuta_document_manager_find_document_with_uri 
 							   (docman, uri, NULL);
 			if (doc == NULL)
 			{



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