Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] prevent external files from opening in multiple editors (related: bug 52128)

This patch prevents external files from opening a new editor each time when reopening the same file.

-Chris
Index: src/org/eclipse/cdt/core/resources/FileStorage.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 FileStorage.java
--- src/org/eclipse/cdt/core/resources/FileStorage.java	23 Sep 2002 15:02:26 -0000	1.1
+++ src/org/eclipse/cdt/core/resources/FileStorage.java	25 Feb 2004 17:38:14 -0000
@@ -75,4 +75,16 @@
 	public String toString() {
 		return path.toOSString();
 	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj instanceof IStorage) {
+			IPath path= getFullPath();
+			IPath objPath= ((IStorage)obj).getFullPath();
+			if (path != null && objPath != null)
+				return path.equals(objPath);
+		}
+		return super.equals(obj);
+	}
 }

Back to the top