beagle r4575 - in branches/beagle-lucene2_1: . BeagleClient Filters Util beagled beagled/EvolutionMailQueryable beagled/FileSystemQueryable beagled/KMailQueryable beagled/KonqHistoryQueryable beagled/NetworkServicesQueryable beagled/ThunderbirdQueryable beagled/webinterface conf-data po search search/Beagle.Search search/Beagle.Search.Pages search/Beagle.Search.Tiles search/Beagle.Search.Tray search/Pages search/Tiles search/Tray tools



Author: dbera
Date: Mon Mar  3 21:43:30 2008
New Revision: 4575
URL: http://svn.gnome.org/viewvc/beagle?rev=4575&view=rev

Log:
Merge from trunk 4472:4574(HEAD).


Added:
   branches/beagle-lucene2_1/beagled/webinterface/opensearch.xml
      - copied unchanged from r4574, /trunk/beagle/beagled/webinterface/opensearch.xml
   branches/beagle-lucene2_1/search/AssemblyInfo.cs
      - copied unchanged from r4574, /trunk/beagle/search/AssemblyInfo.cs
   branches/beagle-lucene2_1/search/Beagle.Search/
      - copied from r4574, /trunk/beagle/search/Beagle.Search/
   branches/beagle-lucene2_1/search/Beagle.Search.Pages/
      - copied from r4574, /trunk/beagle/search/Beagle.Search.Pages/
   branches/beagle-lucene2_1/search/Beagle.Search.Tiles/
      - copied from r4574, /trunk/beagle/search/Beagle.Search.Tiles/
   branches/beagle-lucene2_1/search/Beagle.Search.Tray/
      - copied from r4574, /trunk/beagle/search/Beagle.Search.Tray/
   branches/beagle-lucene2_1/tools/StaticQuery.cs
      - copied unchanged from r4574, /trunk/beagle/tools/StaticQuery.cs
Removed:
   branches/beagle-lucene2_1/search/Category.cs
   branches/beagle-lucene2_1/search/DetailsPane.cs
   branches/beagle-lucene2_1/search/Entry.cs
   branches/beagle-lucene2_1/search/GroupView.cs
   branches/beagle-lucene2_1/search/ListCategory.cs
   branches/beagle-lucene2_1/search/NotificationArea.cs
   branches/beagle-lucene2_1/search/Pages/
   branches/beagle-lucene2_1/search/Panes.cs
   branches/beagle-lucene2_1/search/Search.cs
   branches/beagle-lucene2_1/search/SortedTileList.cs
   branches/beagle-lucene2_1/search/Spinner.cs
   branches/beagle-lucene2_1/search/TileCategory.cs
   branches/beagle-lucene2_1/search/Tiles/
   branches/beagle-lucene2_1/search/Tray/
   branches/beagle-lucene2_1/search/TypeFilter.cs
   branches/beagle-lucene2_1/search/UIManager.cs
   branches/beagle-lucene2_1/search/WidgetFu.cs
Modified:
   branches/beagle-lucene2_1/BeagleClient/AssemblyInfo.cs
   branches/beagle-lucene2_1/BeagleClient/Hit.cs
   branches/beagle-lucene2_1/BeagleClient/Indexable.cs
   branches/beagle-lucene2_1/BeagleClient/Property.cs
   branches/beagle-lucene2_1/BeagleClient/Query.cs
   branches/beagle-lucene2_1/BeagleClient/QueryResponses.cs
   branches/beagle-lucene2_1/BeagleClient/Snippet.cs
   branches/beagle-lucene2_1/ChangeLog
   branches/beagle-lucene2_1/Filters/FilterEbuild.cs
   branches/beagle-lucene2_1/Filters/FilterXslt.cs
   branches/beagle-lucene2_1/Util/StringFu.cs
   branches/beagle-lucene2_1/Util/SystemInformation.cs
   branches/beagle-lucene2_1/beagled/AssemblyInfo.cs
   branches/beagle-lucene2_1/beagled/BuildIndex.cs
   branches/beagle-lucene2_1/beagled/EvolutionMailQueryable/EvolutionMailQueryable.cs
   branches/beagle-lucene2_1/beagled/ExternalMetadataQueryable.cs
   branches/beagle-lucene2_1/beagled/FileSystemQueryable/FileSystemQueryable.cs
   branches/beagle-lucene2_1/beagled/Filter.cs
   branches/beagle-lucene2_1/beagled/FilterFactory.cs
   branches/beagle-lucene2_1/beagled/Flavor.cs
   branches/beagle-lucene2_1/beagled/IQueryable.cs
   branches/beagle-lucene2_1/beagled/KMailQueryable/KMailIndexer.cs
   branches/beagle-lucene2_1/beagled/KonqHistoryQueryable/KonqQueryable.cs
   branches/beagle-lucene2_1/beagled/LuceneIndexingDriver.cs
   branches/beagle-lucene2_1/beagled/LuceneQueryable.cs
   branches/beagle-lucene2_1/beagled/LuceneQueryingDriver.cs
   branches/beagle-lucene2_1/beagled/Makefile.am
   branches/beagle-lucene2_1/beagled/NetworkServicesQueryable/NetworkServicesQueryable.cs
   branches/beagle-lucene2_1/beagled/QueryDriver.cs
   branches/beagle-lucene2_1/beagled/QueryExecutor.cs
   branches/beagle-lucene2_1/beagled/Queryable.cs
   branches/beagle-lucene2_1/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs
   branches/beagle-lucene2_1/beagled/WebServer.cs
   branches/beagle-lucene2_1/beagled/beagled-index-helper.in
   branches/beagle-lucene2_1/beagled/webinterface/index.xsl
   branches/beagle-lucene2_1/conf-data/   (props changed)
   branches/beagle-lucene2_1/configure.in
   branches/beagle-lucene2_1/po/ChangeLog
   branches/beagle-lucene2_1/po/POTFILES.in
   branches/beagle-lucene2_1/po/ca.po
   branches/beagle-lucene2_1/po/es.po
   branches/beagle-lucene2_1/po/eu.po
   branches/beagle-lucene2_1/po/fi.po
   branches/beagle-lucene2_1/po/ja.po
   branches/beagle-lucene2_1/po/nb.po
   branches/beagle-lucene2_1/po/oc.po
   branches/beagle-lucene2_1/po/pt_BR.po
   branches/beagle-lucene2_1/po/sv.po
   branches/beagle-lucene2_1/search/Makefile.am
   branches/beagle-lucene2_1/search/beagle-search.in
   branches/beagle-lucene2_1/tools/   (props changed)
   branches/beagle-lucene2_1/tools/Makefile.am
   branches/beagle-lucene2_1/tools/Query.cs

Modified: branches/beagle-lucene2_1/BeagleClient/AssemblyInfo.cs
==============================================================================
--- branches/beagle-lucene2_1/BeagleClient/AssemblyInfo.cs	(original)
+++ branches/beagle-lucene2_1/BeagleClient/AssemblyInfo.cs	Mon Mar  3 21:43:30 2008
@@ -30,13 +30,14 @@
 
 // Any request message types in the Beagle.dll file must be registered here.
 [assembly: RequestMessageTypes (
+	 typeof (CountMatchQuery),
+	 typeof (DaemonInformationRequest),
 	 typeof (IndexingServiceRequest),
 	 typeof (InformationalMessagesRequest),
+	 typeof (OptimizeIndexesRequest),
 	 typeof (Query),
-	 typeof (DaemonInformationRequest),
-	 typeof (ShutdownRequest),
 	 typeof (ReloadConfigRequest),
-	 typeof (OptimizeIndexesRequest),
+	 typeof (ShutdownRequest),
 	 typeof (SnippetRequest)
 )]
 	 
@@ -49,5 +50,6 @@
 	 typeof (IndexingStatusResponse),
 	 typeof (SearchTermResponse),
 	 typeof (DaemonInformationResponse),
-	 typeof (SnippetResponse)
+	 typeof (SnippetResponse),
+	 typeof (CountMatchQueryResponse)
 )]

Modified: branches/beagle-lucene2_1/BeagleClient/Hit.cs
==============================================================================
--- branches/beagle-lucene2_1/BeagleClient/Hit.cs	(original)
+++ branches/beagle-lucene2_1/BeagleClient/Hit.cs	Mon Mar  3 21:43:30 2008
@@ -93,6 +93,7 @@
 			set { parent_uri = value; }
 		}
 
+		
 		[XmlAttribute ("ParentUri")]
 		public string EscapedParentUri {
 			get {
@@ -110,25 +111,34 @@
 			}
 		}
 
-		// File, WebHistory, MailMessage, IMLog, etc.
+		/// <value>
+		/// File, WebHistory, MailMessage, IMLog, etc.
+		/// </value>
 		[XmlIgnore]
 		public string Type {
 			get { return GetFirstProperty ("beagle:HitType"); }
 		}
 
-		// If applicable otherwise can be null.
+		/// <value>
+		/// If applicable otherwise can be null.
+		/// </value>
 		[XmlIgnore]
 		public string MimeType {
 			get { return GetFirstProperty ("beagle:MimeType"); }
 		}
 	
-		// IndexUser, IndexSystem, Google, Addressbook, iFolder, etc.
+		
+		/// <value>
+		/// IndexUser, IndexSystem, Google, Addressbook, iFolder, etc.
+		/// </value>
 		[XmlIgnore]
 		public string Source {
 			get { return GetFirstProperty ("beagle:Source"); }
 		}
 
-		// document, archive, image etc.
+		/// <summary>
+		/// document, archive, image etc.
+		/// </summary>
 		[XmlIgnore]
 		public string FileType {
 			get { return GetFirstProperty ("beagle:FileType"); }
@@ -332,7 +342,7 @@
 					return null;
 
 				if (top - first != 1) {
-					Logger.Log.Warn ("Accessed multi-property key '(0}' with Hit's indexer.");
+					Logger.Log.Warn ("Accessed multi-property key '{0}' with Hit's indexer.", key);
 					return null;
 				}
 

Modified: branches/beagle-lucene2_1/BeagleClient/Indexable.cs
==============================================================================
--- branches/beagle-lucene2_1/BeagleClient/Indexable.cs	(original)
+++ branches/beagle-lucene2_1/BeagleClient/Indexable.cs	Mon Mar  3 21:43:30 2008
@@ -91,9 +91,12 @@
 
 		// Is this being indexed because of crawling or other
 		// background activity?
-		// If crawl is set, then the underlying file will be flushed
+		// If set, then the underlying file will be flushed
 		// from buffer cache as soon as it is indexed.
-		private bool crawled = true;
+		// Set it to true when the buffer cache should not
+		// be disturbed due to this indexable (e.g. during
+		// crawling).
+		private bool flush_buffer_cache = false;
 
 		// Is this object inherently contentless?
 		private bool no_content = false;
@@ -277,10 +280,10 @@
 			get { return ! DeleteContent && ContentUri.IsFile && ParentUri == null; }
 		}
 
-		[XmlAttribute]
-		public bool Crawled {
-			get { return crawled; }
-			set { crawled = value; }
+		[XmlAttribute ("Crawled")]
+		public bool FlushBufferCache {
+			get { return flush_buffer_cache; }
+			set { flush_buffer_cache = value; }
 		}
 
 		[XmlAttribute]

Modified: branches/beagle-lucene2_1/BeagleClient/Property.cs
==============================================================================
--- branches/beagle-lucene2_1/BeagleClient/Property.cs	(original)
+++ branches/beagle-lucene2_1/BeagleClient/Property.cs	Mon Mar  3 21:43:30 2008
@@ -40,7 +40,9 @@
 		Date     = 3
 	}
 
