[scaffold] do not reopen the same file

aurelien naldi <[email protected]>
Newsgroups gmane.comp.gnome.devtools
Message-ID <1070558437.1348.64.camel@localhost>
the attached patch prevents scaffold from opening twice the same file

the problem was that the project manager opened file with a path
prefixed by "file://" and clicked on a compile error didn't prefix the
path

-- 
aurelien
scaffold_docman.patch (text/x-patch, 993 B)
Index: scaffold-document-manager.c
===================================================================
RCS file: /cvs/gnome/scaffold/plugins/document-manager/scaffold-document-manager.c,v
retrieving revision 1.35
diff -u -r1.35 scaffold-document-manager.c
--- scaffold-document-manager.c	14 Sep 2003 17:32:40 -0000	1.35
+++ scaffold-document-manager.c	4 Dec 2003 17:12:07 -0000
@@ -1171,6 +1171,10 @@
 
 		return NULL;
 	}
+	/* update string_uri to get the full path: prevents conflicts beetwen 
+	 * file:///path/to/file and /path/to/file
+	 */
+	string_uri = gnome_vfs_uri_to_string(uri,GNOME_VFS_URI_HIDE_NONE);
 	gnome_vfs_uri_unref (uri);
 
 	/* Only open the file if its not already opened. */
@@ -1181,6 +1185,7 @@
 	if (document) {
 		scaffold_document_manager_show_document (scaffold_docman, 
 						       document);
+		g_free(string_uri);
 		return document;
 	}
 
@@ -1203,6 +1208,7 @@
 		set_current_document(docman, document);
 	}
 
+	g_free(string_uri);
 	return document;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.