[scaffold] do not reopen the same file



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
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;
 }
 


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