[Monodevelop-patches-list] r2452 - trunk/MonoDevelop/Extras/MonoDeveloperExtensions

Lluis Sanchez <lluis@ximian.com> lluis at mono-cvs.ximian.com
Thu Apr 14 07:02:29 EDT 2005


Author: lluis
Date: 2005-04-14 07:02:28 -0400 (Thu, 14 Apr 2005)
New Revision: 2452

Modified:
   trunk/MonoDevelop/Extras/MonoDeveloperExtensions/ChangeLog
   trunk/MonoDevelop/Extras/MonoDeveloperExtensions/MonoProject.cs
Log:
2005-04-07  Lluis Sanchez Gual  <lluis at novell.com>

	* MonoProject.cs: Look for ChangeLog files in a more rational 
	(and faster) way.



Modified: trunk/MonoDevelop/Extras/MonoDeveloperExtensions/ChangeLog
===================================================================
--- trunk/MonoDevelop/Extras/MonoDeveloperExtensions/ChangeLog	2005-04-13 23:39:57 UTC (rev 2451)
+++ trunk/MonoDevelop/Extras/MonoDeveloperExtensions/ChangeLog	2005-04-14 11:02:28 UTC (rev 2452)
@@ -1,3 +1,8 @@
+2005-04-07  Lluis Sanchez Gual  <lluis at novell.com>
+
+	* MonoProject.cs: Look for ChangeLog files in a more rational 
+	(and faster) way.
+
 2005-05-07  Lluis Sanchez Gual  <lluis at novell.com>
 
 	* MonoProject.cs: Update the sources file when files are renamed.

Modified: trunk/MonoDevelop/Extras/MonoDeveloperExtensions/MonoProject.cs
===================================================================
--- trunk/MonoDevelop/Extras/MonoDeveloperExtensions/MonoProject.cs	2005-04-13 23:39:57 UTC (rev 2451)
+++ trunk/MonoDevelop/Extras/MonoDeveloperExtensions/MonoProject.cs	2005-04-14 11:02:28 UTC (rev 2452)
@@ -75,22 +75,30 @@
 			outFile = Path.Combine (basePath, aname);
 			FileName = mkfile.FileName;
 			
+			ArrayList checkedFolders = new ArrayList ();
+			
 			// Parse projects
 			string sources = outFile + ".sources";
 			StreamReader sr = new StreamReader (sources);
 			string line;
 			while ((line = sr.ReadLine ()) != null) {
 				line = line.Trim (' ','\t');
-				if (line != "") ProjectFiles.Add (new ProjectFile (Path.Combine (basePath, line)));
+				if (line != "") {
+					string fname = Path.Combine (basePath, line);
+					ProjectFiles.Add (new ProjectFile (fname));
+					
+					string dir = Path.GetDirectoryName (fname);
+					if (!checkedFolders.Contains (dir)) {
+						checkedFolders.Add (dir);
+						fname = Path.Combine (dir, "ChangeLog");
+						if (File.Exists (fname))
+							ProjectFiles.Add (new ProjectFile (fname, BuildAction.Exclude));
+					}
+				}
 			}
 			
 			sr.Close ();
 			
-/*			ArrayList files = new ArrayList ();
-			FindFiles (basePath, "ChangeLog", files);
-			foreach (string file in files)
-				ProjectFiles.Add (new ProjectFile (file, BuildAction.Exclude));
-*/			
 			// Project references
 			string refs = mkfile.GetVariable ("LIB_MCS_FLAGS");
 			if (refs == null || refs == "") refs = mkfile.GetVariable ("LOCAL_MCS_FLAGS");
@@ -123,13 +131,6 @@
 			Runtime.ProjectService.CombineOpened += new CombineEventHandler (CombineOpened);
 		}
 		
-		void FindFiles (string path, string name, ArrayList files)
-		{
-			files.AddRange (Directory.GetFiles (path, name));
-			foreach (string sd in Directory.GetDirectories (path))
-				FindFiles (sd, name, files);
-		}
-		
 		static Regex regexError = new Regex (@"^(\s*(?<file>.*)\((?<line>\d*)(,(?<column>\d*))?\)\s+)*(?<level>\w+)\s*(?<number>.*):\s(?<message>.*)",
 				RegexOptions.Compiled | RegexOptions.ExplicitCapture);
 				




More information about the Monodevelop-patches-list mailing list