beagle r4822 - in trunk/beagle/search: Beagle.Search Beagle.Search.Tiles



Author: dbera
Date: Wed Jul  9 16:31:09 2008
New Revision: 4822
URL: http://svn.gnome.org/viewvc/beagle?rev=4822&view=rev

Log:
Fix a typo and keep track of the number of results that could not be shown due to unavailable tile.


Modified:
   trunk/beagle/search/Beagle.Search.Tiles/File.cs
   trunk/beagle/search/Beagle.Search/SearchWindow.cs

Modified: trunk/beagle/search/Beagle.Search.Tiles/File.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search.Tiles/File.cs	(original)
+++ trunk/beagle/search/Beagle.Search.Tiles/File.cs	Wed Jul  9 16:31:09 2008
@@ -89,7 +89,7 @@
 
 			title = hit.GetFirstProperty ("dc:title");
 
-			if (! String.IsNullOrEmpty (title))
+			if (String.IsNullOrEmpty (title))
 				title = hit.GetFirstProperty ("beagle:ExactFilename");
 
 			return title;

Modified: trunk/beagle/search/Beagle.Search/SearchWindow.cs
==============================================================================
--- trunk/beagle/search/Beagle.Search/SearchWindow.cs	(original)
+++ trunk/beagle/search/Beagle.Search/SearchWindow.cs	Wed Jul  9 16:31:09 2008
@@ -445,11 +445,14 @@
 
 		private void OnHitsAdded (HitsAddedResponse response)
 		{
+			int missed_tiles = 0;
+
 			foreach (Hit hit in response.Hits) {
 				Tile tile = TileActivatorOrg.MakeTile (hit, current_query);
 
 				if (tile == null) {
 					Console.WriteLine ("No tile found for: {0} ({1})", hit.Uri, hit.Type);
+					missed_tiles ++;
 					continue;
 				}
 
@@ -460,7 +463,7 @@
 			}
 
 			if (response.NumMatches != -1)
-				TotalMatches += response.NumMatches;
+				TotalMatches += (response.NumMatches - missed_tiles);
 		}
 
 		private void OnHitsSubtracted (HitsSubtractedResponse response)
@@ -621,7 +624,6 @@
 					if (tile_count == this.total_matches)
 						message = String.Format (Catalog.GetPluralString ("Showing {0} match", "Showing all {0} matches", this.total_matches), this.total_matches);
 					else
-					// .
 						message = String.Format (Catalog.GetString ("Too many matches. Showing latest {0} of total {1}"), view.TileCount, this.total_matches);
 
 					this.statusbar.Push (0, message);



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