-	/* IEnumerable class to serialize properties with non-private namespace. */
+	/// <summary>
+	///  IEnumerable class to serialize properties with non-private namespace.
+	/// </summary>
 	public class PropertyList : IEnumerable {
 		private ArrayList property_list;
 		
@@ -143,34 +145,45 @@
 			set { this.value = StringFu.CleanupInvalidXmlCharacters (value); }
 		}
 
-		// If IsSearched is true, this property will can be matched by a
-		// general match-any-propety query.
-		// You can always query against the specific property, even if
-		// IsSearched is false.
+		
+		/// <value>
+		/// If IsSearched is true, this property will can be matched by a
+		/// general match-any-propety query.
+		/// You can always query against the specific property, even if
+		/// IsSearched is false.
+		/// </value>
 		[XmlAttribute]
 		public bool IsSearched {
 			get { return is_searched; }
 			set { is_searched = value; }
 		}
 
-		// When IsMutable is true, the property is stored in the secondary
-		// index so that it can more efficiently be changed later on.
+		
+		/// <value>
+		///  When IsMutable is true, the property is stored in the secondary
+		/// index so that it can more efficiently be changed later on.
+		/// </value>
 		[XmlAttribute]
 		public bool IsMutable {
 			get { return is_mutable; }
 			set { is_mutable = value; }
 		}
 
-		// When IsStored is false, the property will be stored as an
-		// "unstored lucene field".
+		/// <value>
+		///  When IsStored is false, the property will be stored as an
+		///  "unstored lucene field".
+		/// </value>
 		[XmlAttribute]
 		public bool IsStored {
 			get { return is_stored; }
 			set { is_stored = value; }
 		}
 
-		// When true, this property is persisted across documents being
-		// readded, for instance if a file is touched on disk.
+		
+		/// <value>
+		/// When true, this property is persisted across documents being
+		/// readded, for instance if a file is touched on disk.
+		/// </value>
 		[XmlAttribute]
 		public bool IsPersistent {
 			get { return is_persistent; }
@@ -305,8 +318,19 @@
 			return String.Format ("{0}={1}", Key, Value);
 		}
 
-		// Standard properties for files
-		// Used by FileSystem backend and filters which produce file child-indexables
+		/// <summary>
+		/// Standard properties for files
+		/// Used by FileSystem backend and filters which produce file child-indexables
+		/// </summary>
+		/// <param name="name">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="mutable">
+		/// A <see cref="System.Boolean"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="IEnumerable"/>
+		/// </returns>
 		public static IEnumerable StandardFileProperties (string name, bool mutable)
 		{
 			StringBuilder sb;

Modified: branches/beagle-lucene2_1/BeagleClient/Query.cs
==============================================================================
--- branches/beagle-lucene2_1/BeagleClient/Query.cs	(original)
+++ branches/beagle-lucene2_1/BeagleClient/Query.cs	Mon Mar  3 21:43:30 2008
@@ -151,8 +151,13 @@
 				parts.Add (part);
 		}
 
-		// This is a human-entered query string that will be parsed in
-		// the daemon.
+		/// <summary>
+		/// This is a human-entered query string that will be parsed in
+		/// the daemon.
+		/// </summary>
+		/// <param name="str">
+		/// A <see cref="System.String"/>
+		/// </param>
 		public void AddText (string str)
 		{
 			QueryPart_Human part = new QueryPart_Human ();
@@ -244,4 +249,25 @@
 			return sb.ToString ();
 		}
 	}
+
+	// Synchronous query to return the number of matches
+	public class CountMatchQuery : Query {
+
+		public CountMatchQuery (string str) : this ()
+		{
+			AddText (str);
+		}
+
+		public CountMatchQuery ()
+		{
+			// RDFQuery is a sync message
+			this.UnregisterAsyncResponseHandler (typeof (HitsAddedResponse));
+			this.UnregisterAsyncResponseHandler (typeof (HitsSubtractedResponse));
+			this.UnregisterAsyncResponseHandler (typeof (FinishedResponse));
+			this.UnregisterAsyncResponseHandler (typeof (ErrorResponse));
+			this.UnregisterAsyncResponseHandler (typeof (SearchTermResponse));
+
+			Keepalive = false;
+		}
+	}
 }

Modified: branches/beagle-lucene2_1/BeagleClient/QueryResponses.cs
==============================================================================
--- branches/beagle-lucene2_1/BeagleClient/QueryResponses.cs	(original)
+++ branches/beagle-lucene2_1/BeagleClient/QueryResponses.cs	Mon Mar  3 21:43:30 2008
@@ -114,4 +114,8 @@
 			StemmedText = new ArrayList ();
 		}
 	}
+
+	public class CountMatchQueryResponse : ResponseMessage {
+		public int NumMatches = 0;
+	}
 }

