Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/beagle/ChangeLog,v
retrieving revision 1.95
diff -u -r1.95 ChangeLog
--- ChangeLog	18 Mar 2005 11:56:03 -0000	1.95
+++ ChangeLog	18 Mar 2005 14:35:59 -0000
@@ -1,5 +1,11 @@
 2005-02-18  Veerapuram Varadhan	 <vvaradhan@novell.com>
 
+	* beagled/FileSystemQueryable/FileSystemQueryable.cs,
+	beagled/FileSystemQueryable/DirectoryIndexableGenerator.cs: Fix
+	for http://bugzilla.gnome.org/show_bug.cgi?id=170437.
+	
+2005-02-18  Veerapuram Varadhan	 <vvaradhan@novell.com>
+
 	* Filters/FilterOpenOffice.cs: More odt-mime-type changes.
 	
 2005-02-17  Veerapuram Varadhan	 <vvaradhan@novell.com>
Index: beagled/FileSystemQueryable/FileSystemQueryable.cs
===================================================================
RCS file: /cvs/gnome/beagle/beagled/FileSystemQueryable/FileSystemQueryable.cs,v
retrieving revision 1.50
diff -u -r1.50 FileSystemQueryable.cs
--- beagled/FileSystemQueryable/FileSystemQueryable.cs	16 Mar 2005 20:34:22 -0000	1.50
+++ beagled/FileSystemQueryable/FileSystemQueryable.cs	18 Mar 2005 14:35:59 -0000
@@ -99,6 +99,12 @@
 			FileSystemModel.RequiredAction action;
 			string old_path;
 
+			Uri file_uri = UriFu.PathToFileUri (path);
+			if (file_uri.LocalPath != path) {
+				Logger.Log.Warn ("Path conversion error. '{0}' is converted as '{1}', which is not a valid conversion.", path, file_uri.LocalPath);
+				return;
+			}
+			
 			// Model.DetermineRequiredAction checks whether or not we should
 			// ignore the path, so we don't need to do that separately.
 			action = Model.DetermineRequiredAction (path, out old_path);
@@ -112,9 +118,8 @@
 			}
 
 			Scheduler.Task task;
-			Indexable indexable;
-				
-			Uri file_uri = UriFu.PathToFileUri (path);
+			Indexable indexable;			      			
+
 			Uri internal_uri = model.ToInternalUri (file_uri);
 			indexable = FileToIndexable (file_uri, internal_uri, false);
 			task = NewAddTask (indexable);
@@ -173,10 +178,16 @@
 
 			Uri old_uri = UriFu.PathToFileUri (old_path);
 			Uri new_uri = UriFu.PathToFileUri (new_path);
-			Scheduler.Task task;
-			task = NewRenameTask (old_uri, new_uri);
-			task.Priority = priority;
-			ThisScheduler.Add (task);
+			
+			if (new_uri.LocalPath == new_path) {
+				Scheduler.Task task;
+				task = NewRenameTask (old_uri, new_uri);
+				task.Priority = priority;
+				ThisScheduler.Add (task);
+			} else {
+				Logger.Log.Warn ("Path conversion error. '{0}' is converted as '{1}', which is not a valid conversion.", new_path, new_uri.LocalPath);
+			}
+
 		}
 
 		public void Rename (string old_path, string new_path)
Index: beagled/FileSystemQueryable/DirectoryIndexableGenerator.cs
===================================================================
RCS file: /cvs/gnome/beagle/beagled/FileSystemQueryable/DirectoryIndexableGenerator.cs,v
retrieving revision 1.3
diff -u -r1.3 DirectoryIndexableGenerator.cs
--- beagled/FileSystemQueryable/DirectoryIndexableGenerator.cs	13 Mar 2005 12:05:02 -0000	1.3
+++ beagled/FileSystemQueryable/DirectoryIndexableGenerator.cs	18 Mar 2005 14:35:59 -0000
@@ -63,6 +63,12 @@
 			FileSystemModel.RequiredAction action;
 			string old_path;
 
+			Uri file_uri = UriFu.PathToFileUri (path);
+			if (file_uri.LocalPath != path) {
+				Logger.Log.Warn ("Path conversion error. '{0}' is converted as '{1}', which is not a valid conversion.", path, file_uri.LocalPath);
+				return null;
+			}
+
 			action = model.DetermineRequiredAction (path, out old_path);
 			
 			if (action == FileSystemModel.RequiredAction.None)
@@ -73,7 +79,6 @@
 				return null;
 			}
 			
-			Uri file_uri = UriFu.PathToFileUri (path);
 			Uri internal_uri = model.ToInternalUri (file_uri);
 			return FileSystemQueryable.FileToIndexable (file_uri, internal_uri, true);
 		}
@@ -85,9 +90,22 @@
 
 			while (files.MoveNext ()) {
 				FileInfo f = files.Current as FileInfo;
-				Indexable indexable = BuildIndexableForPath (f.FullName);
-				if (indexable != null)
-					return indexable;
+
+				// This condition is added as a fix for
+				// http://bugzilla.gnome.org/show_bug.cgi?id=170437
+				// Avoid exception trace messages.
+				if (f.Exists) {
+					Indexable indexable = BuildIndexableForPath (f.FullName);
+					if (indexable != null)
+						return indexable;
+				} else {
+					Logger.Log.Warn ("'{0}' not found.", f.FullName);
+					Logger.Log.Debug ("Can be because of ...");
+					Logger.Log.Debug ("\t 1) Path contained '\\' character, which gets converted to '/' in Mono.  Refer to http://bugzilla.ximian.com/show_bug.cgi?id=71214 for more details.");
+					Logger.Log.Debug ("\t 2) Somebody deleted it after the creation of DIG object");
+					Logger.Log.Debug ("\t 3) Somebody renamed it after the creation of DIG object");
+					return null;
+				}
 			}
 
 			done = true;
