[Monodevelop-patches-list] r2012 - in trunk/MonoDevelop/Core/src/Main/Base: . Services/File

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Nov 1 12:57:56 EST 2004


Author: tberman
Date: 2004-11-01 12:57:56 -0500 (Mon, 01 Nov 2004)
New Revision: 2012

Modified:
   trunk/MonoDevelop/Core/src/Main/Base/ChangeLog
   trunk/MonoDevelop/Core/src/Main/Base/Services/File/RecentOpen.cs
Log:
fix a weird little recent files bug the prevented renaming from the project browser.


Modified: trunk/MonoDevelop/Core/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/ChangeLog	2004-10-30 03:46:33 UTC (rev 2011)
+++ trunk/MonoDevelop/Core/src/Main/Base/ChangeLog	2004-11-01 17:57:56 UTC (rev 2012)
@@ -1,3 +1,10 @@
+2004-11-01  Todd Berman  <tberman at off.net>
+
+	* Services/File/RecentOpen.cs: Properly handle if the renaming occurs
+	on a Directory, or if it is using SourceFile instead of FileName.
+
+	Need to investigate why SourceFile and FileName both exist.
+
 2004-10-29  Todd Berman  <tberman at off.net>
 
 	* Commands/FileCommands: Fix SaveAs.

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/File/RecentOpen.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/File/RecentOpen.cs	2004-10-30 03:46:33 UTC (rev 2011)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/File/RecentOpen.cs	2004-11-01 17:57:56 UTC (rev 2012)
@@ -123,13 +123,22 @@
 		
 		public void FileRemoved(object sender, FileEventArgs e)
 		{
+			if (e.IsDirectory)
+				return;
+			
 			recentFiles.RemoveItem (new Uri (e.FileName));
 			UpdateLastFile ();
 		}
 		
 		public void FileRenamed(object sender, FileEventArgs e)
 		{
-			recentFiles.RenameItem (new Uri (e.FileName), new Uri (e.TargetFile));
+			if (e.IsDirectory)
+				return;
+			
+			if (e.FileName == null)
+				recentFiles.RenameItem (new Uri (e.SourceFile), new Uri (e.TargetFile));
+			else
+				recentFiles.RenameItem (new Uri (e.FileName), new Uri (e.TargetFile));
 			UpdateLastFile ();
 		}
 




More information about the Monodevelop-patches-list mailing list