Modified: branches/beagle-lucene2_1/BeagleClient/Snippet.cs
==============================================================================
--- branches/beagle-lucene2_1/BeagleClient/Snippet.cs	(original)
+++ branches/beagle-lucene2_1/BeagleClient/Snippet.cs	Mon Mar  3 21:43:30 2008
@@ -103,16 +103,22 @@
 	[System.Xml.Serialization.XmlRoot("SnippetLine", Namespace="", IsNullable=false)]
 	[System.Xml.Serialization.XmlType("SnippetLine", Namespace="")]
 	public class SnippetLine {
-		// Line number of the snippet
+		/// <value>
+		/// Line number of the snippet
+		/// </value>
 		[XmlAttribute]
 		public ulong Line;
 
-		// List of fragments
+		/// <value>
+		/// List of fragments
+		/// </value>
 		[XmlElement (ElementName="Fragment", Type=typeof(Fragment))]
 		[XmlArrayItem (ElementName="Fragment", Type=typeof (Fragment))]
 		public ArrayList Fragments;
 
-		// Number of fragments
+		/// <value>
+		/// Number of fragments
+		/// </value>
 		[XmlIgnore]
 		public int Count {
 			get {

Modified: branches/beagle-lucene2_1/Filters/FilterEbuild.cs
==============================================================================
--- branches/beagle-lucene2_1/Filters/FilterEbuild.cs	(original)
+++ branches/beagle-lucene2_1/Filters/FilterEbuild.cs	Mon Mar  3 21:43:30 2008
@@ -32,9 +32,9 @@
 namespace Beagle.Filters {
 
 	public class FilterEbuild : FilterPackage {
-		static Regex metadata_pattern = new Regex ("\\s*(?<key>([A-Z_]+))\\s*=\\s*\"(?<value>(.*))\"\\s*");
-		static Regex einfo_pattern = new Regex ("\\s*(einfo|ewarn)\\s+\"(?<message>(.*))\"\\s*");
-		static Regex package_pattern = new Regex ("(?<name>([^0-9]+))-(?<version>(.+)).ebuild");
+		static Regex metadata_pattern = new Regex ("\\s*(?<key>([A-Z_]+))\\s*=\\s*\"(?<value>(.*))\"\\s*", RegexOptions.Compiled);
+		static Regex einfo_pattern = new Regex ("\\s*(einfo|ewarn)\\s+\"(?<message>(.*))\"\\s*", RegexOptions.Compiled);
+		static Regex package_pattern = new Regex ("(?<name>([^0-9]+))-(?<version>(.+)).ebuild", RegexOptions.Compiled);
 
 		public FilterEbuild () 
 		{
@@ -113,21 +113,24 @@
 				if (desktop_file == null)
 					continue;
 				// verify this is a desktop file
-				StreamReader desktop_reader = new StreamReader (new FileStream (desktop_file.FullName, FileMode.Open, FileAccess.Read, FileShare.Read));
-				string desktop_line = null;
-				bool desktop_valid = false;
-				while ((desktop_line = desktop_reader.ReadLine ()) != null) {
-					if (desktop_line.Trim ().Length > 0) {
-						desktop_valid = desktop_line.Equals ("[Desktop Entry]");
-						break;
+				using (StreamReader desktop_reader = new StreamReader (new FileStream (desktop_file.FullName, FileMode.Open, FileAccess.Read, FileShare.Read))) {
+					string desktop_line = null;
+					bool desktop_valid = false;
+					while ((desktop_line = desktop_reader.ReadLine ()) != null) {
+						if (desktop_line.Trim ().Length > 0) {
+							desktop_valid = desktop_line.Equals ("[Desktop Entry]");
+							break;
+						}
 					}
-				}
 				
-				// add property
-				if (desktop_valid)
-					AddProperty (Beagle.Property.NewUnsearched ("fixme:desktop_file", desktop_file.FullName));
+					// add property
+					if (desktop_valid)
+						AddProperty (Beagle.Property.NewUnsearched ("fixme:desktop_file", desktop_file.FullName));
+				}
 			}
 
+			contents_reader.Close ();
+
 			AddProperty (Beagle.Property.NewUnsearched ("fixme:contents_byte_count", byte_count));
 			AddProperty (Beagle.Property.NewUnsearched ("fixme:contents_file_count", file_count));
 			AddProperty (Beagle.Property.NewUnsearched ("fixme:contents_dir_count", dir_count));

Modified: branches/beagle-lucene2_1/Filters/FilterXslt.cs
==============================================================================
--- branches/beagle-lucene2_1/Filters/FilterXslt.cs	(original)
+++ branches/beagle-lucene2_1/Filters/FilterXslt.cs	Mon Mar  3 21:43:30 2008
@@ -37,8 +37,8 @@
 {
 	public class FilterXslt : Filter 
 	{
-		Regex xpath_variables_regex = new Regex ("\\$(?<name>[\\wS][\\wS\\d-:]*)");
-		Regex xpath_functions_regex = new Regex ("(?<name>[\\wS][\\wS\\d-:]*)\\(");
+		static Regex xpath_variables_regex = new Regex ("\\$(?<name>[\\wS][\\wS\\d-:]*)", RegexOptions.Compiled);
+		static Regex xpath_functions_regex = new Regex ("(?<name>[\\wS][\\wS\\d-:]*)\\(", RegexOptions.Compiled);
 
 		public FilterXslt ()
 		{

Modified: branches/beagle-lucene2_1/Util/StringFu.cs
==============================================================================
--- branches/beagle-lucene2_1/Util/StringFu.cs	(original)
+++ branches/beagle-lucene2_1/Util/StringFu.cs	Mon Mar  3 21:43:30 2008
@@ -48,8 +48,16 @@
 		public static DateTime MinValueUtc = new DateTime (0, DateTimeKind.Utc);
 		public static DateTime MaxValueUtc = new DateTime (DateTime.MaxValue.Ticks, DateTimeKind.Utc);
 
-		// We use this instead of DateTime.ToUniversalTime() because
-		// we want to assume DateTimeKind.Unspecified dates are UTC
+		/// <summary>
+		/// We use this instead of DateTime.ToUniversalTime() because
+		/// we want to assume DateTimeKind.Unspecified dates are UTC
+		/// </summary>
+		/// <param name="dt">
+		/// A <see cref="DateTime"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="DateTime"/>
+		/// </returns>
 		static private DateTime ToUniversalTime (DateTime dt)
 		{
 			switch (dt.Kind) {
@@ -228,12 +236,20 @@
 			return String.Format (Catalog.GetString ("{0:0.0} MB"), len/(double)oneMb);
 		}
 
-		// Here we:
-		// (1) Replace non-alphanumeric characters with spaces
-		// (2) Inject whitespace between lowercase-to-uppercase
-		//     transitions (so "FooBar" becomes "Foo Bar")
-		//     and transitions between letters and numbers
-		//     (so "cvs2svn" becomes "cvs 2 svn")
+		/// <summary>
+		///  Here we:
+		/// (1) Replace non-alphanumeric characters with spaces
+		/// (2) Inject whitespace between lowercase-to-uppercase
+		///     transitions (so "FooBar" becomes "Foo Bar")
+		///     and transitions between letters and numbers
+		///     (so "cvs2svn" becomes "cvs 2 svn")
+		/// </summary>
+		/// <param name="line">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		static public string FuzzyDivide (string line)
 		{
 			// Allocate a space slightly bigger than the
@@ -283,8 +299,19 @@
 			return FuzzyDivide (url.Substring (protocol_index + 3));
 		}
 		
-		// Match strings against patterns that are allowed to contain
-		// glob-style * and ? wildcards.
+		/// <summary>
+		/// 	 Match strings against patterns that are allowed to contain
+		///	 glob-style * and ? wildcards.
+		/// </summary>
+		/// <param name="pattern">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="str">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		static public bool GlobMatch (string pattern, string str)
 		{
 			if (pattern == null || str == null)
@@ -301,9 +328,26 @@
 		
 		private const char WILDCARD_STRING = '*';
 		
-		// Copied from beagled/Lucene.Net/Search/WildcardTermEnum.cs
-		// Simple string matching algorithm with wildcards
-		// '*' matches 0 or more characters
+		/// <summary>
+		/// Copied from beagled/Lucene.Net/Search/WildcardTermEnum.cs
+		/// Simple string matching algorithm with wildcards
+		/// '*' matches 0 or more characters
+		/// </summary>
+		/// <param name="pattern">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="patternIdx">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <param name="text">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="stringIdx">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		private static bool WildcardEquals(System.String pattern, int patternIdx, System.String text, int stringIdx)
 		{
 			int p = patternIdx;
@@ -442,7 +486,15 @@
 			return builder.ToString ();
 		}
 
-		// Translate all %xx codes into real characters
+		/// <summary>
+		/// Translate all %xx codes into real characters
+		/// </summary>
+		/// <param name="str">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		static public string HexUnescape (string str)
 		{
                         int i, pos = 0;
@@ -614,7 +666,21 @@
 			return new string (char_array);
 		}
 		
-		// Words of less than min_word_length characters are not counted
+		/// <summary>
+		/// Words of less than min_word_length characters are not counted
+		/// </summary>
+		/// <param name="str">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <param name="max_words">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <param name="min_word_length">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Int32"/>
+		/// </returns>
 		static public int CountWords (string str, int max_words, int min_word_length)
 		{
 			if (str == null)
@@ -654,7 +720,15 @@
 			return CountWords (str, -1);
 		}
 
-		// Strip trailing slashes and make sure we only have 1 leading slash
+		/// <summary>
+		/// Strip trailing slashes and make sure we only have 1 leading slash
+		/// </summary>
+		/// <param name="path">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		static public string SanitizePath (string path)
 		{
 			if (path.StartsWith ("//")) {
@@ -671,12 +745,20 @@
 			return path;
 		}
 
-		// This method will translate an email address like
-		// "john doe+spamtrap foo com" to "john doe spamtrap foo"
-		//
-		// FIXME: Maybe we should only do the username part?  Ie,
-		// "john doe spamtrap"?  That way searching for "foo" won't
-		// turn up *everything*
+		/// <summary>
+		/// This method will translate an email address like
+		/// "john doe+spamtrap foo com" to "john doe spamtrap foo"
+		///
+		/// FIXME: Maybe we should only do the username part?  Ie,
+		/// "john doe spamtrap"?  That way searching for "foo" won't
+		/// turn up *everything*
+		/// </summary>
+		/// <param name="email">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		static public string SanitizeEmail (string email)
 		{
 			char[] replace_array = { '@', '.', '-', '_', '+' };
@@ -700,10 +782,17 @@
 			return email;
 		}
 
-		/**
-		 * expands environment variables in a string e.g.
-		 * folders=$HOME/.kde/share/...
-		 */
+		
+		/// <summary>
+		/// expands environment variables in a string e.g.
+		/// folders=$HOME/.kde/share/...
+		/// </summary>
+		/// <param name="path">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.String"/>
+		/// </returns>
 		public static string ExpandEnvVariables (string path)
 		{
 			int dollar_pos = path.IndexOf ('$');

Modified: branches/beagle-lucene2_1/Util/SystemInformation.cs
==============================================================================
--- branches/beagle-lucene2_1/Util/SystemInformation.cs	(original)
+++ branches/beagle-lucene2_1/Util/SystemInformation.cs	Mon Mar  3 21:43:30 2008
@@ -114,12 +114,16 @@
 		[DllImport ("libbeagleglue.so")]
 		extern static unsafe int screensaver_glue_init ();
 
-		/*
-		 * BeagleDaemon needs to monitor screensaver status
-		 * for faster scheduling when user is idle.
-		 * IndexHelper does not need to monitor screensaver status.
-		 * XssInit is only called from the BeagleDaemon.
-		 */
+		/// <summary>
+		/// BeagleDaemon needs to monitor screensaver status
+		/// for faster scheduling when user is idle.
+		/// IndexHelper does not need to monitor screensaver status.
+		/// XssInit is only called from the BeagleDaemon.
+		///
+		/// </summary>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public static bool XssInit ()
 		{
 			int has_xss = screensaver_glue_init ();
@@ -174,8 +178,10 @@
 			}
 		}
 
-		// returns number of seconds since input was received
-		// from the user on any input device
+		/// <value>
+		///  returns number of seconds since input was received
+		/// from the user on any input device
+		/// </value>
 		public static double InputIdleTime {
 			get {
 				CheckScreenSaver ();
@@ -345,19 +351,25 @@
 
 		///////////////////////////////////////////////////////////////
 
-		[DllImport("libc")]
-		private static extern int prctl (int option, byte [] arg2, ulong arg3, ulong arg4, ulong arg5);
-
 		// From /usr/include/linux/prctl.h
 		private const int PR_SET_NAME = 15;
 
+		[DllImport("libc")] // Linux
+		private static extern int prctl (int option, byte [] arg2, IntPtr arg3, IntPtr arg4, IntPtr arg5);
+
+		[DllImport ("libc")] // BSD
+		private static extern void setproctitle (byte [] fmt, byte [] str_arg);
+
 		public static void SetProcessName(string name)
 		{
 #if OS_LINUX
-			if (prctl (PR_SET_NAME, Encoding.ASCII.GetBytes (name + '\0'), 0, 0, 0) < 0) {
+			if (prctl (PR_SET_NAME, Encoding.ASCII.GetBytes (name + '\0'), 
+				   IntPtr.Zero, IntPtr.Zero, IntPtr.Zero) < 0) {
 				Logger.Log.Warn ("Couldn't set process name to '{0}': {1}", name,
 						 Mono.Unix.Native.Stdlib.GetLastError ());
 			}
+#elif OS_FREEBSD
+			setproctitle (Encoding.ASCII.GetBytes ("%s\0"), Encoding.ASCII.GetBytes (name + "\0"));
 #endif
 		}
 

Modified: branches/beagle-lucene2_1/beagled/AssemblyInfo.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/AssemblyInfo.cs	(original)
+++ branches/beagle-lucene2_1/beagled/AssemblyInfo.cs	Mon Mar  3 21:43:30 2008
@@ -51,7 +51,8 @@
 	typeof (QueryExecutor),
 	typeof (ReloadConfigExecutor),
 	typeof (ShutdownExecutor),
-	typeof (SnippetExecutor)
+	typeof (SnippetExecutor),
+	typeof (CountMatchQueryExecutor)
 )]
 
 // All backends in this assembly must be registered here.
@@ -76,5 +77,5 @@
 	typeof (Beagle.Daemon.PidginQueryable.PidginQueryable),
 	typeof (Beagle.Daemon.StaticQueryable),
 	typeof (Beagle.Daemon.TomboyQueryable.TomboyQueryable),
-    typeof (Beagle.Daemon.EmpathyQueryable.EmpathyQueryable)                   
+	typeof (Beagle.Daemon.EmpathyQueryable.EmpathyQueryable)                   
 )]

Modified: branches/beagle-lucene2_1/beagled/BuildIndex.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/BuildIndex.cs	(original)
+++ branches/beagle-lucene2_1/beagled/BuildIndex.cs	Mon Mar  3 21:43:30 2008
@@ -642,7 +642,7 @@
 			Uri uri = UriFu.PathToFileUri (file.FullName);
 			Indexable indexable = new Indexable (uri);
 			indexable.Timestamp = file.LastWriteTimeUtc;
-			indexable.Crawled = true;
+			indexable.FlushBufferCache = true;
 			indexable.AddProperty (Property.NewUnsearched ("fixme:filesize", file.Length));
 			FSQ.AddStandardPropertiesToIndexable (indexable, file.Name, Guid.Empty, false);
 

Modified: branches/beagle-lucene2_1/beagled/EvolutionMailQueryable/EvolutionMailQueryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/EvolutionMailQueryable/EvolutionMailQueryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/EvolutionMailQueryable/EvolutionMailQueryable.cs	Mon Mar  3 21:43:30 2008
@@ -170,7 +170,8 @@
 
 		internal void AddGenerator (EvolutionMailIndexableGenerator generator, bool inotify_event)
 		{
-			running_generators.Add (generator);
+			lock (running_generators)
+				running_generators.Add (generator);
 
 			if (! inotify_event)
 				IsIndexing = true;
@@ -178,28 +179,32 @@
 
 		internal void RemoveGenerator (EvolutionMailIndexableGenerator generator)
 		{
-			running_generators.Remove (generator);
+			lock (running_generators) {
+				running_generators.Remove (generator);
 
-			if (running_generators.Count == 0)
-				IsIndexing = false;
+				if (running_generators.Count == 0)
+					IsIndexing = false;
+			}
 		}
 
 		protected override int ProgressPercent {
 			get {
-				if (running_generators.Count == 0)
-					return -1;
-
-				// An embarrassingly unscientific attempt at getting progress
-				// information from the mail backend as a whole.  Unfortunately
-				// the IMAP and mbox backends don't have a common unit of
-				// measurement (IMAP has number of messages, mbox number of
-				// bytes), so we can't get anything really accurate.
-				double total_percent = 0;
+				lock (running_generators) {
+					if (running_generators.Count == 0)
+						return -1;
+
+					// An embarrassingly unscientific attempt at getting progress
+					// information from the mail backend as a whole.  Unfortunately
+					// the IMAP and mbox backends don't have a common unit of
+					// measurement (IMAP has number of messages, mbox number of
+					// bytes), so we can't get anything really accurate.
+					double total_percent = 0;
 
-				foreach (EvolutionMailIndexableGenerator generator in running_generators)
-					total_percent += generator.ProgressPercent;
+					foreach (EvolutionMailIndexableGenerator generator in running_generators)
+						total_percent += generator.ProgressPercent;
 
-				return (int) (total_percent / running_generators.Count);
+					return (int) (total_percent / running_generators.Count);
+				}
 			}
 		}
 

Modified: branches/beagle-lucene2_1/beagled/ExternalMetadataQueryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/ExternalMetadataQueryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/ExternalMetadataQueryable.cs	Mon Mar  3 21:43:30 2008
@@ -64,6 +64,11 @@
 		{
 		}
 
+		public int DoCountMatchQuery (Query query)
+		{
+			return 0;
+		}
+
 		public ISnippetReader GetSnippet (string[] query_terms, Hit hit, bool full_text)
 		{
 			return null;

Modified: branches/beagle-lucene2_1/beagled/FileSystemQueryable/FileSystemQueryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/FileSystemQueryable/FileSystemQueryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/FileSystemQueryable/FileSystemQueryable.cs	Mon Mar  3 21:43:30 2008
@@ -219,7 +219,7 @@
 		public Indexable FileToIndexable (string         path,
 						  Guid           id,
 						  DirectoryModel parent,
-						  bool           crawl_mode)
+						  bool           crawling)
 		{
 			Indexable indexable;
 
@@ -244,7 +244,7 @@
 
 			indexable.ContentUri = UriFu.PathToFileUri (path);
 			indexable.DisplayUri = UriFu.PathToFileUri (path);
-			indexable.Crawled = crawl_mode;
+			indexable.FlushBufferCache = crawling;
 			indexable.Filtering = Beagle.IndexableFiltering.Always;
 
 			FileInfo fi = new FileInfo (path);
@@ -257,7 +257,7 @@
 			indexable.LocalState ["Path"] = path;
 
 			MergeExternalPendingIndexable (indexable);
-			Indexable xmp_indexable = xmp_handler.MergeXmpData (ref indexable, path, id, parent, crawl_mode);
+			Indexable xmp_indexable = xmp_handler.MergeXmpData (ref indexable, path, id, parent, crawling);
 
 			// In full generality, the xmp_handler can request an entirely new indexable to be scheduled.
 			// So, we should do something with the returned xmp_indexable if it is not null.

Modified: branches/beagle-lucene2_1/beagled/Filter.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Filter.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Filter.cs	Mon Mar  3 21:43:30 2008
@@ -128,8 +128,13 @@
 			set { this_extension = value; }
 		}
 
-		// Filter may set the filetype to document, source, music etc.
-		// Use lower case for file_type
+		/// <summary>
+		///  Filter may set the filetype to document, source, music etc.
+		/// Use lower case for file_type
+		/// </summary>
+		/// <param name="file_type">
+		/// A <see cref="System.String"/>
+		/// </param>
 		protected void SetFileType (string file_type)
 		{
 			this_file_type = file_type;
@@ -144,27 +149,14 @@
 			set { indexable = value; }
 		}
 		
-		//////////////////////////
-		
-		private bool crawl_mode = false;
-
-		public void EnableCrawlMode ()
-		{
-			crawl_mode = true;
-		}
 		
-		protected bool CrawlMode {
-			get { return crawl_mode; }
-		}
-
-		//////////////////////////
-
-		// Filters which deal with big files, and that don't need
-		// to read in whole files may want to set this to false
-		// to avoid wasting cycles in disk wait.
 
 		private bool preload = true;
-
+		/// <value>
+		///  Filters which deal with big files, and that don't need
+		/// to read in whole files may want to set this to false
+		/// to avoid wasting cycles in disk wait.
+		/// </value>
 		protected bool PreLoad {
 			get { return preload; }
 			set { preload = value; }
@@ -242,9 +234,11 @@
 		const string WHITESPACE = " ";
 		const string NEWLINE = "\n";
 
-		/* Append text to the textpool. If IsHot is true, then also add to the hottext pool.
-		 * Handles null str.
-		 */
+		
+		/// <summary>
+		///  Append text to the textpool. If IsHot is true, then also add to the hottext pool.
+		///  Handles null str.
+		/// </summary>
 		public bool AppendText (string str)
 		{
 			if (Debug)
@@ -308,7 +302,15 @@
 			*/
 		}
 
-		// Add a word followed by a whitespace. word may not be whitespace or newline.
+		/// <summary>
+		/// Add a word followed by a whitespace. word may not be whitespace or newline.
+		/// </summary>
+		/// <param name="word">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendWord (string word)
 		{
 			if (Debug)
@@ -317,7 +319,15 @@
 			return AppendWords (word, false);
 		}
 
-		// Add a line followed by a newline.
+		/// <summary>
+		/// Add a line followed by a newline.
+		/// </summary>
+		/// <param name="line">
+		/// A <see cref="System.String"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendLine (string line)
 		{
 			if (Debug)
@@ -358,7 +368,21 @@
 			return UpdateCharsAdded (words.Length + 1);
 		}
 
-		// Does not check for structural breaks
+		/// <summary>
+		/// Does not check for structural breaks
+		/// </summary>
+		/// <param name="buffer">
+		/// A <see cref="System.Char"/>
+		/// </param>
+		/// <param name="index">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <param name="count">
+		/// A <see cref="System.Int32"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendChars (char[] buffer, int index, int count)
 		{
 			if (Debug)
@@ -372,9 +396,14 @@
 			return UpdateCharsAdded (count);
 		}
 
-		/*
-		 * Adds whitespace to the textpool.
-		 */
+		
+		 
+		/// <summary>
+		/// Adds whitespace to the textpool.
+		/// </summary>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendWhiteSpace ()
 		{
 			if (Debug)
@@ -393,9 +422,14 @@
 			return UpdateCharsAdded (1);
 		}
 
-		/*
-		 * Creates a new paragraph. Mainly useful for storing cached contents.
-		 */
+		
+		
+		/// <summary>
+		/// Creates a new paragraph. Mainly useful for storing cached contents.
+		/// </summary>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool AppendStructuralBreak ()
 		{
 			if (Debug)
@@ -617,8 +651,19 @@
 			return Open (new FileInfo (tempFile));
 		}
 
-		// This will throw an exception; callers should catch it and appropriately
-		// display the error message showing the filename etc.
+		/// <summary>
+		/// This will throw an exception; callers should catch it and appropriately
+		/// display the error message showing the filename etc.
+		/// </summary>
+		/// <param name="stream">
+		/// A <see cref="Stream"/>
+		/// </param>
+		/// <param name="store_tempfile">
+		/// A <see cref="System.Boolean"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public bool Open (Stream stream, bool store_tempfile)
 		{
 			if (store_tempfile)
@@ -763,7 +808,7 @@
 			if (currentStream != null) {
 				// When crawling, give the OS a hint that we don't
 				// need to keep this file around in the page cache.
-				if (CrawlMode && currentStream is FileStream)
+				if (indexable.FlushBufferCache && currentStream is FileStream)
 					FileAdvise.FlushCache ((FileStream) currentStream);
 
 				currentStream.Close ();
@@ -857,8 +902,16 @@
 			get { return generated_indexables.Count > 0; }
 		}
 
-		// Good filters should replace this by an IEnumerable that does not require generating
-		// all the indexables beforehand
+		/// <summary>
+		/// Good filters should replace this by an IEnumerable that does not require generating
+		/// all the indexables beforehand
+		/// </summary>
+		/// <param name="indexable">
+		/// A <see cref="Indexable"/>
+		/// </param>
+		/// <returns>
+		/// A <see cref="System.Boolean"/>
+		/// </returns>
 		public virtual bool GenerateNextIndexable (out Indexable indexable)
 		{
 			indexable = null;

Modified: branches/beagle-lucene2_1/beagled/FilterFactory.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/FilterFactory.cs	(original)
+++ branches/beagle-lucene2_1/beagled/FilterFactory.cs	Mon Mar  3 21:43:30 2008
@@ -309,9 +309,6 @@
 					}
 				}
 
-				if (indexable.Crawled)
-					candidate_filter.EnableCrawlMode ();
-
 				// Set the indexable on the filter.
 				candidate_filter.Indexable = indexable;
 

Modified: branches/beagle-lucene2_1/beagled/Flavor.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Flavor.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Flavor.cs	Mon Mar  3 21:43:30 2008
@@ -96,10 +96,14 @@
 			get {
 				int weight = priority;
 
+				/* Uri matches are very important, next are extensions and then mimetype.
+				 * This allows filters to override everything else by specifying matching Uris,
+				 * and override mimetype by matching extensions.
+				 */
 				if (Uri != null)
-					weight += 1;				
+					weight += 3;
 				if (Extension != null)
-					weight += 1;
+					weight += 2;
 				if (MimeType != null)
 					weight += 1;
 
@@ -128,12 +132,17 @@
 		public class FlavorComparer : IComparer 
 		{
 			// flav [larger wt] < flav [smaller wt]
+			// for same wt, use hashcode (never return obj1 == obj2 unless they are actually same)
 			public int Compare (object obj1, object obj2) 
 			{
 				FilterFlavor flav1 = (FilterFlavor) obj1;
 				FilterFlavor flav2 = (FilterFlavor) obj2;
 
-				return flav2.Weight.CompareTo (flav1.Weight);
+				int ret = flav2.Weight.CompareTo (flav1.Weight);
+				if (ret != 0)
+					return ret;
+				else
+					return obj1.GetHashCode () - obj2.GetHashCode ();
 			} 
 		}
 

Modified: branches/beagle-lucene2_1/beagled/IQueryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/IQueryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/IQueryable.cs	Mon Mar  3 21:43:30 2008
@@ -43,6 +43,9 @@
 			      IQueryResult result,
 			      IQueryableChangeData data);
 
+		// Just return the number of matches
+		int DoCountMatchQuery (Query query);
+
 		ISnippetReader GetSnippet (string[] query_terms, Hit hit, bool full_text);
 
 		QueryableStatus GetQueryableStatus ();

Modified: branches/beagle-lucene2_1/beagled/KMailQueryable/KMailIndexer.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/KMailQueryable/KMailIndexer.cs	(original)
+++ branches/beagle-lucene2_1/beagled/KMailQueryable/KMailIndexer.cs	Mon Mar  3 21:43:30 2008
@@ -375,7 +375,7 @@
 			indexable.HitType = "MailMessage";
 			indexable.MimeType = "message/rfc822";
 			indexable.CacheContent = true;
-			indexable.Crawled = crawl;
+			indexable.FlushBufferCache = crawl;
 
 			indexable.AddProperty (Property.NewUnsearched ("fixme:client", "kmail"));
 			indexable.AddProperty (Property.NewUnsearched ("fixme:account", account_name));
@@ -401,7 +401,6 @@
 			indexable.HitType = "MailMessage";
 			indexable.MimeType = "message/rfc822";
 			indexable.CacheContent = true;
-			indexable.Crawled = true; // mbox files will be stored in temp files, so flush them when done
 
 			indexable.AddProperty (Property.NewUnsearched ("fixme:client", "kmail"));
 			indexable.AddProperty (Property.NewUnsearched ("fixme:account", account_name));

Modified: branches/beagle-lucene2_1/beagled/KonqHistoryQueryable/KonqQueryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/KonqHistoryQueryable/KonqQueryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/KonqHistoryQueryable/KonqQueryable.cs	Mon Mar  3 21:43:30 2008
@@ -163,7 +163,7 @@
 
 		/////////////////////////////////////////////////
 		
-		private Indexable FileToIndexable (string path, bool crawl_mode) {
+		private Indexable FileToIndexable (string path, bool crawling) {
 			//Logger.Log.Debug ("KonqQ: Trying to index " + path);
 
 			FileStream stream;
@@ -207,7 +207,7 @@
 				indexable.AddProperty (Property.NewUnstored ("fixme:urltoken", StringFu.UrlFuzzyDivide (url)));
 				// hint for the filter about the charset
 				indexable.AddProperty (Property.NewUnsearched (StringFu.UnindexedNamespace + "charset", charset));
-				indexable.Crawled = crawl_mode;
+				indexable.FlushBufferCache = crawling;
 			
 				DateTime date = DateTimeUtil.UnixToDateTimeUtc (0);
 				date = date.AddSeconds (Int64.Parse (creation_date));

Modified: branches/beagle-lucene2_1/beagled/LuceneIndexingDriver.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/LuceneIndexingDriver.cs	(original)
+++ branches/beagle-lucene2_1/beagled/LuceneIndexingDriver.cs	Mon Mar  3 21:43:30 2008
@@ -213,19 +213,23 @@
 				
 				int num_delete = 0;
 
+				term = new Term ("Uri", uri_str);
 				// For property changes, only secondary index is modified
+				secondary_reader.DeleteDocuments (term);
+
+				// Now remove from everywhere else (if asked to remove or if asked to add, in which case
+				// we first remove and then add)
+				// So we also need to remove child documents
 				if (indexable.Type != IndexableType.PropertyChange) {
-					term = new Term ("Uri", uri_str);
 					num_delete = primary_reader.DeleteDocuments (term);
+
+					// When we delete an indexable, also delete any children.
+					// FIXME: Shouldn't we also delete any children of children, etc.?
+					term = new Term ("ParentUri", uri_str);
+					num_delete += primary_reader.DeleteDocuments (term);
 					secondary_reader.DeleteDocuments (term);
 				}
 
-				// When we delete an indexable, also delete any children.
-				// FIXME: Shouldn't we also delete any children of children, etc.?
-				term = new Term ("ParentUri", uri_str);
-				num_delete += primary_reader.DeleteDocuments (term);
-				secondary_reader.DeleteDocuments (term);
-
 				// If this is a strict removal (and not a deletion that
 				// we are doing in anticipation of adding something back),
 				// queue up a removed receipt.

Modified: branches/beagle-lucene2_1/beagled/LuceneQueryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/LuceneQueryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/LuceneQueryable.cs	Mon Mar  3 21:43:30 2008
@@ -355,6 +355,12 @@
 					our_hit_filter);
 		}
 
+		public int DoCountMatchQuery (Query query)
+		{
+			return Driver.DoCountMatchQuery (query, backend_query_part_hook);
+		}
+
+
 		/////////////////////////////////////////
 
 		protected SnippetReader GetSnippetFromTextCache (string [] query_terms, Uri uri, bool full_text)

Modified: branches/beagle-lucene2_1/beagled/LuceneQueryingDriver.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/LuceneQueryingDriver.cs	(original)
+++ branches/beagle-lucene2_1/beagled/LuceneQueryingDriver.cs	Mon Mar  3 21:43:30 2008
@@ -136,40 +136,21 @@
 
 		////////////////////////////////////////////////////////////////
 
-		// Returns the lowest matching score before the results are
-		// truncated.
-		public void DoQuery (Query               query,
-				     IQueryResult        result,
-				     ICollection         search_subset_uris, // should be internal uris
-				     QueryPartHook       query_part_hook,
-				     UriFilter           uri_filter,
-				     HitFilter           hit_filter)
+		// Returns the lists of terms in the query
+		private ArrayList AssembleQuery (Query			query,
+						 QueryPartHook		query_part_hook,
+					    	 HitFilter		hit_filter,
+					    	 out ArrayList		primary_required_part_queries,
+					    	 out ArrayList		secondary_required_part_queries,
+					    	 out LNS.BooleanQuery	primary_prohibited_part_query,
+					    	 out LNS.BooleanQuery	secondary_prohibited_part_query,
+						 out AndHitFilter	all_hit_filters)
 		{
-			if (Debug)
-				Logger.Log.Debug ("###### {0}: Starting low-level queries", IndexName);
-
-			Stopwatch total, a, b, c, d, e, f;
-
-			total = new Stopwatch ();
-			a = new Stopwatch ();
-			b = new Stopwatch ();
-			c = new Stopwatch ();
-			d = new Stopwatch ();
-			e = new Stopwatch ();
-			f = new Stopwatch ();
-
-			total.Start ();
-			a.Start ();
-
-			// Assemble all of the parts into a bunch of Lucene queries
+			primary_required_part_queries = null;
+			secondary_required_part_queries = null;
+			primary_prohibited_part_query = null;
+			secondary_prohibited_part_query = null;
 
-			ArrayList primary_required_part_queries = null;
-			ArrayList secondary_required_part_queries = null;
-
-			LNS.BooleanQuery primary_prohibited_part_query = null;
-			LNS.BooleanQuery secondary_prohibited_part_query = null;
-
-			AndHitFilter all_hit_filters;
 			all_hit_filters = new AndHitFilter ();
 			if (hit_filter != null)
 				all_hit_filters.Add (hit_filter);
@@ -227,26 +208,16 @@
 				}
 			}
 
-			a.Stop ();
-			if (Debug)
-				Log.Debug ("###### {0}: Building queries took {1}", IndexName, a);
-
-			// If we have no required parts, give up.
-			if (primary_required_part_queries == null)
-				return;
-
-			b.Start ();
-			
-			//
-			// Now that we have all of these nice queries, let's execute them!
-			//
-
-			// Create the searchers that we will need.
+			return term_list;
+		}
 
-			IndexReader primary_reader;
-			LNS.IndexSearcher primary_searcher;
-			IndexReader secondary_reader = null;
-			LNS.IndexSearcher secondary_searcher = null;
+		private void BuildSearchers (out IndexReader primary_reader,
+					    out LNS.IndexSearcher primary_searcher,
+					    out IndexReader secondary_reader,
+					    out LNS.IndexSearcher secondary_searcher)
+		{
+			secondary_reader = null;
+			secondary_searcher = null;
 
 			primary_reader = LuceneCommon.GetReader (PrimaryStore);
 			primary_searcher = new LNS.IndexSearcher (primary_reader);
@@ -261,18 +232,31 @@
 
 			if (secondary_reader != null)
 				secondary_searcher = new LNS.IndexSearcher (secondary_reader);
+		}
 
-			b.Stop ();
-			if (Debug)
-				Log.Debug ("###### {0}: Readers/searchers built in {1}", IndexName, b);
-
-			// Build whitelists and blacklists for search subsets.
-			c.Start ();
-			
-			// Possibly create our whitelists from the search subset.
+		private void CloseSearchers (IndexReader primary_reader,
+					    LNS.IndexSearcher primary_searcher,
+					    IndexReader secondary_reader,
+					    LNS.IndexSearcher secondary_searcher)
+		{
+			primary_searcher.Close ();
+			if (secondary_searcher != null)
+				secondary_searcher.Close ();
+			ReleaseReader (primary_reader);
+			if (secondary_reader != null)
+				ReleaseReader (secondary_reader);
+		}
 
-			LuceneBitArray primary_whitelist = null;
-			LuceneBitArray secondary_whitelist = null;
+		private void CreateQueryWhitelists (ICollection		search_subset_uris,
+						    LNS.IndexSearcher	primary_searcher,
+						    LNS.IndexSearcher	secondary_searcher,
+						    LNS.BooleanQuery	primary_prohibited_part_query,
+						    LNS.BooleanQuery	secondary_prohibited_part_query,
+						    out LuceneBitArray	primary_whitelist,
+						    out LuceneBitArray	secondary_whitelist)
+		{
+			primary_whitelist = null;
+			secondary_whitelist = null;
 			
 			if (search_subset_uris != null && search_subset_uris.Count > 0) {
 				primary_whitelist = new LuceneBitArray (primary_searcher);
@@ -327,6 +311,175 @@
 					secondary_whitelist.AndNot (secondary_blacklist);
 				}
 			}
+		}
+
+		////////////////////////////////////////////////////////////////
+
+		public int DoCountMatchQuery (Query query, QueryPartHook query_part_hook)
+		{
+			if (Debug)
+				Logger.Log.Debug ("###### {0}: Starting low-level queries", IndexName);
+
+			Stopwatch total;
+			total = new Stopwatch ();
+			total.Start ();
+
+			ArrayList primary_required_part_queries;
+			ArrayList secondary_required_part_queries;
+
+			LNS.BooleanQuery primary_prohibited_part_query;
+			LNS.BooleanQuery secondary_prohibited_part_query;
+
+			AndHitFilter all_hit_filters;
+
+			ArrayList term_list;
+			term_list = AssembleQuery ( query,
+						    query_part_hook,
+						    null,
+						    out primary_required_part_queries,
+						    out secondary_required_part_queries,
+						    out primary_prohibited_part_query,
+						    out secondary_prohibited_part_query,
+						    out all_hit_filters);
+
+			// If we have no required parts, give up.
+			if (primary_required_part_queries == null)
+				return 0;
+
+			IndexReader primary_reader;
+			LNS.IndexSearcher primary_searcher;
+			IndexReader secondary_reader;
+			LNS.IndexSearcher secondary_searcher;
+
+			BuildSearchers (out primary_reader, out primary_searcher, out secondary_reader, out secondary_searcher);
+
+			// Build whitelists and blacklists for search subsets.
+			LuceneBitArray primary_whitelist, secondary_whitelist;
+			CreateQueryWhitelists (null,
+				primary_searcher,
+				secondary_searcher,
+				primary_prohibited_part_query,
+				secondary_prohibited_part_query,
+				out primary_whitelist,
+				out secondary_whitelist);
+
+			// Now run the low level queries against our indexes.
+			BetterBitArray primary_matches = null;
+			if (primary_required_part_queries != null) {
+
+				if (secondary_searcher != null)
+					primary_matches = DoRequiredQueries_TwoIndex (primary_searcher,
+										      secondary_searcher,
+										      primary_required_part_queries,
+										      secondary_required_part_queries,
+										      primary_whitelist,
+										      secondary_whitelist);
+				else
+					primary_matches = DoRequiredQueries (primary_searcher,
+									     primary_required_part_queries,
+									     primary_whitelist);
+
+			} 
+
+			int result = 0;
+			// FIXME: Pass the count through uri-filter and other validation checks
+			if (primary_matches != null)
+				result = primary_matches.TrueCount;
+
+			CloseSearchers (primary_reader, primary_searcher, secondary_reader, secondary_searcher);
+
+			total.Stop ();
+			if (Debug)
+				Logger.Log.Debug ("###### {0}: Total query run in {1}", IndexName, total);
+
+			return result;
+		}
+
+		////////////////////////////////////////////////////////////////
+
+		public void DoQuery (Query               query,
+				     IQueryResult        result,
+				     ICollection         search_subset_uris, // should be internal uris
+				     QueryPartHook       query_part_hook,
+				     UriFilter           uri_filter,
+				     HitFilter           hit_filter)
+		{
+			if (Debug)
+				Logger.Log.Debug ("###### {0}: Starting low-level queries", IndexName);
+
+			Stopwatch total, a, b, c, d, e, f;
+
+			total = new Stopwatch ();
+			a = new Stopwatch ();
+			b = new Stopwatch ();
+			c = new Stopwatch ();
+			d = new Stopwatch ();
+			e = new Stopwatch ();
+			f = new Stopwatch ();
+
+			total.Start ();
+			a.Start ();
+
+			ArrayList primary_required_part_queries;
+			ArrayList secondary_required_part_queries;
+
+			LNS.BooleanQuery primary_prohibited_part_query;
+			LNS.BooleanQuery secondary_prohibited_part_query;
+
+			AndHitFilter all_hit_filters;
+
+			ArrayList term_list;
+
+			// Assemble all of the parts into a bunch of Lucene queries
+
+			term_list = AssembleQuery (query,
+				query_part_hook,
+				hit_filter,
+				out primary_required_part_queries,
+				out secondary_required_part_queries,
+				out primary_prohibited_part_query,
+				out secondary_prohibited_part_query,
+				out all_hit_filters);
+
+			a.Stop ();
+			if (Debug)
+				Log.Debug ("###### {0}: Building queries took {1}", IndexName, a);
+
+			// If we have no required parts, give up.
+			if (primary_required_part_queries == null)
+				return;
+
+			b.Start ();
+			
+			//
+			// Now that we have all of these nice queries, let's execute them!
+			//
+
+			IndexReader primary_reader;
+			LNS.IndexSearcher primary_searcher;
+			IndexReader secondary_reader;
+			LNS.IndexSearcher secondary_searcher;
+
+			// Create the searchers that we will need.
+
+			BuildSearchers (out primary_reader, out primary_searcher, out secondary_reader, out secondary_searcher);
+
+			b.Stop ();
+			if (Debug)
+				Log.Debug ("###### {0}: Readers/searchers built in {1}", IndexName, b);
+
+			// Build whitelists and blacklists for search subsets.
+			c.Start ();
+
+			// Possibly create our whitelists from the search subset.
+			LuceneBitArray primary_whitelist, secondary_whitelist;
+			CreateQueryWhitelists (search_subset_uris,
+				primary_searcher,
+				secondary_searcher,
+				primary_prohibited_part_query,
+				secondary_prohibited_part_query,
+				out primary_whitelist,
+				out secondary_whitelist);
 
 			c.Stop ();
 			if (Debug)
@@ -381,14 +534,7 @@
 			//
 
 			f.Start ();
-			
-			primary_searcher.Close ();
-			if (secondary_searcher != null)
-				secondary_searcher.Close ();
-			ReleaseReader (primary_reader);
-			if (secondary_reader != null)
-				ReleaseReader (secondary_reader);
-
+			CloseSearchers (primary_reader, primary_searcher, secondary_reader, secondary_searcher);
 			f.Stop ();
 			
 			if (Debug)

Modified: branches/beagle-lucene2_1/beagled/Makefile.am
==============================================================================
--- branches/beagle-lucene2_1/beagled/Makefile.am	(original)
+++ branches/beagle-lucene2_1/beagled/Makefile.am	Mon Mar  3 21:43:30 2008
@@ -8,6 +8,7 @@
 	$(srcdir)/webinterface/propname-table.js\
 	$(srcdir)/webinterface/help.html	\
 	$(srcdir)/webinterface/mappings.xml	\
+	$(srcdir)/webinterface/opensearch.xml	\
 	$(srcdir)/webinterface/index.xsl	\
 	$(srcdir)/webinterface/hitresult.xsl	\
 	$(srcdir)/webinterface/statusresult.xsl	\

Modified: branches/beagle-lucene2_1/beagled/NetworkServicesQueryable/NetworkServicesQueryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/NetworkServicesQueryable/NetworkServicesQueryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/NetworkServicesQueryable/NetworkServicesQueryable.cs	Mon Mar  3 21:43:30 2008
@@ -125,6 +125,11 @@
 			return;
 		}
 
+		public int DoCountMatchQuery (Query query)
+		{
+			return 0;
+		}
+
 		public ISnippetReader GetSnippet (string[] query_terms, Hit hit, bool full_text)
 		{
 			return null;

Modified: branches/beagle-lucene2_1/beagled/QueryDriver.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/QueryDriver.cs	(original)
+++ branches/beagle-lucene2_1/beagled/QueryDriver.cs	Mon Mar  3 21:43:30 2008
@@ -630,6 +630,24 @@
 
 		////////////////////////////////////////////////////////
 
+		static public int DoCountMatchQuery (CountMatchQuery query)
+		{
+			DehumanizeQuery (query);
+
+			int num_matches = 0;
+
+			foreach (Queryable q in Queryables) {
+				if (! q.AcceptQuery (query))
+					continue;
+
+				num_matches += q.DoCountMatchQuery (query);
+			}
+
+			return num_matches;
+		}
+
+		////////////////////////////////////////////////////////
+
 		static public IEnumerable GetIndexInformation ()
 		{
 			foreach (Queryable q in Queryables)

Modified: branches/beagle-lucene2_1/beagled/QueryExecutor.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/QueryExecutor.cs	(original)
+++ branches/beagle-lucene2_1/beagled/QueryExecutor.cs	Mon Mar  3 21:43:30 2008
@@ -109,4 +109,19 @@
 			this.query = null;
 		}
 	}
+
+	[RequestMessage (typeof (CountMatchQuery))]
+	public class CountMatchQueryExecutor : RequestMessageExecutor {
+
+		public override ResponseMessage Execute (RequestMessage request)
+		{
+			CountMatchQueryResponse result = new CountMatchQueryResponse ();
+			CountMatchQuery query = request as CountMatchQuery;
+			if (query == null)
+				return new ErrorResponse ("Only CountMatch query please!");
+
+			result.NumMatches = QueryDriver.DoCountMatchQuery (query);
+			return result;
+		}
+	}
 }

Modified: branches/beagle-lucene2_1/beagled/Queryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/Queryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/Queryable.cs	Mon Mar  3 21:43:30 2008
@@ -83,6 +83,16 @@
 			}
 		}
 
+		public int DoCountMatchQuery (Query query)
+		{
+			try {
+				return iqueryable.DoCountMatchQuery (query);
+			} catch (Exception ex) {
+				Logger.Log.Warn (ex, "Caught exception calling DoCountMatchQuery on '{0}'", Name);
+				return 0;
+			}
+		}
+
 		public ISnippetReader GetSnippet (string[] query_terms, Hit hit, bool full_text)
 		{
 			if (hit == null)

Modified: branches/beagle-lucene2_1/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs	(original)
+++ branches/beagle-lucene2_1/beagled/ThunderbirdQueryable/ThunderbirdQueryable.cs	Mon Mar  3 21:43:30 2008
@@ -394,9 +394,9 @@
 			indexable.MimeType = "message/rfc822";
 			indexable.Timestamp = DateTimeUtil.UnixToDateTimeUtc (Convert.ToInt64 (GetText (document, "Date")));
 			indexable.CacheContent = true;
-			indexable.Crawled = true;
+			indexable.FlushBufferCache = true;
 			indexable.SetBinaryStream (message.Stream);
-			
+
 			indexable.AddProperty (Property.NewKeyword ("fixme:client", "thunderbird"));
 			indexable.AddProperty (Property.NewKeyword ("fixme:folder", GetText (document, "Folder")));
 			indexable.AddProperty (Property.NewUnsearched ("ParentUri", GetText (document, "FolderFile")));
@@ -526,7 +526,7 @@
 			indexable.MimeType = "text/html";
 			indexable.Timestamp = DateTimeUtil.UnixToDateTimeUtc (Convert.ToInt64 (GetText (document, "Date")));
 			indexable.CacheContent = true;
-			indexable.Crawled = true;
+			indexable.FlushBufferCache = true;
 			
 			indexable.AddProperty (Property.NewKeyword ("fixme:client", "thunderbird"));
 			indexable.AddProperty (Property.NewKeyword ("fixme:folder", GetText (document, "Folder")));

Modified: branches/beagle-lucene2_1/beagled/WebServer.cs
==============================================================================
--- branches/beagle-lucene2_1/beagled/WebServer.cs	(original)
+++ branches/beagle-lucene2_1/beagled/WebServer.cs	Mon Mar  3 21:43:30 2008
@@ -59,7 +59,7 @@
 
 			mappings.Add ("/", new PageMapping ("index.xml", "text/xml; charset=utf-8"));
 			mappings.Add ("/mappings.xml", new PageMapping ("mappings.xml", "text/xml; charset=utf-8"));
-			mappings.Add ("/help.xml", new PageMapping ("help.xml", "text/xml; charset=utf-8"));
+			mappings.Add ("/opensearch.xml", new PageMapping ("opensearch.xml", "text/xml; charset=utf-8"));
 			mappings.Add ("/index.xsl", new PageMapping ("index.xsl", "text/xml; charset=utf-8"));
 			mappings.Add ("/statusresult.xsl", new PageMapping ("statusresult.xsl", "text/xml; charset=utf-8"));
 			mappings.Add ("/hitresult.xsl", new PageMapping ("hitresult.xsl", "text/xml; charset=utf-8"));

Modified: branches/beagle-lucene2_1/beagled/beagled-index-helper.in
==============================================================================
--- branches/beagle-lucene2_1/beagled/beagled-index-helper.in	(original)
+++ branches/beagle-lucene2_1/beagled/beagled-index-helper.in	Mon Mar  3 21:43:30 2008
@@ -33,6 +33,10 @@
 
 fi
 
+if [ -z "$BEAGLE_MONO_RUNTIME" ]; then
+   export BEAGLE_MONO_RUNTIME="mono"
+fi
+
 if [ -n "$BEAGLE_MONO_DEBUG_FLAG_IS_SET" ]; then
    MONO_EXTRA_ARGS="--debug $MONO_EXTRA_ARGS"
 fi

Modified: branches/beagle-lucene2_1/beagled/webinterface/index.xsl
==============================================================================
--- branches/beagle-lucene2_1/beagled/webinterface/index.xsl	(original)
+++ branches/beagle-lucene2_1/beagled/webinterface/index.xsl	Mon Mar  3 21:43:30 2008
@@ -46,6 +46,7 @@
 		<script src="propname-table.js" type="text/javascript"/>
 		<script src="default.js" type="text/javascript"/>
 		<link rel="icon" href="images/favicon.png" type="image/png"/>
+		<link rel="search" type="application/opensearchdescription+xml" title="Beagle" href="opensearch.xml"/>
 	</head>
 </xsl:template>
 

Modified: branches/beagle-lucene2_1/configure.in
==============================================================================
--- branches/beagle-lucene2_1/configure.in	(original)
+++ branches/beagle-lucene2_1/configure.in	Mon Mar  3 21:43:30 2008
@@ -16,7 +16,7 @@
 MONODOC_REQUIRED=1.2.4
 NDESK_DBUS_REQUIRED=0.5.2
 NDESK_DBUS_GLIB_REQUIRED=0.3.0
-GTK_SHARP_REQUIRED=2.4.0
+GTK_SHARP_REQUIRED=2.6.0
 GMIME_SHARP_REQUIRED=2.2.0
 EVOLUTION_SHARP_REQUIRED=0.13.3
 GSF_SHARP_REQUIRED=0.6

Modified: branches/beagle-lucene2_1/po/POTFILES.in
==============================================================================
--- branches/beagle-lucene2_1/po/POTFILES.in	(original)
+++ branches/beagle-lucene2_1/po/POTFILES.in	Mon Mar  3 21:43:30 2008
@@ -1,69 +1,70 @@
 # List of source files containing translatable strings.
 # Please keep this file in alphabetical order.
 [encoding: UTF-8]
-epiphany-extension/beagle.ephy-extension.in
-epiphany-extension/beagle.py.in
 ImLogViewer/ImLogViewer.cs
 ImLogViewer/ImLogViewer.glade
 ImLogViewer/ImLogWindow.cs
-search/beagle-search.desktop.in.in
-search/Category.cs
-search/Entry.cs
-search/GroupView.cs
-search/NotificationArea.cs
-search/ListCategory.cs
-search/WidgetFu.cs
-search/Pages/Base.cs
-search/Pages/IndexInfo.cs
-search/Pages/NoMatch.cs
-search/Pages/QuickTips.cs
-search/Pages/RootUser.cs
-search/Pages/StartDaemon.cs
-search/Panes.cs
-search/Search.cs
-search/SortedTileList.cs
-search/Spinner.cs
-search/TileCategory.cs
-search/Tiles/ActionMenuItem.cs
-search/Tiles/Application.cs
-search/Tiles/ArchivedFile.cs
-search/Tiles/Audio.cs
-search/Tiles/Calendar.cs
-search/Tiles/CApplet.cs
-search/Tiles/Contact.cs
-search/Tiles/Docbook.cs
-search/Tiles/File.cs
-search/Tiles/Folder.cs
-search/Tiles/HitFlavor.cs
-search/Tiles/Image.cs
-search/Tiles/IMLog.cs
-search/Tiles/MailAttachment.cs
-search/Tiles/MailMessage.cs
-search/Tiles/Manpage.cs
-search/Tiles/Note.cs
-search/Tiles/OpenWithMenu.cs
-search/Tiles/Presentation.cs
-search/Tiles/RSSFeed.cs
-search/Tiles/Spreadsheet.cs
-search/Tiles/Task.cs
-search/Tiles/TextDocument.cs
-search/Tiles/TileAction.cs
-search/Tiles/TileActivator.cs
-search/Tiles/Tile.cs
-search/Tiles/TileGroup.cs
-search/Tiles/TileTemplate.cs
-search/Tiles/Utils.cs
-search/Tiles/Video.cs
-search/Tiles/WebHistory.cs
-search/Tray/NotificationArea.cs
-search/Tray/TrayIcon.cs
-search/TypeFilter.cs
-search/UIManager.cs
-tools/Config.cs
-tools/Settings.cs
-tools/settings.glade
-tools/beagle-settings.desktop.in.in
 Util/ChmFile.cs
 Util/Config.cs
 Util/Evolution.cs
 Util/StringFu.cs
+epiphany-extension/beagle.ephy-extension.in
+epiphany-extension/beagle.py.in
+search/Beagle.Search.Pages/Base.cs
+search/Beagle.Search.Pages/IndexInfo.cs
+search/Beagle.Search.Pages/NoMatch.cs
+search/Beagle.Search.Pages/QuickTips.cs
+search/Beagle.Search.Pages/RootUser.cs
+search/Beagle.Search.Pages/StartDaemon.cs
+search/Beagle.Search.Tiles/ActionMenuItem.cs
+search/Beagle.Search.Tiles/Application.cs
+search/Beagle.Search.Tiles/ArchivedFile.cs
+search/Beagle.Search.Tiles/Audio.cs
+search/Beagle.Search.Tiles/CApplet.cs
+search/Beagle.Search.Tiles/Calendar.cs
+search/Beagle.Search.Tiles/Contact.cs
+search/Beagle.Search.Tiles/Docbook.cs
+search/Beagle.Search.Tiles/File.cs
+search/Beagle.Search.Tiles/Folder.cs
+search/Beagle.Search.Tiles/HitFlavor.cs
+search/Beagle.Search.Tiles/IMLog.cs
+search/Beagle.Search.Tiles/Image.cs
+search/Beagle.Search.Tiles/MailAttachment.cs
+search/Beagle.Search.Tiles/MailMessage.cs
+search/Beagle.Search.Tiles/Manpage.cs
+search/Beagle.Search.Tiles/Note.cs
+search/Beagle.Search.Tiles/OpenWithMenu.cs
+search/Beagle.Search.Tiles/Presentation.cs
+search/Beagle.Search.Tiles/RSSFeed.cs
+search/Beagle.Search.Tiles/Spreadsheet.cs
+search/Beagle.Search.Tiles/Task.cs
+search/Beagle.Search.Tiles/TextDocument.cs
+search/Beagle.Search.Tiles/Tile.cs
+search/Beagle.Search.Tiles/TileAction.cs
+search/Beagle.Search.Tiles/TileActivator.cs
+search/Beagle.Search.Tiles/TileGroup.cs
+search/Beagle.Search.Tiles/TileTemplate.cs
+search/Beagle.Search.Tiles/Utils.cs
+search/Beagle.Search.Tiles/Video.cs
+search/Beagle.Search.Tiles/WebHistory.cs
+search/Beagle.Search.Tray/NotificationArea.cs
+search/Beagle.Search.Tray/TrayIcon.cs
+search/Beagle.Search/Category.cs
+search/Beagle.Search/Entry.cs
+search/Beagle.Search/GroupView.cs
+search/Beagle.Search/ListCategory.cs
+search/Beagle.Search/NotificationArea.cs
+search/Beagle.Search/Panes.cs
+search/Beagle.Search/Search.cs
+search/Beagle.Search/SearchWindow.cs
+search/Beagle.Search/SortedTileList.cs
+search/Beagle.Search/Spinner.cs
+search/Beagle.Search/TileCategory.cs
+search/Beagle.Search/TypeFilter.cs
+search/Beagle.Search/UIManager.cs
+search/Beagle.Search/WidgetFu.cs
+search/beagle-search.desktop.in.in
+tools/Config.cs
+tools/Settings.cs
+tools/beagle-settings.desktop.in.in
+tools/settings.glade

Modified: branches/beagle-lucene2_1/search/Makefile.am
==============================================================================
--- branches/beagle-lucene2_1/search/Makefile.am	(original)
+++ branches/beagle-lucene2_1/search/Makefile.am	Mon Mar  3 21:43:30 2008
@@ -1,6 +1,9 @@
 CSC = $(MCS) -debug
 CSFLAGS = -target:exe
 
+ASSEMBLY_NAME = Beagle.Search
+ASSEMBLY = $(ASSEMBLY_NAME).exe
+
 if ENABLE_DESKTOP_LAUNCH
 CSFLAGS += -define:ENABLE_DESKTOP_LAUNCH
 endif
@@ -25,84 +28,71 @@
 CSFLAGS += -define:ENABLE_AVAHI
 endif
 
-pkglib_DATA = Search.exe Search.exe.mdb
-
-BIN_WRAPPERS = beagle-search
-
-beagle-search: beagle-search.in
-	sed 					\
-	-e "s:@pkglibdir@:${pkglibdir}:" 	\
-	-e "s:@bash@:$(BASH):"			\
-	< $(srcdir)/beagle-search.in > beagle-search
-	chmod a+x beagle-search
-
-CSFILES =					\
-	$(srcdir)/Category.cs			\
-	$(srcdir)/DetailsPane.cs		\
-	$(srcdir)/Entry.cs			\
-	$(srcdir)/GroupView.cs			\
-	$(srcdir)/ListCategory.cs		\
-	$(srcdir)/NotificationArea.cs		\
-	$(srcdir)/Panes.cs			\
-	$(srcdir)/Search.cs			\
-	$(srcdir)/SortedTileList.cs		\
-	$(srcdir)/Spinner.cs			\
-	$(srcdir)/TileCategory.cs		\
-	$(srcdir)/TypeFilter.cs			\
-	$(srcdir)/UIManager.cs			\
-	$(srcdir)/WidgetFu.cs
-
-TILES = 					\
-	$(srcdir)/Tiles/ActionMenuItem.cs	\
-	$(srcdir)/Tiles/Application.cs		\
-	$(srcdir)/Tiles/ArchivedFile.cs		\
-	$(srcdir)/Tiles/AssemblyInfo.cs		\
-	$(srcdir)/Tiles/Audio.cs		\
-	$(srcdir)/Tiles/CApplet.cs		\
-	$(srcdir)/Tiles/Calendar.cs		\
-	$(srcdir)/Tiles/Contact.cs		\
-	$(srcdir)/Tiles/Docbook.cs		\
-	$(srcdir)/Tiles/File.cs			\
-	$(srcdir)/Tiles/Folder.cs		\
-	$(srcdir)/Tiles/HitFlavor.cs		\
-	$(srcdir)/Tiles/IMLog.cs		\
-	$(srcdir)/Tiles/Image.cs		\
-	$(srcdir)/Tiles/MailMessage.cs		\
-	$(srcdir)/Tiles/MailAttachment.cs	\
-	$(srcdir)/Tiles/Manpage.cs		\
-	$(srcdir)/Tiles/Note.cs			\
-	$(srcdir)/Tiles/Presentation.cs		\
-	$(srcdir)/Tiles/RSSFeed.cs		\
-	$(srcdir)/Tiles/Spreadsheet.cs		\
-	$(srcdir)/Tiles/Task.cs			\
-	$(srcdir)/Tiles/TextDocument.cs		\
-	$(srcdir)/Tiles/ThumbnailFactory.cs	\
-	$(srcdir)/Tiles/Tile.cs			\
-	$(srcdir)/Tiles/TileAction.cs		\
-	$(srcdir)/Tiles/TileActivator.cs	\
-	$(srcdir)/Tiles/TileFlat.cs		\
-	$(srcdir)/Tiles/TileGroup.cs		\
-	$(srcdir)/Tiles/TileTemplate.cs		\
-	$(srcdir)/Tiles/Utils.cs		\
-	$(srcdir)/Tiles/Video.cs		\
-	$(srcdir)/Tiles/WebHistory.cs
+SOURCES =							\
+	$(srcdir)/AssemblyInfo.cs				\
+	$(srcdir)/Beagle.Search.Pages/Base.cs			\
+	$(srcdir)/Beagle.Search.Pages/IndexInfo.cs		\
+	$(srcdir)/Beagle.Search.Pages/NoMatch.cs		\
+	$(srcdir)/Beagle.Search.Pages/QuickTips.cs		\
+	$(srcdir)/Beagle.Search.Pages/RootUser.cs		\
+	$(srcdir)/Beagle.Search.Pages/StartDaemon.cs		\
+	$(srcdir)/Beagle.Search.Tiles/ActionMenuItem.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Application.cs		\
+	$(srcdir)/Beagle.Search.Tiles/ArchivedFile.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Audio.cs			\
+	$(srcdir)/Beagle.Search.Tiles/CApplet.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Calendar.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Contact.cs		\	
+	$(srcdir)/Beagle.Search.Tiles/Docbook.cs		\
+	$(srcdir)/Beagle.Search.Tiles/File.cs			\
+	$(srcdir)/Beagle.Search.Tiles/Folder.cs			\
+	$(srcdir)/Beagle.Search.Tiles/HitFlavor.cs		\
+	$(srcdir)/Beagle.Search.Tiles/IMLog.cs			\
+	$(srcdir)/Beagle.Search.Tiles/Image.cs			\
+	$(srcdir)/Beagle.Search.Tiles/MailAttachment.cs		\
+	$(srcdir)/Beagle.Search.Tiles/MailMessage.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Manpage.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Note.cs			\
+	$(srcdir)/Beagle.Search.Tiles/Presentation.cs		\
+	$(srcdir)/Beagle.Search.Tiles/RSSFeed.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Spreadsheet.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Task.cs			\
+	$(srcdir)/Beagle.Search.Tiles/TextDocument.cs		\
+	$(srcdir)/Beagle.Search.Tiles/ThumbnailFactory.cs	\
+	$(srcdir)/Beagle.Search.Tiles/Tile.cs			\
+	$(srcdir)/Beagle.Search.Tiles/TileAction.cs		\
+	$(srcdir)/Beagle.Search.Tiles/TileActivator.cs		\
+	$(srcdir)/Beagle.Search.Tiles/TileFlat.cs		\
+	$(srcdir)/Beagle.Search.Tiles/TileGroup.cs		\
+	$(srcdir)/Beagle.Search.Tiles/TileTemplate.cs		\
+	$(srcdir)/Beagle.Search.Tiles/Utils.cs			\
+	$(srcdir)/Beagle.Search.Tiles/Video.cs			\
+	$(srcdir)/Beagle.Search.Tiles/WebHistory.cs		\
+	$(srcdir)/Beagle.Search.Tray/NotificationArea.cs	\
+	$(srcdir)/Beagle.Search.Tray/TrayIcon.cs		\
+	$(srcdir)/Beagle.Search/CairoFu.cs			\
+	$(srcdir)/Beagle.Search/Category.cs			\
+	$(srcdir)/Beagle.Search/DetailsPane.cs			\
+	$(srcdir)/Beagle.Search/Driver.cs			\
+	$(srcdir)/Beagle.Search/Entry.cs			\
+	$(srcdir)/Beagle.Search/GroupView.cs			\
+	$(srcdir)/Beagle.Search/ISearch.cs			\
+	$(srcdir)/Beagle.Search/ListCategory.cs			\
+	$(srcdir)/Beagle.Search/NotificationArea.cs		\
+	$(srcdir)/Beagle.Search/Panes.cs			\
+	$(srcdir)/Beagle.Search/Search.cs			\
+	$(srcdir)/Beagle.Search/SearchWindow.cs			\
+	$(srcdir)/Beagle.Search/SortedTileList.cs		\
+	$(srcdir)/Beagle.Search/Spinner.cs			\
+	$(srcdir)/Beagle.Search/TileCategory.cs			\
+	$(srcdir)/Beagle.Search/TypeFilter.cs			\
+	$(srcdir)/Beagle.Search/UIManager.cs			\
+	$(srcdir)/Beagle.Search/WidgetFu.cs
 
 if ENABLE_OPEN_WITH
-TILES += $(srcdir)/Tiles/OpenWithMenu.cs
+SOURCES += $(srcdir)/Beagle.Search.Tiles/OpenWithMenu.cs
 endif
 
-PAGES =						\
-	$(srcdir)/Pages/Base.cs			\
-	$(srcdir)/Pages/IndexInfo.cs		\
-	$(srcdir)/Pages/NoMatch.cs		\
-	$(srcdir)/Pages/QuickTips.cs		\
-	$(srcdir)/Pages/RootUser.cs		\
-	$(srcdir)/Pages/StartDaemon.cs
-
-TRAY =						\
-	$(srcdir)/Tray/NotificationArea.cs	\
-	$(srcdir)/Tray/TrayIcon.cs
-
 LOCAL_ASSEMBLIES =			\
 	../Util/Util.dll		\
 	../Util/UiUtil.dll		\
@@ -111,12 +101,26 @@
 ASSEMBLIES =				\
 	$(BEAGLE_UI_LIBS)		\
 	$(LOCAL_ASSEMBLIES:%=-r:%)	\
-	-r:Mono.Posix
+	$(NDESK_DBUS_LIBS)		\
+	$(NDESK_DBUS_GLIB_LIBS)		\
+	-r:Mono.Posix			\
+	-r:Mono.Cairo
+
+pkglib_DATA = $(ASSEMBLY) $(ASSEMBLY).mdb
+
+BIN_WRAPPERS = beagle-search
+
+$(ASSEMBLY): $(SOURCES) $(LOCAL_ASSEMBLIES)
+	$(CSC) -out:$@ $(CSFLAGS) $(SOURCES) $(ASSEMBLIES)
 
-Search.exe: $(CSFILES) $(TILES) $(PAGES) $(TRAY) $(LOCAL_ASSEMBLIES)
-	$(CSC) -out:$@ $(CSFLAGS) $(CSFILES) $(TILES) $(PAGES) $(TRAY) $(ASSEMBLIES)
+$(ASSEMBLY).mdb: $(ASSEMBLY)
 
-Search.exe.mdb: Search.exe
+beagle-search: beagle-search.in
+	sed 					\
+	-e "s:@pkglibdir@:${pkglibdir}:" 	\
+	-e "s:@bash@:$(BASH):"			\
+	< $(srcdir)/beagle-search.in > beagle-search
+	chmod a+x beagle-search
 
 @INTLTOOL_DESKTOP_RULE@
 
@@ -145,10 +149,7 @@
 	rm -f $(DESTDIR)$(bindir)/beagle-search
 
 EXTRA_DIST =			\
-	$(CSFILES)		\
-	$(TILES)		\
-	$(PAGES)		\
-	$(TRAY)			\
+	$(SOURCES)		\
 	$(man_MANS)		\
 	$(desktop_DATA).in	\
 	$(autostart_DATA)	\
@@ -156,8 +157,8 @@
 	beagle-search.desktop.in.in
 
 CLEANFILES =			\
-	Search.exe		\
-	Search.exe.mdb		\
+	$(ASSEMBLY)		\
+	$(ASSEMBLY).mdb		\
 	beagle-search		\
 	$(desktop_DATA)		\
 	$(desktop_h_files)

Modified: branches/beagle-lucene2_1/search/beagle-search.in
==============================================================================
--- branches/beagle-lucene2_1/search/beagle-search.in	(original)
+++ branches/beagle-lucene2_1/search/beagle-search.in	Mon Mar  3 21:43:30 2008
@@ -5,12 +5,12 @@
 
 if [ -z $installed ] ; then
     echo "*** Running uninstalled beagle-search ***"
-    THIS_EXE="./Search.exe"
+    THIS_EXE="./Beagle.Search.exe"
 
     export LD_LIBRARY_PATH="../glue/.libs${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
     export MONO_PATH="../Util:../BeagleClient${MONO_PATH+:MONO_PATH}"
 else
-    THIS_EXE="@pkglibdir@/Search.exe"
+    THIS_EXE="@pkglibdir@/Beagle.Search.exe"
 
     export LD_LIBRARY_PATH="@pkglibdir ${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
 fi

Modified: branches/beagle-lucene2_1/tools/Makefile.am
==============================================================================
--- branches/beagle-lucene2_1/tools/Makefile.am	(original)
+++ branches/beagle-lucene2_1/tools/Makefile.am	Mon Mar  3 21:43:30 2008
@@ -5,7 +5,6 @@
 LOCAL_ASSEMBLIES =			\
 	../Util/Util.dll		\
 	../BeagleClient/Beagle.dll	\
-	../beagled/BeagleDaemonPlugins.dll \
 	../beagled/BeagleDaemonLib.dll	
 
 ASSEMBLIES =				\
@@ -49,9 +48,10 @@
 INFO_TARGET  = Info.exe
 INFO_WRAPPER = beagle-info
 INFO_CSFILES = $(srcdir)/Info.cs
+INFO_ASSEMBLIES = ../beagled/BeagleDaemonPlugins.dll
 
-$(INFO_TARGET): $(INFO_CSFILES) $(LOCAL_ASSEMBLIES)
-	$(CSC) -out:$@ $(CSFLAGS) $(INFO_CSFILES) $(ASSEMBLIES)
+$(INFO_TARGET): $(INFO_CSFILES) $(LOCAL_ASSEMBLIES) $(INFO_ASSEMBLIES)
+	$(CSC) -out:$@ $(CSFLAGS) $(INFO_CSFILES) $(ASSEMBLIES) $(INFO_ASSEMBLIES:%=-r:%)
 
 $(INFO_WRAPPER): $(WRAPPER_IN)
 	$(WRAPPER_SED) -e "s|\ target\@|$(INFO_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
@@ -79,6 +79,17 @@
 	$(WRAPPER_SED) -e "s|\ target\@|$(QUERY_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
 	chmod +x $(QUERY_WRAPPER)
 
+STATIC_QUERY_TARGET  = StaticQuery.exe
+STATIC_QUERY_WRAPPER = beagle-static-query
+STATIC_QUERY_CSFILES = $(srcdir)/StaticQuery.cs
+
+$(STATIC_QUERY_TARGET): $(STATIC_QUERY_CSFILES) $(LOCAL_ASSEMBLIES)
+	$(CSC) -out:$@ $(CSFLAGS) $(STATIC_QUERY_CSFILES) $(ASSEMBLIES)
+
+$(STATIC_QUERY_WRAPPER): $(WRAPPER_IN)
+	$(WRAPPER_SED) -e "s|\ target\@|$(STATIC_QUERY_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
+	chmod +x $(STATIC_QUERY_WRAPPER)
+
 CONFIG_TARGET = Config.exe
 CONFIG_WRAPPER = beagle-config
 CONFIG_CSFILES = $(srcdir)/Config.cs
@@ -131,6 +142,7 @@
 	$(INFO_TARGET)			\
 	$(SHUTDOWN_TARGET)		\
 	$(QUERY_TARGET)			\
+	$(STATIC_QUERY_TARGET)		\
 	$(CONFIG_TARGET)
 
 if ENABLE_GUI
@@ -151,6 +163,7 @@
 	$(INFO_WRAPPER)			\
 	$(SHUTDOWN_WRAPPER)		\
 	$(QUERY_WRAPPER)		\
+	$(STATIC_QUERY_WRAPPER)		\
 	$(CONFIG_WRAPPER)
 
 if ENABLE_GUI
@@ -234,6 +247,7 @@
 	$(INFO_CSFILES)			\
 	$(SHUTDOWN_CSFILES)		\
 	$(QUERY_CSFILES)		\
+	$(STATIC_QUERY_CSFILES)		\
 	$(CONFIG_CSFILES)		\
 	$(SETTINGS_CSFILES)		\
 	$(SETTINGS_RESOURCES)		\

Modified: branches/beagle-lucene2_1/tools/Query.cs
==============================================================================
--- branches/beagle-lucene2_1/tools/Query.cs	(original)
+++ branches/beagle-lucene2_1/tools/Query.cs	Mon Mar  3 21:43:30 2008
@@ -31,7 +31,6 @@
 using System.Reflection;
 using System.Threading;
 using System.Text;
-using System.Text.RegularExpressions;
 using System.Runtime.InteropServices;
 
 using GLib;
@@ -329,4 +328,3 @@
 		main_loop.Run ();
 	}
 }
-	



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