beagle r4483 - in branches/beagle-rdf: . Filters Filters/7zip ImLogViewer Util Util/F-Spot Util/F-Spot/beagle-changes Util/Hal beagled beagled/EmpathyQueryable beagled/EvolutionDataServerQueryable beagled/EvolutionMailQueryable beagled/FileSystemQueryable beagled/IndexHelper beagled/IndexingServiceQueryable beagled/KMailQueryable beagled/KonqHistoryQueryable beagled/Lucene.Net/Search beagled/NautilusMetadataQueryable beagled/TomboyQueryable beagled/webinterface beagled/webinterface/images bludgeon conf-data doc/api/BeagleClient doc/api/BeagleClient/Beagle firefox-extension firefox-extension/chrome/content firefox-extension/chrome/locale/en-US firefox-extension/chrome/locale/zh-CN firefox-extension/chrome/skin/classic glue glue/xdgmime po search search/Beagle.Search search/Beagle.Search.Pages search/Beagle.Search.Tiles search/Beagle.Search.Tray search/Pages search/Tiles search/Tray tools tools/config-files tools/crawl-rules



Author: dbera
Date: Thu Feb 14 22:56:49 2008
New Revision: 4483
URL: http://svn.gnome.org/viewvc/beagle?rev=4483&view=rev

Log:
Basic merge from trunk 4272:4481.
Warning: doesnot build. I will do some cleanup which will also fix the build.


Added:
   branches/beagle-rdf/Filters/7zip/
      - copied from r4481, /trunk/beagle/Filters/7zip/
   branches/beagle-rdf/Filters/FilterEmpathyLog.cs
      - copied unchanged from r4481, /trunk/beagle/Filters/FilterEmpathyLog.cs
   branches/beagle-rdf/Util/Battery.cs
      - copied unchanged from r4481, /trunk/beagle/Util/Battery.cs
   branches/beagle-rdf/Util/F-Spot/beagle-changes/09-license.diff
      - copied unchanged from r4481, /trunk/beagle/Util/F-Spot/beagle-changes/09-license.diff
   branches/beagle-rdf/Util/Hal/
      - copied from r4481, /trunk/beagle/Util/Hal/
   branches/beagle-rdf/Util/QueryKeywordMapping.cs
      - copied unchanged from r4481, /trunk/beagle/Util/QueryKeywordMapping.cs
   branches/beagle-rdf/beagled/BatteryMonitor.cs
      - copied unchanged from r4481, /trunk/beagle/beagled/BatteryMonitor.cs
   branches/beagle-rdf/beagled/EmpathyQueryable/
      - copied from r4481, /trunk/beagle/beagled/EmpathyQueryable/
   branches/beagle-rdf/beagled/Lucene.Net/Search/TopDocCollector.cs
      - copied unchanged from r4481, /trunk/beagle/beagled/Lucene.Net/Search/TopDocCollector.cs
   branches/beagle-rdf/beagled/Lucene.Net/Search/TopFieldDocCollector.cs
      - copied unchanged from r4481, /trunk/beagle/beagled/Lucene.Net/Search/TopFieldDocCollector.cs
   branches/beagle-rdf/beagled/webinterface/images/system-search.png
      - copied unchanged from r4481, /trunk/beagle/beagled/webinterface/images/system-search.png
   branches/beagle-rdf/bludgeon/CommandLineFu.cs
      - copied unchanged from r4481, /trunk/beagle/bludgeon/CommandLineFu.cs
   branches/beagle-rdf/conf-data/   (props changed)
      - copied from r4481, /trunk/beagle/conf-data/
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/ISnippetReader.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/ISnippetReader.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/PropertyList.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/PropertyList.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/RequestMessageAttribute.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/RequestMessageAttribute.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/RequestMessageExecutor+AsyncResponse.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/RequestMessageExecutor+AsyncResponse.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/RequestMessageExecutor.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/RequestMessageExecutor.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/RequestMessageExecutorTypesAttribute.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/RequestMessageExecutorTypesAttribute.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/RequestMessageTypesAttribute.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/RequestMessageTypesAttribute.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/RequestWrapper.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/RequestWrapper.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/ResponseMessageTypesAttribute.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/ResponseMessageTypesAttribute.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/ResponseWrapper.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/ResponseWrapper.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/Versioned.xml
      - copied unchanged from r4481, /trunk/beagle/doc/api/BeagleClient/Beagle/Versioned.xml
   branches/beagle-rdf/firefox-extension/chrome/content/beagleSearch.js
      - copied unchanged from r4481, /trunk/beagle/firefox-extension/chrome/content/beagleSearch.js
   branches/beagle-rdf/firefox-extension/chrome/content/sidebar.xul
      - copied unchanged from r4481, /trunk/beagle/firefox-extension/chrome/content/sidebar.xul
   branches/beagle-rdf/firefox-extension/chrome/skin/classic/sidebar.css
      - copied unchanged from r4481, /trunk/beagle/firefox-extension/chrome/skin/classic/sidebar.css
   branches/beagle-rdf/po/LINGUAS
      - copied unchanged from r4481, /trunk/beagle/po/LINGUAS
   branches/beagle-rdf/search/AssemblyInfo.cs
      - copied unchanged from r4481, /trunk/beagle/search/AssemblyInfo.cs
   branches/beagle-rdf/search/Beagle.Search/
      - copied from r4481, /trunk/beagle/search/Beagle.Search/
   branches/beagle-rdf/search/Beagle.Search.Pages/
      - copied from r4481, /trunk/beagle/search/Beagle.Search.Pages/
   branches/beagle-rdf/search/Beagle.Search.Tiles/
      - copied from r4481, /trunk/beagle/search/Beagle.Search.Tiles/
   branches/beagle-rdf/search/Beagle.Search.Tray/
      - copied from r4481, /trunk/beagle/search/Beagle.Search.Tray/
   branches/beagle-rdf/tools/SettingsQt.cs
      - copied unchanged from r4481, /trunk/beagle/tools/SettingsQt.cs
   branches/beagle-rdf/tools/beagle-settings-qt.ui
      - copied unchanged from r4481, /trunk/beagle/tools/beagle-settings-qt.ui
   branches/beagle-rdf/tools/kerry.png
      - copied unchanged from r4481, /trunk/beagle/tools/kerry.png
Removed:
   branches/beagle-rdf/Filters/external-filters.xml.sample
   branches/beagle-rdf/Util/CommandLineFu.cs
   branches/beagle-rdf/Util/PropertyKeywordAttribute.cs
   branches/beagle-rdf/search/Category.cs
   branches/beagle-rdf/search/DetailsPane.cs
   branches/beagle-rdf/search/Entry.cs
   branches/beagle-rdf/search/GroupView.cs
   branches/beagle-rdf/search/ListCategory.cs
   branches/beagle-rdf/search/NotificationArea.cs
   branches/beagle-rdf/search/Pages/
   branches/beagle-rdf/search/Panes.cs
   branches/beagle-rdf/search/Search.cs
   branches/beagle-rdf/search/SortedTileList.cs
   branches/beagle-rdf/search/Spinner.cs
   branches/beagle-rdf/search/TileCategory.cs
   branches/beagle-rdf/search/Tiles/
   branches/beagle-rdf/search/Tray/
   branches/beagle-rdf/search/TypeFilter.cs
   branches/beagle-rdf/search/UIManager.cs
   branches/beagle-rdf/search/WidgetFu.cs
   branches/beagle-rdf/tools/config-files/
   branches/beagle-rdf/tools/crawl-rules/
Modified:
   branches/beagle-rdf/COPYING
   branches/beagle-rdf/ChangeLog
   branches/beagle-rdf/Filters/AssemblyInfo.cs
   branches/beagle-rdf/Filters/FilterArchive.cs
   branches/beagle-rdf/Filters/FilterAudio.cs
   branches/beagle-rdf/Filters/FilterDOC.cs
   branches/beagle-rdf/Filters/FilterDeb.cs
   branches/beagle-rdf/Filters/FilterExternal.cs
   branches/beagle-rdf/Filters/FilterIgnore.cs
   branches/beagle-rdf/Filters/FilterJpeg.cs
   branches/beagle-rdf/Filters/FilterKAddressBook.cs
   branches/beagle-rdf/Filters/FilterKopeteLog.cs
   branches/beagle-rdf/Filters/FilterMPlayerVideo.cs
   branches/beagle-rdf/Filters/FilterMail.cs
   branches/beagle-rdf/Filters/FilterMan.cs
   branches/beagle-rdf/Filters/FilterMonodoc.cs
   branches/beagle-rdf/Filters/FilterPdf.cs
   branches/beagle-rdf/Filters/FilterPidginLog.cs
   branches/beagle-rdf/Filters/FilterRPM.cs
   branches/beagle-rdf/Filters/FilterSpreadsheet.cs
   branches/beagle-rdf/Filters/FilterTotem.cs
   branches/beagle-rdf/Filters/Makefile.am
   branches/beagle-rdf/ImLogViewer/ImLogWindow.cs
   branches/beagle-rdf/Makefile.am
   branches/beagle-rdf/NEWS
   branches/beagle-rdf/Util/Config.cs
   branches/beagle-rdf/Util/F-Spot/JpegHeader.cs
   branches/beagle-rdf/Util/KonqHistoryUtil.cs
   branches/beagle-rdf/Util/Log.cs
   branches/beagle-rdf/Util/Makefile.am
   branches/beagle-rdf/Util/NautilusTools.cs
   branches/beagle-rdf/Util/PathFinder.cs
   branches/beagle-rdf/Util/SafeProcess.cs
   branches/beagle-rdf/Util/Scheduler.cs
   branches/beagle-rdf/Util/StringFu.cs
   branches/beagle-rdf/Util/SystemInformation.cs
   branches/beagle-rdf/Util/VersionFu.cs
   branches/beagle-rdf/beagled/AssemblyInfo.cs
   branches/beagle-rdf/beagled/BeagleDaemon.cs
   branches/beagle-rdf/beagled/BuildIndex.cs
   branches/beagle-rdf/beagled/DumpIndex.cs
   branches/beagle-rdf/beagled/EvolutionDataServerQueryable/SchedulingIndexableGenerator.cs
   branches/beagle-rdf/beagled/EvolutionDataServerQueryable/SourcesHandler.cs
   branches/beagle-rdf/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs
   branches/beagle-rdf/beagled/ExtractContent.cs
   branches/beagle-rdf/beagled/FileAttributesStore.cs
   branches/beagle-rdf/beagled/FileAttributesStore_Sqlite.cs
   branches/beagle-rdf/beagled/FileSystemQueryable/FileNameFilter.cs
   branches/beagle-rdf/beagled/FileSystemQueryable/FileSystemQueryable.cs
   branches/beagle-rdf/beagled/FileSystemQueryable/InternalUriManager.cs
   branches/beagle-rdf/beagled/IQueryable.cs
   branches/beagle-rdf/beagled/IndexHelper/IndexHelper.cs
   branches/beagle-rdf/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs
   branches/beagle-rdf/beagled/KMailQueryable/KMailIndexableGenerator.cs
   branches/beagle-rdf/beagled/KonqHistoryQueryable/KonqQueryable.cs
   branches/beagle-rdf/beagled/LuceneCommon.cs
   branches/beagle-rdf/beagled/LuceneQueryable.cs
   branches/beagle-rdf/beagled/LuceneQueryingDriver.cs
   branches/beagle-rdf/beagled/Makefile.am
   branches/beagle-rdf/beagled/ManageIndex.cs
   branches/beagle-rdf/beagled/NautilusMetadataQueryable/NautilusMetadataQueryable.cs
   branches/beagle-rdf/beagled/PropertyKeywordFu.cs
   branches/beagle-rdf/beagled/QueryDriver.cs
   branches/beagle-rdf/beagled/QueryStringParser.cs
   branches/beagle-rdf/beagled/Server.cs
   branches/beagle-rdf/beagled/SqliteUtils.cs
   branches/beagle-rdf/beagled/StaticQueryable.cs
   branches/beagle-rdf/beagled/TextCache.cs
   branches/beagle-rdf/beagled/TomboyQueryable/TomboyQueryable.cs
   branches/beagle-rdf/beagled/WebServer.cs
   branches/beagle-rdf/beagled/beagle-dump-index.1
   branches/beagle-rdf/beagled/beagled.in
   branches/beagle-rdf/beagled/webinterface/default.css
   branches/beagle-rdf/beagled/webinterface/default.js
   branches/beagle-rdf/beagled/webinterface/hitresult.xsl
   branches/beagle-rdf/beagled/webinterface/index.xsl
   branches/beagle-rdf/beagled/webinterface/propname-table.js
   branches/beagle-rdf/beagled/wrapper.in
   branches/beagle-rdf/bludgeon/Makefile.am
   branches/beagle-rdf/configure.in
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/EmptyResponse.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/Hit.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/Query.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/SnippetList.xml
   branches/beagle-rdf/doc/api/BeagleClient/Beagle/Transport.xml
   branches/beagle-rdf/doc/api/BeagleClient/index.xml
   branches/beagle-rdf/firefox-extension/Makefile.am
   branches/beagle-rdf/firefox-extension/README
   branches/beagle-rdf/firefox-extension/chrome/content/beagleOverlay.js
   branches/beagle-rdf/firefox-extension/chrome/content/beagleOverlay.xul
   branches/beagle-rdf/firefox-extension/chrome/content/beaglePrefs.xul
   branches/beagle-rdf/firefox-extension/chrome/locale/en-US/beagle.dtd
   branches/beagle-rdf/firefox-extension/chrome/locale/en-US/beagle.properties
   branches/beagle-rdf/firefox-extension/chrome/locale/zh-CN/beagle.properties
   branches/beagle-rdf/firefox-extension/install.rdf
   branches/beagle-rdf/glue/spawn-glue.c
   branches/beagle-rdf/glue/xdgmime/README
   branches/beagle-rdf/glue/xdgmime/xdgmimecache.c
   branches/beagle-rdf/po/ChangeLog
   branches/beagle-rdf/po/POTFILES.in
   branches/beagle-rdf/po/POTFILES.skip
   branches/beagle-rdf/po/ar.po
   branches/beagle-rdf/po/ca.po
   branches/beagle-rdf/po/es.po
   branches/beagle-rdf/po/eu.po
   branches/beagle-rdf/po/he.po
   branches/beagle-rdf/po/it.po
   branches/beagle-rdf/po/ja.po
   branches/beagle-rdf/po/oc.po
   branches/beagle-rdf/po/pl.po
   branches/beagle-rdf/po/pt_BR.po
   branches/beagle-rdf/po/sv.po
   branches/beagle-rdf/po/tr.po
   branches/beagle-rdf/search/Makefile.am
   branches/beagle-rdf/search/beagle-search-autostart.desktop
   branches/beagle-rdf/search/beagle-search.1
   branches/beagle-rdf/search/beagle-search.in
   branches/beagle-rdf/tools/Config.cs
   branches/beagle-rdf/tools/Makefile.am
   branches/beagle-rdf/tools/Query.cs
   branches/beagle-rdf/tools/Settings.cs
   branches/beagle-rdf/tools/beagle-crawl-system.in
   branches/beagle-rdf/tools/wrapper.in

Modified: branches/beagle-rdf/COPYING
==============================================================================
--- branches/beagle-rdf/COPYING	(original)
+++ branches/beagle-rdf/COPYING	Thu Feb 14 22:56:49 2008
@@ -6,12 +6,14 @@
 
 Subprojects include:
 	* DotLucene - Apache License v2.0
-	* System.Windows.Forms.RTF - MIT License
+	* Hal# - MIT License
 	* HtmlAgilityPack - BSD License
-	* SemWeb - Creative Commons Attribution License
 	* Parts of libegg (eggaccelerators.c and eggtrayicon.c) - GNU LGPL v2
-	* xdgmime - Academic Free License v2.0 or GNU LGPL v2
+	* SemWeb - Creative Commons Attribution License
+	* System.Windows.Forms.RTF - MIT License
 	* jslib - Mozilla Public License v1.1
+	* xdgmime - Academic Free License v2.0 or GNU LGPL v2
+	* LZMA SDK - GNU LGPL v2
 
 -----------------------------------------------------------------------------
 

Modified: branches/beagle-rdf/Filters/AssemblyInfo.cs
==============================================================================
--- branches/beagle-rdf/Filters/AssemblyInfo.cs	(original)
+++ branches/beagle-rdf/Filters/AssemblyInfo.cs	Thu Feb 14 22:56:49 2008
@@ -50,6 +50,7 @@
 	 typeof(FilterDocbook),
 	 typeof(FilterEbuild),
 	 typeof(FilterExternal),
+	 typeof(FilterEmpathyLog),
 	 typeof(FilterFortran),
 	 typeof(FilterGif),
 	 typeof(FilterHtml),

Modified: branches/beagle-rdf/Filters/FilterArchive.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterArchive.cs	(original)
+++ branches/beagle-rdf/Filters/FilterArchive.cs	Thu Feb 14 22:56:49 2008
@@ -40,7 +40,6 @@
 
 namespace Beagle.Filters {
 
-	[PropertyKeywordMapping (Keyword="inarchive", PropertyName="fixme:inside_archive", IsKeyword=true, Description="Use 'inarchive:true' for files inside an archive.")]
 	public class FilterArchive : Beagle.Daemon.Filter {
 
 		internal delegate ArchiveEntry GetNextEntry ();
@@ -186,6 +185,7 @@
 
 			child.AddProperty (Property.NewKeyword ("fixme:relativeuri", a_entry.Name));
 			child.AddProperty (Property.New ("fixme:comment", a_entry.Comment));
+			child.AddProperty (Property.NewUnsearched ("fixme:filesize", a_entry.Size));
 
 			foreach (Property prop in Property.StandardFileProperties (Path.GetFileName (a_entry.Name), false))
 				child.AddProperty (prop);

Modified: branches/beagle-rdf/Filters/FilterAudio.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterAudio.cs	(original)
+++ branches/beagle-rdf/Filters/FilterAudio.cs	Thu Feb 14 22:56:49 2008
@@ -32,11 +32,8 @@
 
 namespace Beagle.Filters {
 
-	[PropertyKeywordMapping (Keyword="album", PropertyName="fixme:album", IsKeyword=false, Description="Album name of the music")]
-	[PropertyKeywordMapping (Keyword="artist", PropertyName="fixme:artist", IsKeyword=false, Description="Artist of the music")]
-	[PropertyKeywordMapping (Keyword="genre", PropertyName="fixme:genre", IsKeyword=true, Description="Genre of the music")]
 	public class FilterAudio : Beagle.Daemon.Filter {
-	
+
 		public FilterAudio ()
 		{
 			// 1: Added duration and bitrate property
@@ -51,7 +48,9 @@
 				if (! type.StartsWith ("audio/"))
 					continue;
 
-				AddSupportedFlavor (FilterFlavor.NewFromMimeType (type));
+				FilterFlavor flavor = FilterFlavor.NewFromMimeType (type);
+				flavor.Priority = 1 + FilterTotem.Priority;
+				AddSupportedFlavor (flavor);
 			}
 		}
 

Modified: branches/beagle-rdf/Filters/FilterDOC.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterDOC.cs	(original)
+++ branches/beagle-rdf/Filters/FilterDOC.cs	Thu Feb 14 22:56:49 2008
@@ -101,6 +101,7 @@
 			pc.Arguments = new string [] { exe, FileInfo.FullName };
 			pc.RedirectStandardOutput = true;
 			pc.RedirectStandardError = true;
+			pc.UseLangC = true;
 
 			// Let beagle-doc-extractor run for 90 CPU seconds, max.
 			pc.CpuLimit = 90;

Modified: branches/beagle-rdf/Filters/FilterDeb.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterDeb.cs	(original)
+++ branches/beagle-rdf/Filters/FilterDeb.cs	Thu Feb 14 22:56:49 2008
@@ -31,9 +31,9 @@
 using Beagle.Util;
 
 namespace Beagle.Filters {
-	[PropertyKeywordMapping (Keyword="pkggroup", PropertyName="pkg:group", IsKeyword=false, Description="Group to which the package belongs e.g. System/Configuration/Packaging")]
+
 	public class FilterDeb : Beagle.Filters.FilterPackage {
-	
+
 		public FilterDeb ()
 		{
 		}
@@ -48,6 +48,7 @@
 			SafeProcess pc = new SafeProcess ();
 			pc.Arguments = new string [] { "dpkg-deb", "-I", FileInfo.FullName};
 			pc.RedirectStandardOutput = true;
+			pc.UseLangC = true;
 			
 			try {
 				pc.Start ();

Modified: branches/beagle-rdf/Filters/FilterExternal.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterExternal.cs	(original)
+++ branches/beagle-rdf/Filters/FilterExternal.cs	Thu Feb 14 22:56:49 2008
@@ -71,6 +71,7 @@
 
 			try {
 				FileStream fs = File.Open (path, FileMode.Open, FileAccess.Read, FileShare.Read);
+				//FIXME: Use XmlSerializerFactory instead of creating a new serializer everytime
 				XmlSerializer serializer = new XmlSerializer (typeof (ExternalFilterInfoContainer));
 				ExternalFilterInfoContainer container = (ExternalFilterInfoContainer) serializer.Deserialize (fs);
 				fs.Close ();
@@ -180,6 +181,7 @@
 			SafeProcess pc = new SafeProcess ();
 			pc.Arguments = argv;
 			pc.RedirectStandardOutput = true;
+			pc.UseLangC = true;
 
 			// Let the external filter run for 2 minutes, max.
 			pc.CpuLimit = 120;

Modified: branches/beagle-rdf/Filters/FilterIgnore.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterIgnore.cs	(original)
+++ branches/beagle-rdf/Filters/FilterIgnore.cs	Thu Feb 14 22:56:49 2008
@@ -63,6 +63,7 @@
 			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("application/x-java")); // .class files
 			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("image/x-eps"));
 			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("application/x-ole-storage")); // .db files
+			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("text/x-patch")); // patch files
 		}
 
 		protected override void DoPullProperties ()

Modified: branches/beagle-rdf/Filters/FilterJpeg.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterJpeg.cs	(original)
+++ branches/beagle-rdf/Filters/FilterJpeg.cs	Thu Feb 14 22:56:49 2008
@@ -38,14 +38,7 @@
 using SemWeb;
 
 namespace Beagle.Filters {
-	
-	[PropertyKeywordMapping (Keyword="imagemodel", PropertyName="exif:Model", IsKeyword=false, Description="Camera model as specified in exif or IPTC tags")]
-	[PropertyKeywordMapping (Keyword="imagetag", PropertyName="image:tag", IsKeyword=false, Description="FSpot, Digikam image tags")]
-	[PropertyKeywordMapping (Keyword="imagecomment", PropertyName="fspot:Description", IsKeyword=false, Description="F-Spot User comments")]
-	[PropertyKeywordMapping (Keyword="imagecomment", PropertyName="digikam:caption", IsKeyword=false, Description="Digikam User comments")]
-	[PropertyKeywordMapping (Keyword="imagecomment", PropertyName="jfif:Comment", IsKeyword=false, Description="JFIF comments")]
-	[PropertyKeywordMapping (Keyword="imagecomment", PropertyName="exif:UserComment", IsKeyword=false, Description="Exif comments")]
-	[PropertyKeywordMapping (Keyword="imagecomment", PropertyName="iptc:caption", IsKeyword=false, Description="IPTC caption")]
+
 	public class FilterJpeg : FilterImage {
 
 		public FilterJpeg ()

Modified: branches/beagle-rdf/Filters/FilterKAddressBook.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterKAddressBook.cs	(original)
+++ branches/beagle-rdf/Filters/FilterKAddressBook.cs	Thu Feb 14 22:56:49 2008
@@ -35,7 +35,6 @@
 
 namespace Beagle.Filters {
 
-	[PropertyKeywordMapping (Keyword="email", PropertyName="vCard:EMAIL", IsKeyword=false, Description="Email in KAddressbook")]
 	public class FilterKAddressBook : Beagle.Filters.FilterKCal {
 
 		public FilterKAddressBook ()

Modified: branches/beagle-rdf/Filters/FilterKopeteLog.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterKopeteLog.cs	(original)
+++ branches/beagle-rdf/Filters/FilterKopeteLog.cs	Thu Feb 14 22:56:49 2008
@@ -32,8 +32,7 @@
 using Beagle.Daemon;
 
 namespace Beagle.Filters {
-	
-	[PropertyKeywordMapping (Keyword="speakingto", PropertyName="fixme:speakingto", IsKeyword=true, Description="Person engaged in conversation")]
+
 	public class FilterKopeteLog : Beagle.Daemon.Filter {
 
 		public FilterKopeteLog ()

Modified: branches/beagle-rdf/Filters/FilterMPlayerVideo.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterMPlayerVideo.cs	(original)
+++ branches/beagle-rdf/Filters/FilterMPlayerVideo.cs	Thu Feb 14 22:56:49 2008
@@ -75,13 +75,15 @@
 
 		public FilterMPlayerVideo ()
 		{
-			// 1: Priority update after FilterVideo was added
+			// 1: Version update after FilterVideo was added
 			SetVersion (1);
 
 			PreLoad = false;
 			SetFileType ("video");
 		}
 
+		internal const int Priority = 0; // default
+
 		protected override void RegisterSupportedTypes ()
 		{
 			foreach (string s in mime_types)
@@ -110,10 +112,17 @@
 
 		protected override void DoPullProperties ()
 		{
+			if (FileInfo == null) {
+				Log.Error ("FilterMPlayerVideo: Unable to extract properties for non-file data");
+				Error ();
+				return;
+			}
+
 			SafeProcess pc = new SafeProcess ();
 			pc.Arguments = new string [] { "mplayer", "-vo", "null", "-ao", "null", "-frames", "0", "-identify", FileInfo.FullName };
 			pc.RedirectStandardOutput = true;
 			pc.RedirectStandardError = true;
+			pc.UseLangC = true;
 
 			// Let mplayer run for 10 seconds, max.
 			pc.CpuLimit = 10;

Modified: branches/beagle-rdf/Filters/FilterMail.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterMail.cs	(original)
+++ branches/beagle-rdf/Filters/FilterMail.cs	Thu Feb 14 22:56:49 2008
@@ -38,17 +38,6 @@
 
 namespace Beagle.Filters {
 
-	[PropertyKeywordMapping (Keyword="mailfrom",     PropertyName="fixme:from_name",    IsKeyword=false, Description="Name of email sender")]
-	[PropertyKeywordMapping (Keyword="mailfrom",     PropertyName="parent:fixme:from_name",    IsKeyword=false)]
-	[PropertyKeywordMapping (Keyword="mailfromaddr", PropertyName="fixme:from_address", IsKeyword=false, Description="Email address of sender")]
-	[PropertyKeywordMapping (Keyword="mailfromaddr", PropertyName="parent:fixme:from_address", IsKeyword=false)]
-	[PropertyKeywordMapping (Keyword="mailto",       PropertyName="fixme:to_name",      IsKeyword=false, Description="Name of receipient")]
-	[PropertyKeywordMapping (Keyword="mailto",       PropertyName="parent:fixme:to_name",      IsKeyword=false)]
-	[PropertyKeywordMapping (Keyword="mailtoaddr",   PropertyName="fixme:to_address",   IsKeyword=false, Description="Email address of receipient")]
-	[PropertyKeywordMapping (Keyword="mailtoaddr",   PropertyName="parent:fixme:to_address",   IsKeyword=false)]
-	[PropertyKeywordMapping (Keyword="mailinglist",  PropertyName="fixme:mlist",        IsKeyword=false, Description="Mailing list id e.g. dashboard-hackers.gnome.org")]
-	[PropertyKeywordMapping (Keyword="mailinglist",  PropertyName="parent:fixme:mlist",        IsKeyword=false)]
-	[PropertyKeywordMapping (Keyword="inattachment",  PropertyName="parent:fixme:hasAttachments", IsKeyword=true, Description="Use 'inattachment:true' for email attachments.")]
 	public class FilterMail : Beagle.Daemon.Filter, IDisposable {
 
 		private static bool gmime_initialized = false;
@@ -459,6 +448,11 @@
 									child.AddProperty (prop);
 							}
 
+							// Store length of attachment
+							long length = stream.Length;
+							if (length != -1)
+								child.AddProperty (Property.NewUnsearched ("fixme:filesize", length));
+
 							if (part.ContentType.Type.ToLower () == "text")
 								child.SetTextReader (new StreamReader (stream));
 							else

Modified: branches/beagle-rdf/Filters/FilterMan.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterMan.cs	(original)
+++ branches/beagle-rdf/Filters/FilterMan.cs	Thu Feb 14 22:56:49 2008
@@ -1,13 +1,10 @@
 //
-// Beagle
+// FilterMan.cs
 //
-// FilterMan.cs : Trivial implementation of a man-page filter.
-//
-// Author :
-//      Michael Levy <mlevy wardium homeip net>
-//
-// Copyright (C) 2004 Michael levy
+// Copyright (C) 2007 Debajyoti Bera <dbera web gmail com>
+// Copyright (C) 2004 Michael Levy <mlevy wardium homeip net>
 //
+
 //
 // Permission is hereby granted, free of charge, to any person obtaining a
 // copy of this software and associated documentation files (the "Software"),
@@ -33,15 +30,45 @@
 using System.Text;
 using System.Text.RegularExpressions;
 
+using Beagle.Util;
 using Beagle.Daemon;
 
+using ICSharpCode.SharpZipLib.GZip;
+using ICSharpCode.SharpZipLib.BZip2;
+using Decoder = SevenZip.Compression.LZMA.Decoder;
+
 namespace Beagle.Filters {
 
+	// FIXME: Right now we don't handle pages with just one line like:
+	//   .so man3/strcpy.3
+	// Which is in strncpy.3.gz and points to strcpy.3.gz
+
 	public class FilterMan : Beagle.Daemon.Filter {
-		StreamReader reader;
-		
+
+		// The regular expression for a complete man header line is built to allow a suite of 
+		// non-spaces, or words separated by spaces which are encompassed in quotes
+		// The regexp should be :
+		//
+		// Regex header_re = new Regex (@"^\.TH\s+" +
+		//			     @"(?<title>(\S+|(""(\S+\s*)+"")))\s+" +
+		//			     @"(?<section>\d+)\s+" + 
+		//			     @"(?<date>(\S+|(""(\S+\s*)+"")))\s+" +
+		//			     @"(?<source>(\S+|(""(\S+\s*)+"")))\s+" +
+		//			     @"(?<manual>(\S+|(""(\S+\s*)+"")))\s*" +
+		//			    "$");
+		//
+		// But there seem to be a number of broken man pages, and the current filter can be used 
+		// for general troff pages.
+
+		private static Regex header_regex = new Regex (@"^\.TH\s+(?<title>(\S+|(""(\S+\s*)+"")))\s*", RegexOptions.Compiled);
+
+		private StreamReader compressed_reader = null;
+
 		public FilterMan ()
 		{
+			// 1:Separate compressed man page filter
+			SetVersion (1);
+
 			SnippetMode = true;
 			SetFileType ("documentation");
 		}
@@ -54,83 +81,232 @@
 			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("application/x-troff"));
 			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("text/x-troff"));
 			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("text/troff"));
+
+			// Compressed man pages
+
+			// FIXME: Hardcoded path is ok ?
+			AddSupportedFlavor (new FilterFlavor ("file:///usr/share/man/*", ".gz", null, 1));
+			AddSupportedFlavor (new FilterFlavor ("file:///usr/share/man/*", ".bz2", null, 1));
+			AddSupportedFlavor (new FilterFlavor ("file:///usr/share/man/*", ".lzma", null, 1));
 		}
- 		/*
- 			FIXME: 
- 			Right now we don't handle pages with just one line like:
- 				.so man3/strcpy.3
-			Which is in strncpy.3.gz and points to strcpy.3.gz
-		*/
-		protected void ParseManFile (StreamReader reader)
-		{
-			string str;
-			/*
-			   The regular expression for a complete man header line is built to allow a suite of 
-			   non-spaces, or words separated by spaces which are encompassed in quotes
-			   The regexp should be :
-			   
-			Regex headerRE = new Regex (@"^\.TH\s+" +
-						    @"(?<title>(\S+|(""(\S+\s*)+"")))\s+" +
-						    @"(?<section>\d+)\s+" + 
-						    @"(?<date>(\S+|(""(\S+\s*)+"")))\s+" +
-						    @"(?<source>(\S+|(""(\S+\s*)+"")))\s+" +
-						    @"(?<manual>(\S+|(""(\S+\s*)+"")))\s*" +
-						    "$");
-						    
-			 But there seem to be a number of broken man pages, and the current filter can be used 
-			 for general troff pages.
-			*/
-			Regex headerRE = new Regex (@"^\.TH\s+" +
-						    @"(?<title>(\S+|(""(\S+\s*)+"")))\s*");
+
+		protected void ParseManFile (TextReader reader)
+		{
+			string line = null;
+
+			string section_property_name = null;
 						    
-			while ((str = reader.ReadLine ()) != null) {
-				if (str.StartsWith (".\"")) { 
-					/* Comment in man page */
+			while ((line = reader.ReadLine ()) != null) {
+
+				// Comment in man page
+				if (line.StartsWith (".\\\""))
+					continue;
+
+				if (line.StartsWith (".TH ")) {
+					HandleTH (line);
+					continue;
+				} else if (line.StartsWith (".SH")) {
+					section_property_name = HandleSH (line);
+
+					// Did not find useful property, so treat this is a section
+					if (section_property_name == null)
+						AppendStructuralBreak ();
+
+					continue;
+				} else if (section_property_name != null) {
+					AddProperty (Beagle.Property.New (section_property_name, ProcessMacros (line)));
 					continue;
-				} else if (str.StartsWith (".TH ")) {
-					MatchCollection matches = headerRE.Matches (str);
-					if (matches.Count != 1) {
-						Console.Error.WriteLine ("In title Expected 1 match but found {0} matches in '{1}'",
-									  matches.Count, str);
-						continue;
-					}
-					foreach (Match theMatch in matches) {
-						AddProperty (Beagle.Property.New ("dc:title",
-										  theMatch.Groups ["title"].ToString ()));
-					}
-                      		} else {
-                      			// A "regular" string
-                      			// Strip out some of the more common
-                      			// troff macros, ideally we should handle more
-								str = str.Replace (".SH","");
-								str = str.Replace (".PP","");
-								str = str.Replace ("\fI","");
-								str = str.Replace ("\fR","");
-								str = str.Replace (".SH","");
-								str = str.Replace (".B","");
-								str = str.Replace (".TP","");
-								str = str.Replace (".BR","");
-								str = str.Replace ("\fB","");
-                      			AppendText (str);
-				
                       		}
-                      		
-			}  
+
+				if (! line.StartsWith (".")) {
+					AppendLine (ProcessMacros (line));
+					continue;
+				}
+
+				// macro line
+				// From http://www.mamiyami.com/document/oreilly/unix3/unixnut/ch16_01.htm
+				int index = line.IndexOf (' ');
+				if (index == -1)
+					continue; // processing macro
+
+				string macro = line.Substring (0, index);
+				macro = macro.ToUpper ();
+				switch (macro) {
+				case ".B":
+					goto case ".hottext";
+				case ".BI":
+					goto case ".hottext";
+				case ".BR":
+					goto case ".hottext";
+				case ".DT":
+					break;
+				case ".HP":
+					reader.ReadLine (); // eat next line
+					AppendStructuralBreak (); // new para
+					break;
+				case ".I":
+					goto case ".hottext";
+				case ".IB":
+					goto case ".hottext";
+				case ".IP":
+					AppendStructuralBreak (); // new para
+					break;
+				case ".IR":
+					goto case ".hottext";
+				case ".LP":
+					AppendStructuralBreak ();
+					break;
+				case ".P":
+					AppendStructuralBreak ();
+					break;
+				case ".PD":
+					break;
+				case ".PP":
+					AppendStructuralBreak ();
+					break;
+				case ".RB":
+					goto case ".hottext";
+				case ".RE":
+					break;
+				case ".RI":
+					goto case ".hottext";
+				case ".RS":
+					break;
+				case ".SB":
+					goto case ".hottext";
+				case ".SM":
+					goto case ".hottext";
+				case ".SS":
+					AppendStructuralBreak ();
+					break;
+				case ".TP":
+					AppendStructuralBreak ();
+					break;
+				case ".UR":
+					AppendWord (line.Substring (index));
+					break;
+
+				case ".hottext":
+					string text = ProcessMacros (line.Substring (index));
+					AppendText (text, text);
+					AppendWhiteSpace ();
+					break;
+				default:
+					//Log.Error ("Unsupported man-page macro: '{0}'", line);
+					break;
+				}
+			} 
+
 			Finished ();
 		}
 
-		override protected void DoOpen (FileInfo info)
+		private void HandleTH (string line)
+		{
+			MatchCollection matches = header_regex.Matches (line);
+			
+			if (matches.Count != 1) {
+				Log.Error ("In title Expected 1 match but found {0} matches in '{1}'",
+					   matches.Count, line);
+				return;
+			}
+
+			foreach (Match match in matches) {
+				string title = ProcessMacros (match.Groups ["title"].ToString ());
+				AddProperty (Beagle.Property.New ("dc:title", title));
+			}
+		}
+
+		private string HandleSH (string line)
+		{
+			if (line == ".SH NAME")
+				return "dc:subject";
+			if (line == ".SH AUTHOR")
+				return "dc:creator";
+			if (line == ".SH COPYRIGHT")
+				return "dc:rights";
+			return null;
+		}
+
+		private string ProcessMacros (string line)
+		{
+			line = line.Replace (@"\-", "-");
+			line = line.Replace (@"\ ", " ");
+			line = line.Replace (@"\fB", String.Empty);
+			line = line.Replace (@"\fI", String.Empty);
+			line = line.Replace (@"\fP", String.Empty);
+			line = line.Replace (@"\fR", String.Empty);
+			line = line.Replace (@"\(co", "(C)");
+
+			return line;
+		}
+
+		protected override void DoPullProperties ()
 		{
-			Stream stream;
-			stream = new FileStream (info.FullName,
-						 FileMode.Open,
-						 FileAccess.Read,
-						 FileShare.Read);
-			reader = new StreamReader (stream);
+			if (Extension == ".gz" || Extension == ".bz2" || Extension == ".lzma")
+				ParseComressedManFile ();
+			else
+				ParseManFile (base.TextReader);
 		}
-		override protected void DoPull ()
+
+		private void ParseComressedManFile ()
+		{
+			try {
+				Stream stream = null;
+				if (Extension == ".gz")
+					stream = new GZipInputStream (Stream);
+				else if (Extension == ".bz2")
+					stream = new BZip2InputStream (Stream);
+				else if (Extension == ".lzma")
+					stream = GetLzmaStream (Stream);
+
+				compressed_reader = new StreamReader (stream);
+			} catch (Exception e) {
+				Log.Error (e, "Error in opening compressed man page");
+				if (compressed_reader != null)
+					compressed_reader.Close ();
+				Error ();
+				return;
+			}
+
+			ParseManFile (compressed_reader);
+		}
+
+		protected override void DoClose ()
 		{
-			ParseManFile (reader);
+			if (compressed_reader != null)
+				compressed_reader.Close ();
+		}
+
+		private Stream GetLzmaStream (Stream in_stream)
+		{
+			// From LzmaAlone.cs
+			byte[] properties = new byte [5];
+			if (in_stream.Read (properties, 0, 5) != 5)
+				throw new Exception ("input .lzma is too short");
+
+			Decoder decoder = new Decoder ();
+			decoder.SetDecoderProperties (properties);
+
+			long out_size = 0;
+			for (int i = 0; i < 8; i++)
+			{
+				int v = in_stream.ReadByte ();
+				if (v < 0)
+					throw new Exception ("LZMA: Can't Read 1");
+				out_size |= ((long)(byte)v) << (8 * i);
+			}
+			long compressed_size = in_stream.Length - in_stream.Position;
+
+			// FIXME: Man pages are small enough to use a MemoryStream to store the
+			// entire uncompressed file.
+			// Still, a proper stream based approach would be good. Unfortunately,
+			// LZMA does not provide a streaming interface. Current hacks involve
+			// a separate synchronized thread.
+			MemoryStream out_stream = new MemoryStream ((int) out_size); // outsize is long but this constructor is resizable
+			decoder.Code (in_stream, out_stream, compressed_size, out_size, null);
+			//Log.Debug ("Decoded {0} bytes to {1} bytes", compressed_size, out_size);
+			out_stream.Position = 0;
+			return out_stream;
 		}
 	}
 }

Modified: branches/beagle-rdf/Filters/FilterMonodoc.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterMonodoc.cs	(original)
+++ branches/beagle-rdf/Filters/FilterMonodoc.cs	Thu Feb 14 22:56:49 2008
@@ -29,6 +29,7 @@
 using System.Xml;
 using System.Text;
 using System.Threading;
+using System.Collections;
 
 using Beagle.Daemon;
 using Beagle.Util;
@@ -48,28 +49,45 @@
 
 		protected override void RegisterSupportedTypes ()
 		{
-			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("application/monodoc"));
+			// 1: Change to indexable generator
+			SetVersion (1);
+
 			// FIXME: Autoconf to find the monodoc prefix
 			AddSupportedFlavor (new FilterFlavor ("file:///usr/lib/monodoc/sources/*", ".zip", null, 0));
+			AddSupportedFlavor (FilterFlavor.NewFromMimeType ("application/monodoc"));
 		}
 
-		override protected void DoOpen (FileInfo file)
-		{
-			try {
-				archive = new ZipFile (file.FullName);
-			} catch (Exception e) {
-				Logger.Log.Error ("Error while filtering Monodoc archive: {0}", e);
-				Error ();
+		public override bool HasGeneratedIndexable {
+			get {
+				try {
+					archive = new ZipFile (Stream);
+					entry_enumerator = GetNextEntryIndexable ().GetEnumerator ();
+					return true;
+				} catch (Exception e) {
+					Log.Error ("Error while filtering Monodoc archive: {0}", e);
+					// If we cannot scan archived entries, we take that as a failure
+					Error ();
+					return false;
+				}
 			}
 		}
 
-		override protected void DoPullProperties ()
+		private IEnumerator entry_enumerator = null;
+
+		public override bool GenerateNextIndexable (out Indexable child)
 		{
-			if (archive == null) {
-				Error ();
-				return;
-			}
+			child = null;
+
+			if (entry_enumerator == null || ! entry_enumerator.MoveNext ())
+				return false;
+
+			child = (Indexable) entry_enumerator.Current;
+			
+			return true;
+		}
 
+		private IEnumerable GetNextEntryIndexable ()
+		{
 			foreach (ZipEntry entry in archive) {
 				if (entry.Name.IndexOf (".") != -1)
 					continue;
@@ -84,28 +102,24 @@
 				
 				Indexable type_indexable = TypeNodeToIndexable (type, FileInfo);
 				type_indexable.SetChildOf (this.Indexable);
-				AddIndexable (type_indexable);
+				type_indexable.StoreStream ();
+				type_indexable.CloseStreams ();
+				yield return type_indexable;
 				
 				foreach(XmlNode member in type.SelectNodes ("Members/Member")) {
 					Indexable member_indexable = MemberNodeToIndexable (member,
 											    FileInfo,
 											    type.Attributes ["FullName"].Value);
 					member_indexable.SetChildOf (this.Indexable);
-					AddIndexable (member_indexable);
+					member_indexable.StoreStream ();
+					member_indexable.CloseStreams ();
+					yield return member_indexable;
 				}
 			}
-			
-			// If we've successfully crawled the file but haven't 
-                        // found any indexables, we shouldn't consider it
-                        // successfull at all.
-                        if (! HasGeneratedIndexable) {
-                                Error ();
-                                return;
-                        }
-			
+
 			Finished ();
 		}
-		
+
 		static private Indexable TypeNodeToIndexable (XmlNode node, FileInfo file)
 		{
 			Indexable indexable = new Indexable (UriFu.PathToFileUri (file + "#T:" + node.Attributes ["FullName"].Value));
@@ -113,8 +127,9 @@
 			indexable.MimeType = "text/html";
 			indexable.HitType = "MonodocEntry";
 			
-			indexable.AddProperty (Property.NewUnsearched ("fixme:type", "type"));
+			indexable.AddProperty (Property.New ("dc:title", "T:" + node.Attributes["FullName"].Value));
 			indexable.AddProperty (Property.NewUnsearched ("fixme:name", "T:" + node.Attributes["FullName"].Value));
+			indexable.AddProperty (Property.NewUnsearched ("fixme:type", "type"));
 			
 			StringReader reader = new StringReader (node.SelectSingleNode ("Docs").InnerXml); 
                         indexable.SetTextReader (reader);
@@ -149,8 +164,9 @@
 			indexable.MimeType = "text/html";
 			indexable.HitType = "MonodocEntry";
 
-			indexable.AddProperty (Property.NewUnsearched ("fixme:type", node.SelectSingleNode ("MemberType").InnerText.ToLower ()));
+			indexable.AddProperty (Property.New ("dc:title",  memberFullName.ToString ()));
 			indexable.AddProperty (Property.New ("fixme:name", memberFullName.ToString ()));
+			indexable.AddProperty (Property.NewUnsearched ("fixme:type", node.SelectSingleNode ("MemberType").InnerText.ToLower ()));
 
 			StringReader reader = new StringReader (node.SelectSingleNode ("Docs").InnerXml); 
                         indexable.SetTextReader (reader);

Modified: branches/beagle-rdf/Filters/FilterPdf.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterPdf.cs	(original)
+++ branches/beagle-rdf/Filters/FilterPdf.cs	Thu Feb 14 22:56:49 2008
@@ -50,6 +50,7 @@
 			// use more than 100 megs memory.
 			pc.CpuLimit = 90;
 			pc.MemLimit = 100*1024*1024;
+			pc.UseLangC = true;
 
 			try {
 				pc.Start ();

Modified: branches/beagle-rdf/Filters/FilterPidginLog.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterPidginLog.cs	(original)
+++ branches/beagle-rdf/Filters/FilterPidginLog.cs	Thu Feb 14 22:56:49 2008
@@ -31,8 +31,7 @@
 using Beagle.Daemon;
 
 namespace Beagle.Filters {
-	
-	[PropertyKeywordMapping (Keyword="speakingto", PropertyName="fixme:speakingto", IsKeyword=true, Description="Person engaged in conversation")]
+
 	public class FilterPidginLog : Beagle.Daemon.Filter {
 
 		public FilterPidginLog ()

Modified: branches/beagle-rdf/Filters/FilterRPM.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterRPM.cs	(original)
+++ branches/beagle-rdf/Filters/FilterRPM.cs	Thu Feb 14 22:56:49 2008
@@ -63,6 +63,7 @@
 			SafeProcess pc = new SafeProcess ();
 			pc.Arguments = new string [] { "rpm", "-qp", "--queryformat", property_queryformat, FileInfo.FullName };
 			pc.RedirectStandardOutput = true;
+			pc.UseLangC = true;
 
 			// Let rpm run for 15 seconds for properties, max.
 			pc.CpuLimit = 15;

Modified: branches/beagle-rdf/Filters/FilterSpreadsheet.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterSpreadsheet.cs	(original)
+++ branches/beagle-rdf/Filters/FilterSpreadsheet.cs	Thu Feb 14 22:56:49 2008
@@ -83,6 +83,7 @@
 			SafeProcess pc = new SafeProcess ();
 			pc.Arguments = new string [] { "ssindex", "-i", FileInfo.FullName };
 			pc.RedirectStandardOutput = true;
+			pc.UseLangC = true;
 
 			// Let ssindex run for 10 seconds, max.
 			pc.CpuLimit = 10;

Modified: branches/beagle-rdf/Filters/FilterTotem.cs
==============================================================================
--- branches/beagle-rdf/Filters/FilterTotem.cs	(original)
+++ branches/beagle-rdf/Filters/FilterTotem.cs	Thu Feb 14 22:56:49 2008
@@ -48,6 +48,10 @@
 			SetFileType ("video");
 		}
 
+		internal static int Priority {
+			get { return 1 + FilterMPlayerVideo.Priority; }
+		}
+
 		protected override void RegisterSupportedTypes ()
 		{
 			// Get the list of mime-types from the totem-video-indexer
@@ -56,6 +60,7 @@
 			pc.Arguments = new string [] { "totem-video-indexer", "--mimetype" };
 			pc.RedirectStandardOutput = true;
 			pc.RedirectStandardError = true;
+			pc.UseLangC = true;
 
 			try {
 				pc.Start ();
@@ -71,7 +76,7 @@
 
 			while ((str = pout.ReadLine ()) != null) {
 				FilterFlavor flavor = FilterFlavor.NewFromMimeType (str);
-				flavor.Priority = 1; // Prefer Totem filter over MPlayer
+				flavor.Priority = Priority;
 
 				AddSupportedFlavor (flavor);
 
@@ -85,8 +90,14 @@
 
 		protected override void DoPullProperties ()
 		{
+			if (FileInfo == null) {
+				Log.Error ("FilterTotem: Unable to extract properties for non-file data");
+				Error ();
+				return;
+			}
+
 			SafeProcess pc = new SafeProcess ();
-			pc.Arguments = new string [] { "totem-video-indexer", UriFu.UriToEscapedString (this.Indexable.Uri) };
+			pc.Arguments = new string [] { "totem-video-indexer", FileInfo.FullName };
 			pc.RedirectStandardOutput = true;
 			pc.RedirectStandardError = true;
 

Modified: branches/beagle-rdf/Filters/Makefile.am
==============================================================================
--- branches/beagle-rdf/Filters/Makefile.am	(original)
+++ branches/beagle-rdf/Filters/Makefile.am	Thu Feb 14 22:56:49 2008
@@ -20,6 +20,8 @@
 
 include TagLib/TagLib.sources
 
+include 7zip/7zip.sources
+
 # Local copy of http://svn.myrealbox.com/viewcvs/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/
 SWF_RTF_CSFILES =						\
 	$(srcdir)/System.Windows.Forms.RTF/Charcode.cs		\
@@ -48,6 +50,7 @@
 	$(srcdir)/AssemblyInfo.cs	\
 	$(HAP_CSFILES)			\
 	$(SWF_RTF_CSFILES)		\
+	$(7ZIP_CSFILES)			\
 	$(srcdir)/FilterAbiword.cs	\
 	$(srcdir)/FilterArchive.cs	\
 	$(srcdir)/FilterAudio.cs	\
@@ -61,6 +64,7 @@
 	$(srcdir)/FilterDocbook.cs	\
 	$(srcdir)/FilterEbuild.cs	\
 	$(srcdir)/FilterExternal.cs	\
+	$(srcdir)/FilterEmpathyLog.cs	\
 	$(srcdir)/FilterFortran.cs	\
 	$(srcdir)/FilterGif.cs		\
 	$(srcdir)/FilterHtml.cs		\
@@ -165,13 +169,9 @@
 	$(srcdir)/FilterDOC.cs		\
 	$(srcdir)/FilterChm.cs
 
-confdir = $(sysconfdir)/beagle
-conf_DATA = external-filters.xml.sample
-
 EXTRA_DIST =			\
 	$(CSFILES)		\
-	$(COND_CS_FILES)	\
-	$(conf_DATA)
+	$(COND_CS_FILES)
 
 CLEANFILES =		\
 	$(TARGET)	\

Modified: branches/beagle-rdf/ImLogViewer/ImLogWindow.cs
==============================================================================
--- branches/beagle-rdf/ImLogViewer/ImLogWindow.cs	(original)
+++ branches/beagle-rdf/ImLogViewer/ImLogWindow.cs	Thu Feb 14 22:56:49 2008
@@ -87,7 +87,7 @@
 		
 		private void SetWindowTitle (string speaker)
 		{
-			if (speaker == null || speaker.Length == 0)
+			if (String.IsNullOrEmpty (speaker))
 				return;
 
 			// Find the buddy
@@ -121,7 +121,7 @@
 			} else {
 				string nick = speaker;
 
-				if (buddy != null && buddy.Alias.Length > 0)
+				if (buddy != null && ! String.IsNullOrEmpty (buddy.Alias))
 					nick = buddy.Alias;
 
 				imviewer.Title = String.Format (Catalog.GetString ("Conversations with {0}"), nick);

Modified: branches/beagle-rdf/Makefile.am
==============================================================================
--- branches/beagle-rdf/Makefile.am	(original)
+++ branches/beagle-rdf/Makefile.am	Thu Feb 14 22:56:49 2008
@@ -30,9 +30,10 @@
 endif
 
 SUBDIRS +=			\
+	conf-data
 	firefox-extension	\
-	tools			\
 	RDFAdapter
+	tools
 
 if ENABLE_EPIPHANY_EXTENSION
 SUBDIRS += epiphany-extension
@@ -46,10 +47,6 @@
 SUBDIRS += thunderbird-extension
 endif
 
-# When the chooser work has been fixed up to use libbeagle, we can
-# reenable this directory.
-# SUBDIRS += chooser-fu
-
 EXTRA_DIST = 			\
 	HACKING			\
 	intltool-extract.in	\

Modified: branches/beagle-rdf/NEWS
==============================================================================
--- branches/beagle-rdf/NEWS	(original)
+++ branches/beagle-rdf/NEWS	Thu Feb 14 22:56:49 2008
@@ -1,3 +1,120 @@
+Version 0.3.3
+2 February 2008
+
+* Prevent few potential crashes in EvolutionDataServer backend.
+
+* Fix a null reference exception in imlogviewer when no buddy alias is set.
+
+* Fix beagle-search to allow filetype: queries.
+
+* Fix filtering of media files by Totem and MPlayer.
+
+* Fix the URIs in Konqueror web history backend to be of the right form. Also prevent it from flooding the buffer cache during initial crawling.
+
+* Fix autostarting of beagle-search in Gnome (fixes #507786).
+
+* Fix a potential crash in EvolutionMail backend due to an incorrect and obsolete type casting (merge patch from Debian).
+
+* Disable building static indexes for all the static indexes (merge patch from Debian).
+
+* xdgmimecache.c contained a fix for bugs.freedesktop.org #12512 which is not present in the GTK+ copy. Revert the change that removed the fix.
+
+* Add a view in beagle-search to show the current index information.
+
+* Add a new tile in beagle-searcj for manpages. Several fixes to the documentation tile as well. Searching documentation is disabled by default but can be enabled by passing --search-docs to beagle-search.
+
+* Add an LZMA (7zip) based filter for lzma compressed man pages.
+
+* Prevent beagle log manager from printing the same exception repeatedly. Instead only print the first line followed by a "(Repeated)". This will make beagle go easy with the log file size.
+
+* Add a Qt UI for beagle-settings using Qyoto.
+
+* Add an advanced query syntax "inuri:" to match data with query word in the uri. The implementation is backend specific and usually relevent for web history and bookmark backends.
+
+* A partial implementation of "inuri:" for the filesystem backend to query for files in a particular directory (not recurive). The option to inuri: could either be a word in the name of the directory or the file:/// uri of the directory. Live queries (where a new directory is created that matches the inuri value) are not supported for inuri queries against the filesystem backend.
+
+* Add a firefox sidebar to the firefox-beagle extension. The sidebar will allow querying in indexed webpages and bookmarks. The sidebar requires the web interface to be enabled (for querying from local machine).
+
+* Use Sqlite prepared statements in textcache and file attribute databases.
+
+* Add configure options to control whether to always use the internal taglib-sharp or an external taglib-sharp. Useful for source based distributions.
+
+* Use "--indexing-delay -1" as an option to start beagled in query only mode.
+
+* Add an environment variable BEAGLE_FORCE_GC to do a forceful collection in beagled (disabled by default).
+
+* Enable system-wide manpage index.
+
+* Port beagle to LINGUAS (fixes #510172).
+
+* Translations:
+  - Swedish (Daniel Nylander)
+  - Spanish (Jorge Gonzalez)
+  - Polish (Wadim Dziedzic)
+  - Occitan (Yannig Marchegay)
+  - Hebrew (Rosseta)
+  - Japanese (Takeshi AIHANA)
+  - Turkish (Gil Forcada)
+  - Arabic (Khaled Hosny)
+  - Italian (Gianvito Cavasoli)
+
+Contributors to this release: Debajyoti Bera, Lukas Lipka, Kevin Kubasik, Joe Shaw, Nirbheek Chauhan and Enrico Minack.
+
+Full set of changes:
+http://svn.gnome.org/viewvc/beagle/tags/BEAGLE_0_3_3/beagle/ChangeLog?view=markup
+
+-------------------------------------------------------------------------------
+
+Version 0.3.2
+27 December 2007
+
+* Use Hal to monitor battery and AC power. Earlier we monitored a fixed set of files in the /proc filesystem. Now we require NDesk-DBus.
+
+* Fix building with mono 1.2.6 [bgo #503639].
+
+* Add a couple of Avahi specific missing files.
+
+* Fix several bugs in handling exclude directories and patterns in the Filesystem backend.
+
+* Fix a crash in the Nautilus backend when it tries to index temporary files [bgo #504192].
+
+* Fix monodoc and manpages filter. Add support for gzip and bzip2 compressed manpages.
+
+* Fix a bug in beagle-build-index where new files would not be indexed.
+
+* Fix --enable-deletion in beagle-build-index. Set --enable-deletion for system-wide indexes.
+
+* New Empathy backend.
+
+* Store file size for files from the filesystem, in archives and in email attachments.
+
+* Show a larger snippet in the tooltip in beagle-search.
+
+* Allow users to bookmark webinterface searches.
+
+* Also display the time of recently modified results in the webinterface.
+
+* Add --write-xml and --read-xml options to beagle-config to enable non-C# programs to read and set config options.
+
+* Show documentation results in beagle-search when started with --search-docs option.
+
+* Add system-wide crawl rules for manpages and monodoc files. Keep them disabled by default.
+
+* Show the system-wide indexes in the backend chooser of beagle-settings.
+
+* Translations:
+  - Swedish (Daniel Nylander)
+  - Spanish (Jorge Gonzalez)
+  - Brazilian Portuguese (Igor Pires Soares, Leonardo Ferreira Fontenelle)
+  - Arabic (Khaled Hosny)
+
+Contributors to this release: Debajyoti Bera, Lukas Lipka, Kevin Kubasik and  Anders Rune Jensen.
+
+Full set of changes:
+http://svn.gnome.org/viewvc/beagle/tags/BEAGLE_0_3_2/beagle/ChangeLog?view=markup
+
+-------------------------------------------------------------------------------
+
 Version 0.3.1
 10 December 2007
 

Modified: branches/beagle-rdf/Util/Config.cs
==============================================================================
--- branches/beagle-rdf/Util/Config.cs	(original)
+++ branches/beagle-rdf/Util/Config.cs	Thu Feb 14 22:56:49 2008
@@ -279,12 +279,8 @@
 			get { return Get (Conf.Names.NetworkingConfig); }
 		}
 
-		private static string global_dir = Path.Combine (
-						Path.Combine (ExternalStringsHack.SysConfDir, "beagle"),
-						"config-files");
-
-		public static string GlobalDir {
-			get { return global_dir; }
+		private static string GlobalConfigDir {
+			get { return Path.Combine (PathFinder.ConfigDataDir, "config-files"); }
 		}
 
 		// Utility method to check if global config files exist for the main config types
@@ -295,7 +291,7 @@
 								Names.DaemonConfig,
 								Names.NetworkingConfig}) {
 				string filename = (name + ".xml");
-				string global_file = Path.Combine (global_dir, filename);
+				string global_file = Path.Combine (GlobalConfigDir, filename);
 				if (! File.Exists (global_file))
 					return false;
 			}
@@ -311,7 +307,7 @@
 		{
 			string filename = (name + ".xml");
 
-			string global_file = Path.Combine (global_dir, filename);
+			string global_file = Path.Combine (GlobalConfigDir, filename);
 			string local_file = Path.Combine (configs_dir, filename);
 
 			Config merge_from = LoadFrom (local_file);
@@ -378,7 +374,7 @@
 
 			using (StreamWriter writer = new StreamWriter (filename)) {
 				conf_ser.Serialize (writer, config);
-				Console.WriteLine ("Done writing to " + filename);
+				Log.Debug ("Done writing to " + filename);
 			}
 
 			watching_for_updates = watching_for_updates_current;
@@ -403,6 +399,72 @@
 			}
 		}
 
+		/* External clients can use the following two xml based methods to read/write xml */
+
+		// Use this method to write the config in its xml format.
+		public static void WriteSectionXml (Config config, TextWriter writer)
+		{
+			if (config == null)
+				return;
+
+			// serialize will not serialize global options,
+			// so temporarily make every option global
+			Dictionary<Option, bool> global_options = new Dictionary<Option, bool> ();
+			foreach (Option option in config.Options.Values) {
+				global_options [option] = option.Global;
+				option.Global = false;
+			}
+
+			conf_ser.Serialize (writer, config);
+
+			foreach (Option option in config.Options.Values)
+				option.Global = global_options [option];
+		}
+
+		// Use this method to send in the xml for a config, and the original config
+		// and the changes from the original to the xml will be added to the original config
+		// Returns false if the read xml does not correspond to the same config as that
+		// was passed, in which case please note that the passed config COULD BE IN A
+		// modified state and should be discarded!
+		public static bool ReadSectionXml (Config config, TextReader reader)
+		{
+			if (config == null)
+				throw new ArgumentException ("config", "config cannot be null");
+
+			Config new_config = (Config) conf_ser.Deserialize (reader);
+
+			foreach (Option new_option in new_config.Options.Values) {
+				Option option = config [new_option.Name] as Option;
+				if (option == null || (option.Type != new_option.Type))
+					return false;
+
+				switch (option.Type) {
+				case OptionType.Bool:
+					BoolOption option_bool = (BoolOption) option;
+					BoolOption new_option_bool = (BoolOption) new_option;
+					option_bool.Value = new_option_bool.Value;
+					break;
+
+				case OptionType.String:
+					StringOption option_str = (StringOption) option;
+					StringOption new_option_str = (StringOption) new_option;
+					option_str.Value = new_option_str.Value;
+					break;
+
+				case OptionType.List:
+					ListOption option_list = (ListOption) option;
+					ListOption new_option_list = (ListOption) new_option;
+					if (option_list.NumParams != new_option_list.NumParams)
+						return false;
+
+					option_list.Values = new_option_list.Values;
+					break;
+				}
+			}
+
+			return true;
+		}
+
 		private static void CheckOldConfig ()
 		{
 			// Load the local config files
@@ -420,19 +482,19 @@
 			Log.Info ("Old config files found. Moving them to the new format...");
 
 			// Load the global config files
-			Config global_fsq_config = LoadFrom (Path.Combine (global_dir, Names.FilesQueryableConfig + ".xml"));
+			Config global_fsq_config = LoadFrom (Path.Combine (GlobalConfigDir, Names.FilesQueryableConfig + ".xml"));
 			foreach (Option option in global_fsq_config.Options.Values)
 				option.Global = true;
 
-			Config global_networking_config = LoadFrom (Path.Combine (global_dir, Names.NetworkingConfig + ".xml"));
+			Config global_networking_config = LoadFrom (Path.Combine (GlobalConfigDir, Names.NetworkingConfig + ".xml"));
 			foreach (Option option in global_networking_config.Options.Values)
 				option.Global = true;
 
-			Config global_bs_config = LoadFrom (Path.Combine (global_dir, Names.BeagleSearchConfig + ".xml"));
+			Config global_bs_config = LoadFrom (Path.Combine (GlobalConfigDir, Names.BeagleSearchConfig + ".xml"));
 			foreach (Option option in global_bs_config.Options.Values)
 				option.Global = true;
 
-			Config global_daemon_config = LoadFrom (Path.Combine (global_dir, Names.DaemonConfig + ".xml"));
+			Config global_daemon_config = LoadFrom (Path.Combine (GlobalConfigDir, Names.DaemonConfig + ".xml"));
 			foreach (Option option in global_daemon_config.Options.Values)
 				option.Global = true;
 
@@ -914,10 +976,10 @@
 		[XmlIgnore]
 		public List<string[]> Values {
 			get {
+				List<string[]> list = new List<string[]> (Count);
 				if (Count == 0)
-					return null;
+					return list;
 
-				List<string[]> list = new List<string[]> (Count);
 				int num_params = NumParams;
 
 				foreach (string value in Values_String) {
@@ -955,7 +1017,6 @@
 		}
 	}
 
-	[ConfigSection (Name="searching")]
 	public class SearchingConfig : Section {
 		
 		private KeyBinding show_search_window_binding = new KeyBinding ("F12");
@@ -1007,7 +1068,6 @@
 
 	}
 
-	[ConfigSection (Name="daemon")]
 	public class DaemonConfig : Section {
 		private ArrayList static_queryables = new ArrayList ();
 		public ArrayList StaticQueryables {
@@ -1037,82 +1097,13 @@
 			set { index_synchronization = value; }
 		}
 
-		[ConfigOption (Description="Enable a backend", Params=1, ParamsDescription="Name of the backend to enable")]
-		internal bool AllowBackend (out string output, string [] args)
-		{
-			denied_backends.Remove (args [0]);
-			output = "Backend allowed (need to restart beagled for changes to take effect).";
-			return true;
-		}
-
-		[ConfigOption (Description="Disable a backend", Params=1, ParamsDescription="Name of the backend to disable")]
-		internal bool DenyBackend (out string output, string [] args)
-		{
-			denied_backends.Add (args [0]);
-			output = "Backend disabled (need to restart beagled for changes to take effect).";
-			return true;
-		}
-		
 		private bool allow_root = false;
 		public bool AllowRoot {
 			get { return allow_root; }
 			set { allow_root = value; }
 		}
-
-		[ConfigOption (Description="Add a static queryable", Params=1, ParamsDescription="Index path")]
-		internal bool AddStaticQueryable (out string output, string [] args)
-		{
-			static_queryables.Add (args [0]);
-			output = "Static queryable added.";
-			return true;
-		}
-
-		[ConfigOption (Description="Remove a static queryable", Params=1, ParamsDescription="Index path")]
-		internal bool DelStaticQueryable (out string output, string [] args)
-		{
-			static_queryables.Remove (args [0]);
-			output = "Static queryable removed.";
-			return true;
-		}
-		
-		[ConfigOption (Description="List user-specified static queryables", IsMutator=false)]
-		internal bool ListStaticQueryables (out string output, string [] args)
-		{
-			output = "User-specified static queryables:\n";
-			foreach (string index_path in static_queryables)
-				output += String.Format (" - {0}\n", index_path);
-			return true;
-		}
-
-		[ConfigOption (Description="Toggles whether static indexes will be enabled")]
-		internal bool ToggleAllowStaticBackend (out string output, string [] args)
-		{
-			allow_static_backend = !allow_static_backend;
-			output = "Static indexes are " + ((allow_static_backend) ? "enabled" : "disabled") + " (need to restart beagled for changes to take effect).";
-			return true;
-		}		
-
-		[ConfigOption (Description="Toggles whether your indexes will be synchronized locally if your home directory is on a network device (eg. NFS/Samba)")]
-		internal bool ToggleIndexSynchronization (out string output, string [] args)
-		{
-			index_synchronization = !index_synchronization;
-			output = "Index Synchronization is " + ((index_synchronization) ? "enabled" : "disabled") + ".";
-			return true;
-		}
-
-		[ConfigOption (Description="Toggles whether Beagle can be run as root")]
-		internal bool ToggleAllowRoot (out string output, string [] args)
-		{
-			allow_root = ! allow_root;
-			if (allow_root)
-				output = "Beagle is now permitted to run as root";
-			else
-				output = "Beagle is no longer permitted to run as root";
-			return true;
-		}
 	}
 
-	[ConfigSection (Name="indexing")]
 	public class IndexingConfig : Section 
 	{
 		private ArrayList roots = new ArrayList ();
@@ -1161,166 +1152,8 @@
 			get { return maildirs; }
 			set { maildirs = value; }
 		}
-
-		[ConfigOption (Description="List the indexing roots", IsMutator=false)]
-		internal bool ListRoots (out string output, string [] args)
-		{
-			output = "Current roots:\n";
-			if (this.index_home_dir == true)
-				output += " - Your home directory\n";
-			foreach (string root in roots)
-				output += " - " + root + "\n";
-
-			return true;
-		}
-
-		[ConfigOption (Description="Toggles whether your home directory is to be indexed as a root")]
-		internal bool IndexHome (out string output, string [] args)
-		{
-			if (index_home_dir)
-				output = "Your home directory will not be indexed.";
-			else
-				output = "Your home directory will be indexed.";
-			index_home_dir = !index_home_dir;
-			return true;
-		}
-
-		[ConfigOption (Description="Toggles whether any data should be indexed if the system is on battery")]
-		internal bool IndexWhileOnBattery (out string output, string [] args)
-		{
-			if (index_on_battery)
-				output = "Data will not be indexed while on battery.";
-			else
-				output = "Data will be indexed while on battery.";
-			index_on_battery = !index_on_battery;
-			return true;
-		}
-
-		[ConfigOption (Description="Toggles whether to index faster while the screensaver is on")]
-		internal bool FasterOnScreensaver (out string output, string [] args)
-		{
-			if (index_faster_on_screensaver)
-				output = "Data will be indexed normally while on screensaver.";
-			else
-				output = "Data will be indexed faster while on screensaver.";
-			index_faster_on_screensaver = !index_faster_on_screensaver;
-			return true;
-		}
-
-		[ConfigOption (Description="Add a root path to be indexed", Params=1, ParamsDescription="A path")]
-		internal bool AddRoot (out string output, string [] args)
-		{
-			roots.Add (args [0]);
-			output = "Root added.";
-			return true;
-		}
-
-		[ConfigOption (Description="Remove an indexing root", Params=1, ParamsDescription="A path")]
-		internal bool DelRoot (out string output, string [] args)
-		{
-			roots.Remove (args [0]);
-			output = "Root removed.";
-			return true;
-		}
-		
-		[ConfigOption (Description="List user-specified resources to be excluded from indexing", IsMutator=false)]
-		internal bool ListExcludes (out string output, string [] args)
-		{
-			output = "User-specified resources to be excluded from indexing:\n";
-			foreach (ExcludeItem exclude_item in excludes)
-				output += String.Format (" - [{0}] {1}\n", exclude_item.Type.ToString (), exclude_item.Value);
-			return true;
-		}
-
-		[ConfigOption (Description="Add a resource to exclude from indexing", Params=2, ParamsDescription="A type [path/pattern/mailfolder], a path/pattern/name")]
-		internal bool AddExclude (out string output, string [] args)
-		{
-			ExcludeType type;
-			try {
-				type = (ExcludeType) Enum.Parse (typeof (ExcludeType), args [0], true);
-			} catch {
-				output = String.Format("Invalid type '{0}'. Valid types: Path, Pattern, MailFolder", args [0]);
-				return false;
-			}
-
-			excludes.Add (new ExcludeItem (type, args [1]));
-			output = "Exclude added.";
-			return true;
-		}
-
-		[ConfigOption (Description="Remove an excluded resource", Params=2, ParamsDescription="A type [path/pattern/mailfolder], a path/pattern/name")]
-		internal bool DelExclude (out string output, string [] args)
-		{
-			ExcludeType type;
-			try {
-				type = (ExcludeType) Enum.Parse (typeof (ExcludeType), args [0], true);
-			} catch {
-				output = String.Format("Invalid type '{0}'. Valid types: Path, Pattern, MailFolder", args [0]);
-				return false;
-			}
-
-			foreach (ExcludeItem item in excludes) {
-				if (item.Type != type || item.Value != args [1])
-					continue;
-				excludes.Remove (item);
-				output = "Exclude removed.";
-				return true;
-			}
-
-			output = "Could not find requested exclude to remove.";
-			return false;
-		}
-
-		[ConfigOption (Description="Add a directory containing maildir emails. Use this when beagle is unable to determine the mimetype of files in this directory as message/rfc822",
-			       Params=2,
-			       ParamsDescription="path to the directory, extension (use * for any extension)")]
-		internal bool AddMaildir (out string output, string[] args)
-		{
-			Maildir maildir = new Maildir ();
-			maildir.Directory = args [0];
-			maildir.Extension = ((args [1] == null || args [1] == String.Empty) ? "*" : args [1]);
-			maildirs.Add (maildir);
-
-			output = String.Format ("Added maildir directory: {0} with extension '{1}'", maildir.Directory, maildir.Extension);
-			return true;
-		}
-
-		[ConfigOption (Description="Remove a directory from ListMaildirs",
-			       Params=2,
-			       ParamsDescription="path to the directory, extension")]
-		internal bool DelMaildir (out string output, string[] args)
-		{
-			args [1] = ((args [1] == null || args [1] == String.Empty) ? "*" : args [1]);
-
-			int count = -1;
-			foreach (Maildir maildir in maildirs) {
-				count ++;
-				if (maildir.Directory == args [0] && maildir.Extension == args [1])
-					break;
-			}
-
-			if (count != -1 && count != maildirs.Count) {
-				maildirs.RemoveAt (count);
-				output = "Maildir removed.";
-				return true;
-			}
-
-			output = "Could not find requested maildir to remove.";
-			return false;
-		}
-
-		[ConfigOption (Description="List user specified maildir directories", IsMutator=false)]
-		internal bool ListMaildirs (out string output, string [] args)
-		{
-			output = "User-specified maildir directories:\n";
-			foreach (Maildir maildir in maildirs)
-				output += String.Format (" - {0} with extension '{1}'\n", maildir.Directory, maildir.Extension);
-			return true;
-		}
-
 	}
 
-	[ConfigSection (Name="networking")]
 	public class NetworkingConfig : Section 
 	{
 		// Index sharing service is disabled by default
@@ -1357,90 +1190,12 @@
 			set { service_password = value; }
 		}
 
-		[ConfigOption (Description="Toggles whether searching over network will be enabled the next time the daemon starts.")]
-		internal bool NetworkSearch (out string output, string [] args)
-		{
-			if (service_enabled)
-				output = "Network search will be disabled.";
-			else
-				output = "Network search will be enabled.";
-			service_enabled = !service_enabled;
-			return true;
-		}
-
 		[XmlArray]
 		[XmlArrayItem (ElementName="NetworkService", Type=typeof (NetworkService))]
 		public ArrayList NetworkServices {
 			get { return network_services; }
 			set { network_services = value; }
 		}
-
-		[ConfigOption (Description="List available network services for querying", IsMutator=false)]
-		internal bool ListNetworkServices (out string output, string [] args)
-		{
-			output = "Currently registered network services:\n";
-
-			foreach (NetworkService service in network_services)
-				output += " - " + service.ToString () + "\n";
-
-#if ENAB
-			output += "\n";
-			output += "Available network services:\n";
-			
-			try {
-			
-			AvahiBrowser browser = new AvahiBrowser ();
-			//browser.Start ();
-
-			foreach (NetworkService service in browser.GetServicesBlocking ())
-				output += " - " + service.ToString () + "\n";
-
-			browser.Dispose ();
-
-			} catch (Exception e) {
-				Console.WriteLine ("Cannot connect to avahi service: " + e.Message);
-			}
-#endif
-
-			return true;
-		}
-
-		[ConfigOption (Description="Add a network service for querying", Params=2, ParamsDescription="name, hostname:port")]
-		internal bool AddNetworkService (out string output, string [] args)
-		{
-			string name = args [0];
-			string uri = args [1];
-			
-			if (uri.Split (':').Length < 2)
-				uri = uri.Trim() + ":4000";
-			
-			NetworkService service = new NetworkService (name, new Uri (uri), false, null);
-			network_services.Add (service);
-			
-			output = "Network service '" + service + "' added";
-
-			return true;
-		}
-		
-		[ConfigOption (Description="Remove a network service from querying", Params=1, ParamsDescription="name")]
-		internal bool RemoveNetworkService (out string output, string [] args)
-		{
-			string name = args[0];
-
-			foreach (NetworkService service in network_services) {
-				if (service.Name != name)
-					continue;
-
-				network_services.Remove (service);
-				output = "Network service '" + service.Name + "' removed";
-				
-				return true;
-			}
-
-			output = "Network service '" + name + "' not found in registered services";
-
-			return false;
-		}
 	}
 
 	public class Section {
@@ -1448,21 +1203,6 @@
 		public bool SaveNeeded = false;
 	}
 
-	internal class ConfigOption : Attribute {
-		public string Description;
-		public int Params;
-		public string ParamsDescription;
-		public bool IsMutator = true;
-	}
-
-	internal class ConfigSection : Attribute {
-		public string Name;
-	}
-
-	internal class ConfigException : Exception {
-		public ConfigException (string msg) : base (msg) { }
-	}
-
 	//////////////////////////////////////////////////////////////////////
 	
 	public enum ExcludeType {

Modified: branches/beagle-rdf/Util/F-Spot/JpegHeader.cs
==============================================================================
--- branches/beagle-rdf/Util/F-Spot/JpegHeader.cs	(original)
+++ branches/beagle-rdf/Util/F-Spot/JpegHeader.cs	Thu Feb 14 22:56:49 2008
@@ -4,22 +4,26 @@
  *
  * Copyright (c) 2006 Novell Inc. 
  * Copyright (c) 2007 Debajyoti Bera <dbera web gmail com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
  */
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
 
 using System;
 using System.IO;

Modified: branches/beagle-rdf/Util/KonqHistoryUtil.cs
==============================================================================
--- branches/beagle-rdf/Util/KonqHistoryUtil.cs	(original)
+++ branches/beagle-rdf/Util/KonqHistoryUtil.cs	Thu Feb 14 22:56:49 2008
@@ -43,8 +43,7 @@
 			reader.ReadLine ();
 
 			// line-2: URL
-			string _url = reader.ReadLine ();
-			url = System.Web.HttpUtility.UrlDecode (_url);
+			url = reader.ReadLine ();
 
 			// line-3: creation date
 			creation_date = reader.ReadLine ();

Modified: branches/beagle-rdf/Util/Log.cs
==============================================================================
--- branches/beagle-rdf/Util/Log.cs	(original)
+++ branches/beagle-rdf/Util/Log.cs	Thu Feb 14 22:56:49 2008
@@ -207,6 +207,47 @@
 
 		/////////////////////////////////////////////////////////////////////////////////////////
 
+		class SimpleQueue {
+			int pos;		// next write position in this queue
+			int size;		// size of this SimpleQueue
+			string[] buffer;	// the actual queue
+			
+			// Keep a buffer of last 4 big messages by default
+			public SimpleQueue () : this (4) { }
+			
+			public SimpleQueue (int size)
+			{
+				this.size = size;
+				this.buffer = new string [size];
+				this.pos = 0;
+			}
+
+			// Return false if message is in the buffer.
+			// Otherwise add the message to the buffer and return true.
+			public bool Add (string msg)
+			{
+				for (int i = 0; i < size; i ++) {
+					// null values are empty buffer positions
+					// which should be no problem to compare with msg
+					if (buffer [i] == msg)
+						return false;
+				}
+				
+				// write the new message to the current write position
+				buffer [pos] = msg;
+				
+				// move the write position to the next position
+				pos = (pos + 1) % size;
+
+				return true;
+			}
+
+		}
+
+		static private SimpleQueue msg_buffer = new SimpleQueue ();
+
+		/////////////////////////////////////////////////////////
+
 		static object write_lock = new object ();
 
 		static private void WriteLine (LogLevel level, string format, object [] args, Exception ex) 
@@ -214,10 +255,31 @@
 			if (level != LogLevel.Always && cutoff_level < level)
 				return;
 
-			string ex_str = null;
+			string msg_string = null;
+			if (format != null)
+				msg_string = String.Format (format, args);
 			if (ex != null)
-				ex_str = ex.ToString ();
-			
+				msg_string = String.Concat (msg_string,
+							    (msg_string != null ? "\n" : String.Empty),
+							    ex);
+
+			// Use the buffer only for multiline messages, which will mainly happen with exceptions
+			if (ex != null && ! msg_buffer.Add (msg_string)) {
+				msg_string = "(Repeated)";
+				if (format != null) {
+					msg_string = String.Format (format, args);
+					int newline = msg_string.IndexOf ('\n');
+					if (newline != -1) {
+						msg_string = msg_string.Substring (0, newline);
+						msg_string += " ...";
+					}
+				} else {
+					msg_string = ex.Message;
+				}
+
+				msg_string = "(Repeated) " + msg_string;
+			}
+
 			// This only happens if Log.Initialize was never called.
 			if (running_in_foreground && foreground_echo_writer == null)
 				foreground_echo_writer = Console.Out;
@@ -225,10 +287,9 @@
 			if (foreground_echo_writer != null) {
 				foreground_echo_writer.Write (level);
 				foreground_echo_writer.Write (": ");
-				if (format != null)
-					foreground_echo_writer.WriteLine (format, args);
-				if (ex_str != null)
-					foreground_echo_writer.WriteLine (ex_str);
+
+				if (msg_string != null)
+					foreground_echo_writer.WriteLine (msg_string);
 				foreground_echo_writer.Flush ();
 			}
 
@@ -272,13 +333,8 @@
 			message = new StringBuilder ();
 			message.Append (prefix);
 			message.Remove (0, 1); // remove leading \n
-			if (format != null)
-				message.AppendFormat (format, args);
-			if (ex_str != null) {
-				if (format != null)
-					message.Append ('\n');
-				message.Append (ex_str);
-			}
+			if (msg_string != null)
+				message.Append (msg_string);
 			message.Replace ("\n", prefix);
 
 			string message_str;

Modified: branches/beagle-rdf/Util/Makefile.am
==============================================================================
--- branches/beagle-rdf/Util/Makefile.am	(original)
+++ branches/beagle-rdf/Util/Makefile.am	Thu Feb 14 22:56:49 2008
@@ -36,9 +36,9 @@
 
 UTIL_CSFILES = 			        	\
 	$(srcdir)/ArrayFu.cs              	\
+	$(srcdir)/Battery.cs			\
 	$(srcdir)/BetterBitArray.cs		\
 	$(srcdir)/camel.cs              	\
-	$(srcdir)/CommandLineFu.cs		\
 	$(srcdir)/Config.cs			\
 	$(srcdir)/DateTimeUtil.cs		\
 	$(srcdir)/DelayedTextWriter.cs		\
@@ -98,6 +98,30 @@
 	$(srcdir)/F-Spot/PixbufUtils.cs		\
 	$(srcdir)/F-Spot/Tiff.cs		\
 	$(srcdir)/F-Spot/XmpFile.cs		\
+	$(srcdir)/Hal/AccessControl.cs		\
+	$(srcdir)/Hal/CPUFreq.cs		\
+	$(srcdir)/Hal/Context.cs		\
+	$(srcdir)/Hal/Device.cs			\
+	$(srcdir)/Hal/IAccessControl.cs		\
+	$(srcdir)/Hal/ICPUFreq.cs		\
+	$(srcdir)/Hal/IDevice.cs		\
+	$(srcdir)/Hal/IKillSwitch.cs		\
+	$(srcdir)/Hal/ILaptopPanel.cs		\
+	$(srcdir)/Hal/ILightSensor.cs		\
+	$(srcdir)/Hal/IManager.cs		\
+	$(srcdir)/Hal/IStorage.cs		\
+	$(srcdir)/Hal/ISystemPowerManagement.cs	\
+	$(srcdir)/Hal/IVolume.cs		\
+	$(srcdir)/Hal/IVolumeCrypto.cs		\
+	$(srcdir)/Hal/KillSwitch.cs		\
+	$(srcdir)/Hal/LaptopPanel.cs		\
+	$(srcdir)/Hal/LightSensor.cs		\
+	$(srcdir)/Hal/Manager.cs		\
+	$(srcdir)/Hal/PropertyModification.cs	\
+	$(srcdir)/Hal/Storage.cs		\
+	$(srcdir)/Hal/SystemPowerManagement.cs	\
+	$(srcdir)/Hal/Volume.cs			\
+	$(srcdir)/Hal/VolumeCrypto.cs		\
 	$(srcdir)/SemWeb/AssemblyInfo.cs        \
 	$(srcdir)/SemWeb/NamespaceManager.cs    \
 	$(srcdir)/SemWeb/Util.cs                \
@@ -125,13 +149,14 @@
 	$(srcdir)/SemWeb/Algos.cs               \
 	$(srcdir)/SemWeb/SparqlClient.cs	\
 	$(srcdir)/SemWeb/XPathSemWebNavigator.cs\
-	$(srcdir)/PropertyKeywordAttribute.cs
+	$(srcdir)/QueryKeywordMapping.cs
 
 # Semweb compile flag
 CSFLAGS += -define:DOTNET2
 
 UTIL_ASSEMBLIES =				\
 	$(BEAGLED_LIBS)				\
+	$(NDESK_DBUS_GLIB_LIBS)			\
 	-r:System.Data				\
 	-r:Mono.Data.Sqlite			\
 	-r:Mono.Posix				\
@@ -225,6 +250,7 @@
 
 
 COND_CS_FILES =				\
+	$(srcdir)/AvahiBrowser.cs	\
 	$(srcdir)/ChmFile.cs		\
 	$(srcdir)/Galago.cs		\
 	$(srcdir)/Thunderbird.cs

Modified: branches/beagle-rdf/Util/NautilusTools.cs
==============================================================================
--- branches/beagle-rdf/Util/NautilusTools.cs	(original)
+++ branches/beagle-rdf/Util/NautilusTools.cs	Thu Feb 14 22:56:49 2008
@@ -52,8 +52,21 @@
 				yield break;
 
 			XmlDocument doc = new XmlDocument ();
-			StreamReader reader = new StreamReader (metafile);
-			doc.Load (reader);
+			StreamReader reader = null;
+			
+			try {
+				reader = new StreamReader (metafile);
+				doc.Load (reader);
+			} catch (Exception e) {
+				Log.Error (e, "Error while trying to parse nautilus metadata file {0}", metafile);
+
+				if (reader != null)
+					reader.Close ();
+				reader = null;
+			}
+
+			if (reader == null)
+				yield break;
 
 			foreach (XmlNode node in doc.SelectNodes ("/directory/file[ name]")) {
 				XmlNode timestamp_node = node.Attributes.GetNamedItem ("timestamp");

Modified: branches/beagle-rdf/Util/PathFinder.cs
==============================================================================
--- branches/beagle-rdf/Util/PathFinder.cs	(original)
+++ branches/beagle-rdf/Util/PathFinder.cs	Thu Feb 14 22:56:49 2008
@@ -206,5 +206,27 @@
 				return dir;
 			}
 		}
+
+		// Location of the global config files.
+		// Once installted, it is Sysconfdir/beagle
+		// Otherwise it is $BEAGLE_CONF_DIR
+		static string config_data_dir = null;
+		static public string ConfigDataDir {
+			get {
+				if (config_data_dir == null) {
+					config_data_dir = Environment.GetEnvironmentVariable ("BEAGLE_CONF_DIR");
+					if (config_data_dir == null)
+						config_data_dir = Path.Combine (ExternalStringsHack.SysConfDir, "beagle");
+
+					if (config_data_dir.EndsWith ("/"))
+						config_data_dir = config_data_dir.Remove (config_data_dir.Length - 1, 1);
+					config_data_dir = Path.GetFullPath (config_data_dir);
+					if (! Directory.Exists (config_data_dir))
+						throw new Exception ("Global config directory '"+config_data_dir+"' doesn't exist");
+				}
+
+				return config_data_dir;
+			}
+		}
 	}
 }

Modified: branches/beagle-rdf/Util/SafeProcess.cs
==============================================================================
--- branches/beagle-rdf/Util/SafeProcess.cs	(original)
+++ branches/beagle-rdf/Util/SafeProcess.cs	Thu Feb 14 22:56:49 2008
@@ -26,6 +26,7 @@
 
 using System;
 using System.IO;
+using System.Collections;
 using System.Runtime.InteropServices;
 using Mono.Unix;
 using GLib;
@@ -39,6 +40,7 @@
 		private UnixStream stdin_stream, stdout_stream, stderr_stream;
 		private int pid;
 		private int cpu_limit, mem_limit;
+		private bool use_lang_c = false;
 
 		public string[] Arguments {
 			get { return args; }
@@ -86,8 +88,14 @@
 			set { mem_limit = value; }
 		}
 
+		public bool UseLangC {
+			get { return use_lang_c; }
+			set { use_lang_c = value; }
+		}
+
 		[DllImport ("libbeagleglue")]
 		static extern void spawn_async_with_pipes_and_limits (string[] argv,
+								      string[] env,
 								      int cpu_limit,
 								      int mem_limit,
 								      out int pid,
@@ -110,6 +118,23 @@
 				args = tmp_args;
 			}
 
+			// If LANG=C needs to be specified, then
+			// copy the parents environment variable
+			// and appand LANG=C to it.
+			// Make sure to null-terminate the env array.
+			string[] env = null;
+			if (use_lang_c) {
+				IDictionary env_dict = Environment.GetEnvironmentVariables ();
+				env = new string [env_dict.Count + 2];
+				int count = 0;
+				foreach (DictionaryEntry entry in env_dict)
+					if (entry.Key != "LANG")
+						env [count ++] = String.Concat (entry.Key, "=", entry.Value);
+
+				env [count ++] = "LANG=C";
+				env [count] = null;
+			}
+
 			IntPtr in_ptr = IntPtr.Zero, out_ptr = IntPtr.Zero, err_ptr = IntPtr.Zero;
 
 			try {
@@ -123,6 +148,7 @@
 					err_ptr = Marshal.AllocHGlobal (IntPtr.Size);
 
 				spawn_async_with_pipes_and_limits (args,
+								   env,
 								   cpu_limit,
 								   mem_limit,
 								   out pid,
@@ -179,4 +205,4 @@
 		internal SafeProcessException (GException gexception) : base (gexception.Message) { }
 	}
 			
-}
\ No newline at end of file
+}

Modified: branches/beagle-rdf/Util/Scheduler.cs
==============================================================================
--- branches/beagle-rdf/Util/Scheduler.cs	(original)
+++ branches/beagle-rdf/Util/Scheduler.cs	Thu Feb 14 22:56:49 2008
@@ -703,7 +703,7 @@
 			bool need_throttle = false;
 
 			// Never speed up if we are using the battery.
-			if (idle_time > idle_threshold && ! SystemInformation.UsingBattery) {
+			if (idle_time > idle_threshold && ! Battery.UsingBattery) {
 				is_idle = true;
 				double t = (idle_time - idle_threshold) / idle_ramp_up_time;				     
 				idle_scale = (1 - Math.Min (t, 1.0));

Modified: branches/beagle-rdf/Util/StringFu.cs
==============================================================================
--- branches/beagle-rdf/Util/StringFu.cs	(original)
+++ branches/beagle-rdf/Util/StringFu.cs	Thu Feb 14 22:56:49 2008
@@ -810,7 +810,8 @@
 			line = line.Replace ("&gt;", ">");
 			line = line.Replace ("&quot;", "\"");
 			line = line.Replace ("&amp;", "&");
-			line = line.Replace ("&nbsp", " ");
+			line = line.Replace ("&nbsp;", " ");
+			line = line.Replace ("&apos;", "\'");
 
 			return line;
   		}

Modified: branches/beagle-rdf/Util/SystemInformation.cs
==============================================================================
--- branches/beagle-rdf/Util/SystemInformation.cs	(original)
+++ branches/beagle-rdf/Util/SystemInformation.cs	Thu Feb 14 22:56:49 2008
@@ -185,68 +185,6 @@
 
 		///////////////////////////////////////////////////////////////
 
-		public const double acpi_poll_delay = 30;
-		const string ac_present_string = "on-line";
-
-		private static readonly string[] proc_ac_state_filenames = new string[] {
-			"/proc/acpi/ac_adapter/AC/state",
-			"/proc/acpi/ac_adapter/AC0/state",
-			"/proc/acpi/ac_adapter/ADp1/state",
-			"/proc/acpi/ac_adapter/ACAD/state"
-		};
-
-		private static string proc_ac_state_filename = null;
-		private static bool proc_ac_state_exists = true;
-		private static DateTime using_battery_time = DateTime.MinValue;
-		private static bool using_battery;
-
-		public static void CheckAcpi ()
-		{
-			if (! proc_ac_state_exists)
-				return;
-
-			if ((DateTime.Now - using_battery_time).TotalSeconds < acpi_poll_delay)
-				return;
-
-			if (proc_ac_state_filename == null) {
-				foreach (string s in proc_ac_state_filenames) {
-					if (File.Exists (s)) {
-						proc_ac_state_filename = s;
-						break;
-					}
-				}
-			}
-					
-			if (proc_ac_state_filename == null || ! File.Exists (proc_ac_state_filename)) {
-				proc_ac_state_exists = false;
-				using_battery = false;
-				return;
-			}
-
-			Stream stream = new FileStream (proc_ac_state_filename,
-							System.IO.FileMode.Open,
-							FileAccess.Read,
-							FileShare.Read);
-			TextReader reader = new StreamReader (stream);
-
-			string line = reader.ReadLine ();
-			using_battery = (line != null) && (line.IndexOf (ac_present_string) == -1);
-			
-			reader.Close ();
-			stream.Close ();
-
-			using_battery_time = DateTime.Now;
-		}
-
-		public static bool UsingBattery {
-			get { 
-				CheckAcpi ();
-				return using_battery;
-			}
-		}
-
-		///////////////////////////////////////////////////////////////
-
 		[DllImport ("libbeagleglue")]
 		extern static int get_vmsize ();
 
@@ -266,8 +204,8 @@
 			int vm_size = VmSize;
 			int vm_rss = VmRss;
 
-			Logger.Log.Debug ("Memory usage: VmSize={0:.0} MB, VmRSS={1:.0} MB,  GC.GetTotalMemory={2}",
-					  vm_size/1024.0, vm_rss/1024.0, GC.GetTotalMemory (false));
+			Logger.Log.Debug ("Memory usage: VmSize={0:.0} MB, VmRSS={1:.0} MB,  GC.GetTotalMemory={2} ({3} colls)",
+					  vm_size/1024.0, vm_rss/1024.0, GC.GetTotalMemory (false), GC.CollectionCount (2));
 		}
 
 		///////////////////////////////////////////////////////////////
@@ -447,13 +385,12 @@
 		public static void Main ()
 		{
 			while (true) {
-				Console.WriteLine ("{0} {1} {2} {3} {4} {5} {6} {7}",
+				Console.WriteLine ("{0} {1} {2} {3} {4} {5} {6}",
 						   LoadAverageOneMinute,
 						   LoadAverageFiveMinute,
 						   LoadAverageFifteenMinute,
 						   ScreenSaverRunning,
 						   InputIdleTime,
-						   UsingBattery,
 						   DiskStatsReadReqs,
 						   VmSize);
 				System.Threading.Thread.Sleep (1000);

Modified: branches/beagle-rdf/Util/VersionFu.cs
==============================================================================
--- branches/beagle-rdf/Util/VersionFu.cs	(original)
+++ branches/beagle-rdf/Util/VersionFu.cs	Thu Feb 14 22:56:49 2008
@@ -33,6 +33,8 @@
 	
 	public static class VersionFu {
 		
+		const string DefaultCopyright = "Copyright (C) 2004-2007 Novell, Inc.";
+
 		public static void PrintHeader (Assembly a)
 		{
 			// Retrieves name and description that are stored as assembly
@@ -44,6 +46,7 @@
 
 			AssemblyTitleAttribute title = (AssemblyTitleAttribute) Attribute.GetCustomAttribute (a, typeof (AssemblyTitleAttribute));
 			AssemblyDescriptionAttribute desc = (AssemblyDescriptionAttribute) Attribute.GetCustomAttribute (a, typeof (AssemblyDescriptionAttribute));
+			AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute) Attribute.GetCustomAttribute (a, typeof (AssemblyCopyrightAttribute));
 
 			StringBuilder text = new StringBuilder ();
 			
@@ -51,7 +54,7 @@
 				text.AppendFormat ("{0}: {1}.\n", title.Title, desc.Description);
 
 			text.Append ("Web page: http://www.beagle-project.org/\n";);
-			text.Append ("Copyright (C) 2004-2007 Novell, Inc.\n");
+			text.Append (copyright == null ? DefaultCopyright : copyright.Copyright);
 
 			Console.WriteLine (text);
 		}

Modified: branches/beagle-rdf/beagled/AssemblyInfo.cs
==============================================================================
--- branches/beagle-rdf/beagled/AssemblyInfo.cs	(original)
+++ branches/beagle-rdf/beagled/AssemblyInfo.cs	Thu Feb 14 22:56:49 2008
@@ -76,5 +76,6 @@
 	typeof (Beagle.Daemon.OperaQueryable.OperaQueryable),
 	typeof (Beagle.Daemon.PidginQueryable.PidginQueryable),
 	typeof (Beagle.Daemon.StaticQueryable),
-	typeof (Beagle.Daemon.TomboyQueryable.TomboyQueryable)
+	typeof (Beagle.Daemon.TomboyQueryable.TomboyQueryable),
+    typeof (Beagle.Daemon.EmpathyQueryable.EmpathyQueryable)                   
 )]

Modified: branches/beagle-rdf/beagled/BeagleDaemon.cs
==============================================================================
--- branches/beagle-rdf/beagled/BeagleDaemon.cs	(original)
+++ branches/beagle-rdf/beagled/BeagleDaemon.cs	Thu Feb 14 22:56:49 2008
@@ -116,7 +116,7 @@
 
 				if (send_sigprof) {
 					Log.Debug ("Suspicious memory size change detected.  Sending SIGPROF to ourself ({0})", sigprof_count++);
-					Mono.Unix.Native.Syscall.kill (Process.GetCurrentProcess ().Id, Mono.Unix.Native.Signum.SIGPROF);
+					Mono.Unix.Native.Syscall.kill (System.Diagnostics.Process.GetCurrentProcess ().Id, Mono.Unix.Native.Signum.SIGPROF);
 				}
 			}
 		}
@@ -172,24 +172,20 @@
 
 		public static bool StartupProcess ()
 		{
-			Log.Debug ("Beginning main loop");
-
 			// Profile our initialization
 			Stopwatch stopwatch = new Stopwatch ();
 			stopwatch.Start ();
 
 			// Fire up our server
 			if (! StartServer ()) {
-				if (arg_replace)
-				{
-					ReplaceExisting ();
-				}		
-				else {
+				if (! arg_replace) {
 					Logger.Log.Error ("Could not set up the listener for beagle requests.  "
 							  + "There is probably another beagled instance running.  "
 							  + "Use --replace to replace the running service");
 					Environment.Exit (1);
 				}
+
+				ReplaceExisting ();
 			}
 			
 			// Set up out-of-process indexing
@@ -209,25 +205,22 @@
 			Logger.Log.Debug ("Starting QueryDriver");
 			QueryDriver.Start ();
 
-			bool initially_on_battery = SystemInformation.UsingBattery && ! config.GetOption (Conf.Names.IndexOnBattery, false);
+			// Start our battery monitor so we can shut down the
+			// scheduler if needed.
+			BatteryMonitor.Init ();
+
+			bool initially_on_battery = ! BatteryMonitor.UsingAC && ! config.GetOption (Conf.Names.IndexOnBattery, false);
 
 			// Start the Global Scheduler thread
 			if (! arg_disable_scheduler) {
 				if (! initially_on_battery) {
 					Logger.Log.Debug ("Starting Scheduler thread");
 					Scheduler.Global.Start ();
-				} else
+				} else {
 					Log.Debug ("Beagle started on battery, not starting scheduler thread");
+				}
 			}
 
-			// Poll the battery status so we can shut down the
-			// scheduler if needed.  Ideally at some point this
-			// will become some sort of D-BUS signal, probably from
-			// something like gnome-power-manager.
-			prev_on_battery = initially_on_battery;
-			// Use 1 sec more than acpi poll interval
-			GLib.Timeout.Add (((int) SystemInformation.acpi_poll_delay + 1) * 1000, CheckBatteryStatus);
-
 			// Start our Inotify threads
 			Inotify.Start ();
 	
@@ -458,21 +451,18 @@
 
 			MainLoopThread = Thread.CurrentThread;
 
-			Log.Initialize (PathFinder.LogDir,
-					"Beagle", 
-					// FIXME: We always turn on full debugging output!  We are still
-					// debugging this code, after all...
-					//arg_debug ? LogLevel.Debug : LogLevel.Warn,
-					LogLevel.Debug,
-					arg_fg);
-
+			// FIXME: We always turn on full debugging output!  We are still
+			// debugging this code, after all...
+			// arg_debug ? LogLevel.Debug : LogLevel.Warn
+			
+			Log.Initialize (PathFinder.LogDir, "Beagle", LogLevel.Debug, arg_fg);
 			Log.Always ("Starting Beagle Daemon (version {0})", ExternalStringsHack.Version);
 			Log.Always ("Running on {0}", SystemInformation.MonoRuntimeVersion);
 			Log.Always ("Command Line: {0}",
 					   Environment.CommandLine != null ? Environment.CommandLine : "(null)");
 
 			if (! ExtendedAttribute.Supported) {
-				Logger.Log.Warn ("Extended attributes are not supported on this filesystem.  " +
+				Logger.Log.Warn ("Extended attributes are not supported on this filesystem. " +
 						 "Performance will suffer as a result.");
 			}
 
@@ -483,13 +473,14 @@
 
 			// Check if global configuration files are installed
 			if (! Conf.CheckGlobalConfig ()) {
-				Console.WriteLine ("Global configuration files not found in {0}", Conf.GlobalDir);
+				Console.WriteLine ("Global configuration files not found in '{0}'", PathFinder.ConfigDataDir);
 				Environment.Exit (-1);
 			}
 
 			// Start our memory-logging thread
-			if (arg_debug_memory)
+			if (arg_debug_memory) {
 				ExceptionHandlingThread.Start (new ThreadStart (LogMemoryUsage));
+			}
 
 			// Do BEAGLE_EXERCISE_THE_DOG_HARDER-related processing.
 			ExerciseTheDogHarder ();
@@ -514,14 +505,13 @@
 
 			main_loop = new MainLoop ();
 			Shutdown.RegisterMainLoop (main_loop);
-
+			
 			// Defer all actual startup until the main loop is
 			// running.  That way shutdowns during the startup
 			// process work correctly.
 			GLib.Idle.Add (new GLib.IdleHandler (StartupProcess));
 
 			// Start our event loop.
-			//Logger.Log.Debug ("Starting main loop");
 			main_loop.Run ();
 
 			// We're out of the main loop now, join all the
@@ -540,29 +530,6 @@
 		}
 
 		/////////////////////////////////////////////////////////////////////////////
-		
-		private static bool prev_on_battery = false;
-
-		private static bool CheckBatteryStatus ()
-		{
-			bool index_on_battery = Conf.Daemon.GetOption (Conf.Names.IndexOnBattery, false);
-
-			if (prev_on_battery && (! SystemInformation.UsingBattery || index_on_battery)) {
-				if (! SystemInformation.UsingBattery)
-					Log.Info ("Detected a switch from battery to AC power.  Restarting scheduler.");
-				Scheduler.Global.Start ();
-				prev_on_battery = false;
-			} else if (! prev_on_battery && SystemInformation.UsingBattery && ! index_on_battery) {
-				Log.Info ("Detected a switch from AC power to battery.  Stopping scheduler.");
-				Scheduler.Global.Stop ();
-				prev_on_battery = true;
-			}
-
-			return true;
-		}
-
-
-		/////////////////////////////////////////////////////////////////////////////
 
 		private delegate int XIOErrorHandler (IntPtr display);
 

Modified: branches/beagle-rdf/beagled/BuildIndex.cs
==============================================================================
--- branches/beagle-rdf/beagled/BuildIndex.cs	(original)
+++ branches/beagle-rdf/beagled/BuildIndex.cs	Thu Feb 14 22:56:49 2008
@@ -64,6 +64,9 @@
 
 		/////////////////////////////////////////////////////////
 
+		// 1. Different handling of --disable-directories
+		const int MINOR_VERSION = 1;
+
 		// Files and directories that are allowed to be in the target
 		// directory before we blow it away.  If we encounter any file
 		// or dir not in this list, we'll bail out.
@@ -216,6 +219,9 @@
 					break;
 
 				default:
+					if (arg.StartsWith ("-") || arg.StartsWith ("--"))
+						PrintUsage ();
+
 					string path = Path.IsPathRooted (arg) ? arg : Path.GetFullPath (arg);
 					if (path != "/" && path.EndsWith ("/"))
 						path = path.TrimEnd ('/');
@@ -304,12 +310,13 @@
 				arg_source = dir.Name;
 			}
 
-			if (SystemInformation.UsingBattery && arg_disable_on_battery) {
+			if (Battery.UsingBattery && arg_disable_on_battery) {
 				Log.Always ("Indexer is disabled when on battery power (--disable-on-battery)");
 				Environment.Exit (0);
 			}
 
-			string global_files_config = Path.Combine (Conf.GlobalDir, Conf.Names.FilesQueryableConfig + ".xml");
+			string global_files_config = Path.Combine (PathFinder.ConfigDataDir, "config-files");
+			global_files_config = Path.Combine (global_files_config, Conf.Names.FilesQueryableConfig + ".xml");
 			if (! File.Exists (global_files_config)) {
 				Log.Error ("Global configuration file not found {0}", global_files_config);
 				Environment.Exit (0);
@@ -331,11 +338,6 @@
 					denied_regex = StringFu.GetPatternRegex (denied_patterns);
 			}
 
-			if (arg_disable_directories && arg_delete) {
-				Log.Warn ("--enable-deletion is ignored as --disable-directories is used");
-				arg_delete = false;
-			}
-
 			Log.Always ("Starting beagle-build-index (pid {0}) at {1}", Process.GetCurrentProcess ().Id, DateTime.Now);
 
 			// Set system priorities so we don't slow down the system
@@ -343,7 +345,7 @@
 			SystemPriorities.SetSchedulerPolicyBatch ();
 			SystemPriorities.Renice (19);
 			
-			driver = new LuceneIndexingDriver (arg_output, false);
+			driver = new LuceneIndexingDriver (arg_output, MINOR_VERSION, false);
 			driver.TextCache = (arg_cache_text) ? new TextCache (arg_output) : null;
 			if (driver.TextCache != null)
 				driver.TextCache.WorldReadable = true;
@@ -429,8 +431,7 @@
 			while (pending_directories.Count > 0) {
 				DirectoryInfo dir = (DirectoryInfo) pending_directories.Dequeue ();
 
-				if (! arg_disable_directories)
-					AddToRequest (DirectoryToIndexable (dir, modified_directories));
+				AddToRequest (DirectoryToIndexable (dir, modified_directories));
 
 				try {
 					if (arg_recursive)
@@ -470,7 +471,7 @@
 				ICollection all_dirent = GetAllItemsInDirectory (subdir);
 				foreach (Dirent info in all_dirent) {
 					// check if the item exists
-					if (File.Exists (info.FullName) || 
+					if ((! info.IsDirectory && File.Exists (info.FullName)) || 
 					    (info.IsDirectory && Directory.Exists (info.FullName)))
 						continue;
 
@@ -537,7 +538,6 @@
 					Logger.Log.Debug ("Flushing driver, {0} items in queue", pending_request.Count);
 
 				reschedule = FlushIndexer (driver);
-				Console.WriteLine (reschedule);
 
 				// Super Lame Hack: gtk-sharp up to 2.10 requires a main loop
 				// to dispose of any managed wrappers around GObjects.  Since
@@ -643,11 +643,12 @@
 			Indexable indexable = new Indexable (uri);
 			indexable.Timestamp = file.LastWriteTimeUtc;
 			indexable.Crawled = true;
+			indexable.AddProperty (Property.NewUnsearched ("fixme:filesize", file.Length));
 			FSQ.AddStandardPropertiesToIndexable (indexable, file.Name, Guid.Empty, false);
 
 			// Store directory name in the index
 			string dirname = file.DirectoryName;
-			indexable.AddProperty (Property.NewUnsearched (ParentDirUriPropKey, UriFu.PathToFileUri (dirname)));
+			indexable.AddProperty (Property.NewUnsearched (Property.ParentDirUriPropKey, UriFu.PathToFileUri (dirname)));
 
 			return indexable;
 		}
@@ -661,11 +662,17 @@
 			// And if the mtime of the directory is same as that in the attributes store
 			FileAttributes attr = fa_store.Read (dir.FullName);
 
-			// If the directory exists in the fa store, then it is already indexed
+			// If the directory exists in the fa store, then it is already indexed.
 			if (attr != null) {
-				if (arg_delete && ! FileAttributesStore.IsUpToDate (dir.FullName, attr))
-					modified_directories.Enqueue (dir);
-				return null;
+				// If we don't care about deleted content then we are fine.
+				// If the attributes are up-to-date, then we are fine too.
+				if (! arg_delete || FileAttributesStore.IsUpToDate (dir.FullName, attr))
+					return null;
+
+				// But the last write time needs to be uptodate to support enable-deletion,
+				// so we actually index the directories, even if --disable-directories
+				// is set.
+				modified_directories.Enqueue (dir);
 			}
 
 			// Create the indexable and add the standard properties we
@@ -675,13 +682,18 @@
 			indexable.MimeType = "inode/directory";
 			indexable.NoContent = true;
 			indexable.Timestamp = dir.LastWriteTimeUtc;
-			FSQ.AddStandardPropertiesToIndexable (indexable, dir.Name, Guid.Empty, false);
+
+			// Store the directory information in the index anyway, but if --disable-directories
+			// was passed, then do not store the names and other standard properties
+			// used during searching
+			if (! arg_disable_directories)
+				FSQ.AddStandardPropertiesToIndexable (indexable, dir.Name, Guid.Empty, false);
 
 			// Add directory name property
 			string dirname = dir.Parent.FullName;
-			indexable.AddProperty (Property.NewUnsearched (ParentDirUriPropKey, UriFu.PathToFileUri (dirname)));
+			indexable.AddProperty (Property.NewUnsearched (Property.ParentDirUriPropKey, UriFu.PathToFileUri (dirname)));
 
-			indexable.AddProperty (Property.NewBool (IsDirectoryPropKey, true));
+			indexable.AddProperty (Property.NewBool (Property.IsDirectoryPropKey, true));
 
 			return indexable;
 		}
@@ -724,18 +736,15 @@
 			}
 		}
 
-		private const string ParentDirUriPropKey = "beagle:ParentDirUri";
-		private const string IsDirectoryPropKey = "beagle:IsDirectory";
-
 		// Returns a list of all files and directories in dir
 		static ICollection GetAllItemsInDirectory (DirectoryInfo dir)
 		{
 			// form the query
 			string parent_uri_str = UriFu.PathToFileUri (dir.FullName).ToString ();
+
 			// Instead of taking the painfull way of using BeagleAnalyzer, lets just add the prefix manually
-			//parent_uri_str = "_:" + parent_uri_str;
 			// LuceneCommon thinks exposing secret property type encoding is bad, I think so too... except for now
-			string key = "prop:k:" + ParentDirUriPropKey;
+			string key = "prop:k:" + Property.ParentDirUriPropKey;
 			//Logger.Log.Debug ("Querying for {0}={1}", parent_uri_str, key);
 			LNS.Query query = new LNS.TermQuery (new Term (key, parent_uri_str));
 
@@ -786,12 +795,13 @@
 
 			path = doc.Get ("Uri");
 
-			string prop_key = "prop:k:" + IsDirectoryPropKey;
+			string prop_key = "prop:k:" + Property.IsDirectoryPropKey;
 			foreach (Field f in doc.Fields ()) {
 				if (f.Name () != prop_key)
 					continue;
 
-				is_dir = (f.StringValue ().Substring (2) == "true");
+				// Format of fields: from LuceneCommon.cs:AddPropertyToDocument
+				is_dir = (f.StringValue ().Substring (3) == "true");
 				break;
 			}
 
@@ -877,17 +887,14 @@
 				"  --recursive\t\t\tCrawl source path recursivly.\n" + 
 				"  --enable-deletion\t\tRemove deleted files and directories from index.\n" +
 				"                   \t\tIndex should be created and always updated with this option.\n" +
-				"                   \t\tOption only works if --disable-directories is NOT specified.\n" +
 				"  --enable-text-cache\t\tBuild text-cache of documents used for snippets.\n" +
 				"  --disable-directories\t\tDon't add directories to the index.\n" +
 				"  --disable-filtering\t\tDisable all filtering of files. Only index attributes.\n" + 
 				"  --allow-pattern [pattern]\tOnly allow files that match the pattern to be indexed.\n" + 
 				"  --deny-pattern [pattern]\tKeep any files that match the pattern from being indexed.\n" + 
 				"  --disable-restart\t\tDon't restart when memory usage gets above a certain threshold.\n" +
-				"  --disable-on-battery\t\tDisable indexer while on battery power.\n" +
-				"  --debug\t\t\tEcho verbose debugging information.\n\n";
+				"  --disable-on-battery\t\tDisable indexer while on battery power.\n";
 
-			
 			Console.WriteLine (usage);
 			Environment.Exit (0);
 		}

Modified: branches/beagle-rdf/beagled/DumpIndex.cs
==============================================================================
--- branches/beagle-rdf/beagled/DumpIndex.cs	(original)
+++ branches/beagle-rdf/beagled/DumpIndex.cs	Thu Feb 14 22:56:49 2008
@@ -225,18 +225,8 @@
 	// Dump the fields: we do this via direct Lucene access.
 	static void DumpOneIndex_Fields (string index_name)
 	{
-		Console.WriteLine ("Index: {0}", index_name);
-
 		LuceneQueryingDriver driver;
-		try
-		{
-			driver = new LuceneQueryingDriver (index_name, -1, true);
-		}
-		catch (InvalidOperationException e)
-		{
-			Console.Error.WriteLine("There is no Lucene index in the index folder '{0}':\n{1}", index_name, e.StackTrace);
-			return;
-		}
+		driver = new LuceneQueryingDriver (index_name, -1, true);
 		
 		IndexReader reader;
 		reader = IndexReader.Open (driver.PrimaryStore);

Modified: branches/beagle-rdf/beagled/EvolutionDataServerQueryable/SchedulingIndexableGenerator.cs
==============================================================================
--- branches/beagle-rdf/beagled/EvolutionDataServerQueryable/SchedulingIndexableGenerator.cs	(original)
+++ branches/beagle-rdf/beagled/EvolutionDataServerQueryable/SchedulingIndexableGenerator.cs	Thu Feb 14 22:56:49 2008
@@ -90,8 +90,15 @@
 
 				if (indexables.Count > 0)
 					self_task.Reschedule = true;
-				else
+				else {
+					// Instruct the scheduler to not reschedule
+					// this task. Otherwise AddIndexableGenerator
+					// might reschedule this task once more
+					// to figure out there is no more
+					// indexables.
+					self_task.Reschedule = false;
 					self_task = null;
+				}
 			}
 		}
 	}

Modified: branches/beagle-rdf/beagled/EvolutionDataServerQueryable/SourcesHandler.cs
==============================================================================
--- branches/beagle-rdf/beagled/EvolutionDataServerQueryable/SourcesHandler.cs	(original)
+++ branches/beagle-rdf/beagled/EvolutionDataServerQueryable/SourcesHandler.cs	Thu Feb 14 22:56:49 2008
@@ -123,7 +123,13 @@
 
 		private void OnSourceAdded (object o, SourceAddedArgs args)
 		{
-			Container cont = (Container) Activator.CreateInstance (this.container_type, new object[] { args.Source, this.queryable, this.fingerprint });
+			object[] new_args = new object [this.ctor_args.Length + 3];
+			new_args [0] = args.Source;
+			new_args [1] = this.queryable;
+			new_args [2] = this.fingerprint;
+			Array.Copy (this.ctor_args, 0, new_args, 3, this.ctor_args.Length);
+
+			Container cont = (Container) Activator.CreateInstance (this.container_type, new_args);
 			if (!cont.OpenClient ())
 				return;
 			cont.IndexAll ();
@@ -136,4 +142,4 @@
 			cont.Remove ();
 		}
 	}
-}
\ No newline at end of file
+}

Modified: branches/beagle-rdf/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs
==============================================================================
--- branches/beagle-rdf/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs	(original)
+++ branches/beagle-rdf/beagled/EvolutionMailQueryable/EvolutionMailIndexableGenerator.cs	Thu Feb 14 22:56:49 2008
@@ -229,7 +229,7 @@
 				}
 
 				this.mbox_stream = new GMime.StreamFs (this.mbox_fd);
-				this.mbox_stream.Seek ((int) this.MboxLastOffset);
+				this.mbox_stream.Seek (this.MboxLastOffset);
 				this.mbox_parser = new GMime.Parser (this.mbox_stream);
 				this.mbox_parser.ScanFrom = true;
 

Modified: branches/beagle-rdf/beagled/ExtractContent.cs
==============================================================================
--- branches/beagle-rdf/beagled/ExtractContent.cs	(original)
+++ branches/beagle-rdf/beagled/ExtractContent.cs	Thu Feb 14 22:56:49 2008
@@ -137,21 +137,23 @@
 		Indexable generated_indexable;
 
 		bool first = true;
-		while (filter.GenerateNextIndexable (out generated_indexable)) {
-			if (generated_indexable == null)
-				continue;
+		if (filter.HasGeneratedIndexable) {
+			while (filter.GenerateNextIndexable (out generated_indexable)) {
+				if (generated_indexable == null)
+					continue;
+
+				if (first) {
+					Console.WriteLine ("Filter-generated indexables:");
+					first = false;
+				}
+				
+				Console.WriteLine ("  {0}", generated_indexable.Uri);
 
-			if (first) {
-				Console.WriteLine ("Filter-generated indexables:");
-				first = false;
+				if (show_generated)
+					generated_indexables.Add (generated_indexable);
+				else
+					generated_indexable.Cleanup ();
 			}
-			
-			Console.WriteLine ("  {0}", generated_indexable.Uri);
-
-			if (show_generated)
-				generated_indexables.Add (generated_indexable);
-			else
-				generated_indexable.Cleanup ();
 		}
 
 		if (! first)

Modified: branches/beagle-rdf/beagled/FileAttributesStore.cs
==============================================================================
--- branches/beagle-rdf/beagled/FileAttributesStore.cs	(original)
+++ branches/beagle-rdf/beagled/FileAttributesStore.cs	Thu Feb 14 22:56:49 2008
@@ -193,25 +193,27 @@
 
 			attr = Read (path);
 
-			if (! FilterFactory.DirtyFilterCache) {
+			// If there are no attributes set on the file, there is no
+			// way that we can be up-to-date.
+			if (attr == null)
+				return false;
+
+			if (! FilterFactory.DirtyFilterCache)
 				// If the filters are same as in last run,
-				// if attr is null, then there is no filter for this file even now
-				// if attr is not null, then check the timestamps (bypass HasFilterInfo)
+				// since attr is not null, check the timestamps (bypass HasFilterInfo)
+				return IsUpToDate (path, attr);
+
+			// If there is a new filter in the mean time
+			// take previous filter information into consideration.
+			if (! attr.HasFilterInfo)
+				return false;
+
+			int current_filter_version;
+			current_filter_version = FilterFactory.GetFilterVersion (attr.FilterName);
+			if (current_filter_version > attr.FilterVersion)
+				return false;
 
-				if (attr == null)
-					return true;
-				else
-					return IsUpToDate (path, attr);
-			} else {
-				// If there is a new filter in the mean time
-				// take previous filter information into consideration.
-				// Also, if attr is null, there could be a new filter now.
-
-				if (attr == null || ! attr.HasFilterInfo)
-					return false;
-				else
-					return IsUpToDate (path, attr);
-			}
+			return IsUpToDate (path, attr);
 		}
 
 		public bool IsUpToDate (string path)

Modified: branches/beagle-rdf/beagled/FileAttributesStore_Sqlite.cs
==============================================================================
--- branches/beagle-rdf/beagled/FileAttributesStore_Sqlite.cs	(original)
+++ branches/beagle-rdf/beagled/FileAttributesStore_Sqlite.cs	Thu Feb 14 22:56:49 2008
@@ -56,7 +56,9 @@
 		private SqliteConnection connection;
 		private BitArray path_flags;
 		private int transaction_count = 0;
-
+		public SqliteCommand ReadCommand;
+		public SqliteCommand InsertCommand;
+		public SqliteCommand DeleteCommand;
 		enum TransactionState {
 			None,
 			Requested,
@@ -181,6 +183,15 @@
 				Logger.Log.Debug ("Loaded {0} records from {1} in {2:0.000}s", 
 						 count, GetDbPath (directory), (dt2 - dt1).TotalSeconds);
 			}
+			ReadCommand = new SqliteCommand (this.connection);
+			ReadCommand.CommandText = "SELECT unique_id, directory, filename, last_mtime, last_attrtime, filter_name, filter_version " +
+				"FROM file_attributes WHERE directory= dir AND filename= fname";
+			InsertCommand = new SqliteCommand (this.connection);
+			InsertCommand.CommandText = "INSERT OR REPLACE INTO file_attributes " +
+							" (unique_id, directory, filename, last_mtime, last_attrtime, filter_name, filter_version) " +
+							" VALUES (@unique_id, @directory, @filename, @last_mtime, @last_attrtime, @filter_name, @filter_version)";
+			DeleteCommand = new SqliteCommand (this.connection);
+			DeleteCommand.CommandText = "DELETE FROM file_attributes WHERE directory= directory AND filename= filename";
 		}
 
 		///////////////////////////////////////////////////////////////////
@@ -247,9 +258,6 @@
 			if (path != null && path != "/" && path.EndsWith ("/"))
 				path = path.TrimEnd ('/');
 
-			SqliteCommand command;
-			SqliteDataReader reader;
-
 			if (! GetPathFlag (path))
 				return null;
 
@@ -260,16 +268,12 @@
 			string directory = FileSystem.GetDirectoryNameRootOk (path).Replace ("'", "''");
 			string filename = Path.GetFileName (path).Replace ("'", "''");
 			lock (connection) {
-				command = SqliteUtils.QueryCommand (connection,
-								    "directory='{0}' AND filename='{1}'",
-								    directory, filename);
-				reader = SqliteUtils.ExecuteReaderOrWait (command);
-				
-				if (SqliteUtils.ReadOrWait (reader))
-					attr = GetFromReader (reader);
-					
-				reader.Close ();
-				command.Dispose ();
+				ReadCommand.Parameters.AddWithValue ("@dir",directory);
+				ReadCommand.Parameters.AddWithValue ("@fname",filename);
+				using (SqliteDataReader reader = SqliteUtils.ExecuteReaderOrWait (ReadCommand)) {
+					if (SqliteUtils.ReadOrWait (reader))
+						attr = GetFromReader (reader);
+				}
 			}
 
 			return attr;
@@ -292,19 +296,19 @@
 				if (filter_name == null)
 					filter_name = "";
 				filter_name = filter_name.Replace ("'", "''");
-
-				ret = SqliteUtils.DoNonQuery (connection,
-							"INSERT OR REPLACE INTO file_attributes " +
-							" (unique_id, directory, filename, last_mtime, last_attrtime, filter_name, filter_version) " +
-							" VALUES (@unique_id, @directory, @filename, @last_mtime, @last_attrtime, @filter_name, @filter_version)",
-							new string [] {"@unique_id", "@directory", "@filename", "@last_mtime", "@last_attrtime", "@filter_name", "@filter_version"},
-							new object [] {
+				string[] param= new string [] { "@unique_id", "@directory", "@filename", "@last_mtime", "@last_attrtime", "@filter_name", "@filter_version"};
+				object[] vals =	new object [] {
 								GuidFu.ToShortString (fa.UniqueId),
 								fa.Directory.Replace ("'", "''"), fa.Filename.Replace ("'", "''"),
 								StringFu.DateTimeToString (fa.LastWriteTime),
 								StringFu.DateTimeToString (fa.LastAttrTime),
 								filter_name,
-								fa.FilterVersion});
+								fa.FilterVersion};
+				for (int i=0; i < param.Length; i++)
+					InsertCommand.Parameters.AddWithValue (param[i], vals[i]);
+				
+				ret = SqliteUtils.DoNonQuery (InsertCommand);
+				
 			}
 
 			return (ret != 0);
@@ -327,11 +331,9 @@
 
 				// If a transaction has been requested, start it now.
 				MaybeStartTransaction ();
-
-				SqliteUtils.DoNonQuery (connection,
-							"DELETE FROM file_attributes WHERE directory= directory AND filename= filename",
-							new string [] {"@directory", "@filename"},
-							new object [] {directory, filename});
+				DeleteCommand.Parameters.AddWithValue ("@directory", directory);
+				DeleteCommand.Parameters.AddWithValue ("@filename", filename);
+				SqliteUtils.DoNonQuery (DeleteCommand);
 			}
 		}
 

Modified: branches/beagle-rdf/beagled/FileSystemQueryable/FileNameFilter.cs
==============================================================================
--- branches/beagle-rdf/beagled/FileSystemQueryable/FileNameFilter.cs	(original)
+++ branches/beagle-rdf/beagled/FileSystemQueryable/FileNameFilter.cs	Thu Feb 14 22:56:49 2008
@@ -49,34 +49,75 @@
 
 		/////////////////////////////////////////////////////////////
 
-		private void AddExclude (string value, bool is_pattern)
+		private void AddExcludePattern (string value)
 		{
 			if (String.IsNullOrEmpty (value))
 				return;
 
 			if (Debug)
-				Logger.Log.Debug ("FileNameFilter: Adding ExcludeItem (value={0}, type={1})", value, (is_pattern ? "Pattern" : "Path"));
+				Logger.Log.Debug ("FileNameFilter: Adding ExcludePattern '{0}'", value);
 
-			if (! is_pattern) {
-				exclude_paths.Add (value);
-				queryable.RemoveDirectory (value);
-			} else {
-				exclude_patterns.Add (value);
-			}
+			exclude_patterns.Add (value);
 		}
 
-		private void RemoveExclude (string value, bool is_pattern)
+		private void RemoveExcludePattern (string value)
 		{
+			if (String.IsNullOrEmpty (value))
+				return;
+
 			if (Debug)
-				Logger.Log.Debug ("FileNameFilter: Removing ExcludeItem (value={0}, type={1})", value, (is_pattern ? "Pattern" : "Path"));
+				Logger.Log.Debug ("FileNameFilter: Removing ExcludePattern '{0}'", value);
 
-			if (! is_pattern) {
-				exclude_paths.Remove (value);
-			} else {
-				exclude_patterns.Remove (value);
-			}
+			exclude_patterns.Remove (value);
+		}
+
+		private void AddExcludeDir (string value)
+		{
+			if (String.IsNullOrEmpty (value))
+				return;
+
+			if (Debug)
+				Logger.Log.Debug ("FileNameFilter: Adding ExcludeDir '{0}'", value);
+
+			exclude_paths.Add (value);
+			queryable.RemoveDirectory (value);
+		}
+
+		private void RemoveExcludeDir (string value)
+		{
+			if (String.IsNullOrEmpty (value))
+				return;
+
+			if (Debug)
+				Logger.Log.Debug ("FileNameFilter: Removing ExcludeDir '{0}'", value);
+
+			exclude_paths.Remove (value);
+			// Make sure we re-crawl the paths we used to ignored but
+			// no longer do.
+			queryable.Recrawl (value);
+		}
+
+		// Returns the full directory path for this value, after stripping end '/' and expanding env variable
+		private static string GetExcludeDirectory (string value)
+		{
+			if (String.IsNullOrEmpty (value))
+				return null;
+
+			// Remove end '/'
+			if (value != "/")
+				value = value.TrimEnd ('/');
+
+			value = StringFu.ExpandEnvVariables (value);
+			if (String.IsNullOrEmpty (value))
+				return null;
+
+			value = Path.GetFullPath (value);
+			if (Directory.Exists (value))
+				return value;
+
+			return null;
 		}
-		
+
 		/////////////////////////////////////////////////////////////
 
 		public FileNameFilter (FileSystemQueryable queryable)
@@ -97,23 +138,15 @@
 
 			List<string[]> values = config.GetListOptionValues (Conf.Names.ExcludeSubdirectory);
 			if (values != null) {
-				foreach (string[] exclude in values) {
-					// Excluded subdirectories can use environment variables
-					// like $HOME/tmp
-					string expanded_exclude = StringFu.ExpandEnvVariables (exclude [0]);
-					if (expanded_exclude != null) {
-						expanded_exclude = Path.GetFullPath (expanded_exclude);
-						if (Directory.Exists (expanded_exclude))
-							AddExclude (expanded_exclude, false);
-					}
-				}
+				foreach (string[] value in values)
+					AddExcludeDir (GetExcludeDirectory (value [0]));
 			}
 
 			values = config.GetListOptionValues (Conf.Names.ExcludePattern);
 			if (values != null)
 				foreach (string[] exclude in values)
 					// RemoveQuotes from beginning and end
-					AddExclude (exclude [0], true);
+					AddExcludePattern (exclude [0]);
 
 			exclude_regex = StringFu.GetPatternRegex (exclude_patterns);
 
@@ -126,14 +159,16 @@
 			if (config == null || config.Name != Conf.Names.FilesQueryableConfig)
 				return;
 
-			ArrayList exclude_paths_removed = new ArrayList ();
 			bool clear_fs_state = false;
 
 			List<string[]> values = config.GetListOptionValues (Conf.Names.ExcludeSubdirectory);
 			if (values != null) {
 				ArrayList subdirs = new ArrayList (values.Count);
-				foreach (string[] value in subdirs)
-					subdirs.Add (value [0]);
+				foreach (string[] value in values) {
+					string dir = GetExcludeDirectory (value [0]);
+					if (! String.IsNullOrEmpty (dir))
+						subdirs.Add (dir);
+				}
 
 				IList excludes_wanted = subdirs;
 				IList excludes_to_add, excludes_to_remove;
@@ -144,14 +179,12 @@
 						      	      out excludes_to_remove);
 
 				// Process any excludes we think we should remove
-				foreach (string path in excludes_to_remove) {
-					exclude_paths_removed.Add (path);
-					RemoveExclude (path, false);
-				}
+				foreach (string path in excludes_to_remove)
+					RemoveExcludeDir (path);
 
 				// Process any excludes we found to be new
 				foreach (string path in excludes_to_add)
-					AddExclude (path, true);
+					AddExcludeDir (path);
 			}
 
 			values = config.GetListOptionValues (Conf.Names.ExcludePattern);
@@ -171,12 +204,12 @@
 				// Process any excludes we think we should remove
 				foreach (string pattern in excludes_to_remove) {
 					clear_fs_state = true;
-					RemoveExclude (pattern, true);
+					RemoveExcludePattern (pattern);
 				}
 
 				// Process any excludes we found to be new
 				foreach (string pattern in excludes_to_add)
-					AddExclude (pattern, true);
+					AddExcludePattern (pattern);
 
 				exclude_regex = StringFu.GetPatternRegex (exclude_patterns);
 			}
@@ -185,11 +218,6 @@
 			// so that we can index those files which were previously ignored.
 			if (clear_fs_state)
 				queryable.RecrawlEverything ();
-
-			// Make sure we re-crawl the paths we used to ignored but
-			// no longer do.
-			foreach (string path in exclude_paths_removed) 
-				queryable.Recrawl (path);
 		}
 
 		/////////////////////////////////////////////////////////////

Modified: branches/beagle-rdf/beagled/FileSystemQueryable/FileSystemQueryable.cs
==============================================================================
--- branches/beagle-rdf/beagled/FileSystemQueryable/FileSystemQueryable.cs	(original)
+++ branches/beagle-rdf/beagled/FileSystemQueryable/FileSystemQueryable.cs	Thu Feb 14 22:56:49 2008
@@ -38,7 +38,6 @@
 namespace Beagle.Daemon.FileSystemQueryable {
 
 	[QueryableFlavor (Name="Files", Domain=QueryDomain.Local | QueryDomain.Neighborhood, RequireInotify=false)]
-	[PropertyKeywordMapping (Keyword="ext", PropertyName="beagle:FilenameExtension", IsKeyword=true, Description="File extension, e.g. ext:jpeg. Use ext: to search in files with no extension.")]
 	public class FileSystemQueryable : LuceneQueryable {
 
 		static internal bool Debug = false;
@@ -52,7 +51,8 @@
 		// 5: Keyword properies in the private namespace are no longer lower cased; this is required to
 		//    offset the change in LuceneCommon.cs
 		// 6: Store beagle:FileType property denoting type of file like document, source, music etc.
-		const int MINOR_VERSION = 6;
+		// 7: Store filesize as fixme:filesize
+		const int MINOR_VERSION = 7;
 
 		private object big_lock = new object ();
 
@@ -247,6 +247,11 @@
 			indexable.Crawled = crawl_mode;
 			indexable.Filtering = Beagle.IndexableFiltering.Always;
 
+			FileInfo fi = new FileInfo (path);
+			if (fi == null)
+				return null; // You never know when files could vanish
+			indexable.AddProperty (Property.NewUnsearched ("fixme:filesize", fi.Length));
+
 			AddStandardPropertiesToIndexable (indexable, Path.GetFileName (path), parent, true);
 
 			indexable.LocalState ["Path"] = path;
@@ -1740,14 +1745,6 @@
 			return true;
 		}
 
-		override public bool AcceptQuery (Query query)
-		{
-			// A bit of a hack to remap URIs requested in QueryPart_Uri
-			RemapQueryParts (query.Parts);
-
-			return true;
-		}
-
 		override public bool HasUri (Uri uri)
 		{
 			Uri internal_uri = ExternalToInternalUri (uri);
@@ -1758,20 +1755,22 @@
 			return base.HasUri (internal_uri);
 		}
 
-		// Remap uri in querypart_uri
-		private void RemapQueryParts (ICollection parts)
+		protected override QueryPart QueryPartHook(QueryPart part)
 		{
-			foreach (QueryPart part in parts) {
-				if (part is QueryPart_Or)
-					RemapQueryParts (((QueryPart_Or) part).SubParts);
-				else if (part is QueryPart_Uri) {
-					QueryPart_Uri p =  (QueryPart_Uri) part;
-					RemapUriQueryPart (ref p);
-				}
+			if (part is QueryPart_Uri)
+				return RemapUriQueryPart ((QueryPart_Uri) part);
+
+			if (part is QueryPart_Property) {
+				QueryPart_Property prop_part = (QueryPart_Property) part;
+				if (prop_part.Key == "inuri") // special case
+					return RemapInUriQueryPart (prop_part);
 			}
+
+			return part;
 		}
 
-		private void RemapUriQueryPart (ref QueryPart_Uri part)
+		// Remap uri in querypart_uri
+		private QueryPart_Uri RemapUriQueryPart (QueryPart_Uri part)
 		{
 			Uri new_uri = ExternalToInternalUri (part.Uri);
 			Log.Debug ("Remapping QueryPart_Uri from {0} to {1}", part.Uri, new_uri);
@@ -1781,7 +1780,67 @@
 			if (new_uri == null)
 				new_uri = new Uri ("no-match:///"); // Will never match
 
-			part.Uri = new_uri;
+			QueryPart_Uri new_part = new QueryPart_Uri ();
+			new_part.Uri = new_uri;
+			new_part.Logic = part.Logic;
+
+			return new_part;
+		}
+
+		private QueryPart RemapInUriQueryPart (QueryPart_Property part)
+		{
+			string query = part.Value;
+
+			if (query.StartsWith ("/"))
+				query = UriFu.PathToFileUriString (query); // Make an URI
+
+			if (query.StartsWith ("file:///")) {
+				QueryPart_Property prop_part = new QueryPart_Property ();
+				prop_part.Logic = part.Logic;
+				prop_part.Key = Property.ParentDirUriPropKey;
+				prop_part.Type = PropertyType.Keyword;
+
+				Uri uri = ExternalToInternalUri (UriFu.EscapedStringToUri (query));
+				if (uri == null)
+					prop_part.Value = "no-match:///"; // FIXME: Returning null should work here
+				else
+					// From LuceneCommon.cs:AddPropertyToDocument since ParentDirUriPropKey is a private property
+					prop_part.Value = UriFu.UriToEscapedString (uri);
+
+				Log.Debug ("Remapped inuri={0} to {1}={2}", query, Property.ParentDirUriPropKey, prop_part.Value);
+				return prop_part;
+			}
+
+			QueryPart_Or parent_dirs = new QueryPart_Or ();
+			parent_dirs.Logic = part.Logic;
+
+			lock (big_lock) {
+				// Absolute path was not given.
+				// Traverse the directories to find directories with _EXACTLY_ this name
+				foreach (LuceneNameResolver.NameInfo info in uid_manager.GetAllDirectoryNameInfo (query)) {
+					QueryPart_Property prop_part = new QueryPart_Property ();
+					prop_part.Logic = QueryPartLogic.Required;
+					prop_part.Type = PropertyType.Keyword;
+					prop_part.Key = Property.ParentDirUriPropKey;
+					prop_part.Value = GuidFu.ToUriString (info.Id);
+
+					parent_dirs.Add (prop_part);
+				}
+			}
+
+			Log.Debug ("Found {0} matching dirs with containing '{1}' in name", parent_dirs.SubParts.Count, query);
+			if (parent_dirs.SubParts.Count == 0) {
+				// Add dummy query to match nothing
+				QueryPart_Property prop_part = new QueryPart_Property ();
+				prop_part.Logic = QueryPartLogic.Required;
+				prop_part.Type = PropertyType.Keyword;
+				prop_part.Key = Property.ParentDirUriPropKey;
+				prop_part.Value = "no-match:///";
+
+				parent_dirs.Add (prop_part);
+			}
+
+			return parent_dirs;
 		}
 
 		override public ISnippetReader GetSnippet (string [] query_terms, Hit hit, bool full_text)

Modified: branches/beagle-rdf/beagled/FileSystemQueryable/InternalUriManager.cs
==============================================================================
--- branches/beagle-rdf/beagled/FileSystemQueryable/InternalUriManager.cs	(original)
+++ branches/beagle-rdf/beagled/FileSystemQueryable/InternalUriManager.cs	Thu Feb 14 22:56:49 2008
@@ -218,15 +218,31 @@
 			}
 		}
 
-		public ICollection GetAllDirectoryNameInfo ()
+		// Return all directories with name
+		public ICollection GetAllDirectoryNameInfo (string name)
 		{
 			// First we assemble a query to find all of the directories.
 			string field_name;
 			field_name = PropertyToFieldName (PropertyType.Keyword,
 							  Property.IsDirectoryPropKey);
-			
-			LNS.Query query;
-			query = new LNS.TermQuery (new Term (field_name, "true"));
+			LNS.Query isdir_query = new LNS.TermQuery (new Term (field_name, "true"));
+
+			LNS.Query query = null;
+
+			if (name == null) {
+				query = isdir_query;
+			} else {
+				string dirname_field;
+				dirname_field = PropertyToFieldName (PropertyType.Text,
+								     Property.TextFilenamePropKey);
+				LNS.Query dirname_query;
+				dirname_query = LuceneCommon.StringToQuery (dirname_field, name, null);
+				LNS.BooleanQuery bool_query = new LNS.BooleanQuery ();
+				bool_query.Add (isdir_query, LNS.BooleanClause.Occur.MUST);
+				bool_query.Add (dirname_query, LNS.BooleanClause.Occur.MUST);
+
+				query = bool_query;
+			}
 
 			// Then we actually run the query
 			LNS.IndexSearcher searcher;
@@ -358,9 +374,14 @@
 
 		///////////////////////////////////////////////////////////////////////////////
 
+		internal ICollection GetAllDirectoryNameInfo (string dir_with_name)
+		{
+			return name_resolver.GetAllDirectoryNameInfo (dir_with_name);
+		}
+
 		internal ICollection GetAllDirectoryNameInfo ()
 		{
-			return name_resolver.GetAllDirectoryNameInfo ();
+			return GetAllDirectoryNameInfo (null);
 		}
 
 	}

Modified: branches/beagle-rdf/beagled/IQueryable.cs
==============================================================================
--- branches/beagle-rdf/beagled/IQueryable.cs	(original)
+++ branches/beagle-rdf/beagled/IQueryable.cs	Thu Feb 14 22:56:49 2008
@@ -35,8 +35,10 @@
 
 		void Start ();
 
+		// Should not modify query
 		bool AcceptQuery (Query query);
 
+		// Should not modify query
 		void DoQuery (Query query,
 			      IQueryResult result,
 			      IQueryableChangeData data);

Modified: branches/beagle-rdf/beagled/IndexHelper/IndexHelper.cs
==============================================================================
--- branches/beagle-rdf/beagled/IndexHelper/IndexHelper.cs	(original)
+++ branches/beagle-rdf/beagled/IndexHelper/IndexHelper.cs	Thu Feb 14 22:56:49 2008
@@ -219,7 +219,7 @@
 
 					if (heap_shot && increase > 1.20) {
 						Log.Debug ("Large memory increase detected.  Sending SIGPROF to ourself.");
-						Mono.Unix.Native.Syscall.kill (Process.GetCurrentProcess ().Id, Mono.Unix.Native.Signum.SIGPROF);
+						Mono.Unix.Native.Syscall.kill (System.Diagnostics.Process.GetCurrentProcess ().Id, Mono.Unix.Native.Signum.SIGPROF);
 					}
 				}
 

Modified: branches/beagle-rdf/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs
==============================================================================
--- branches/beagle-rdf/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs	(original)
+++ branches/beagle-rdf/beagled/IndexingServiceQueryable/IndexingServiceQueryable.cs	Thu Feb 14 22:56:49 2008
@@ -41,6 +41,9 @@
 // "type" is either 't' for text or 'k' for keyword.  This method is a lot
 // easier to use, but requires that Beagle have inotify support enabled to
 // work.
+//
+// Any text property with the name beagle:inuri would be used for inuri: queries.
+//
 
 using System;
 using System.Collections;
@@ -53,7 +56,6 @@
 namespace Beagle.Daemon.IndexingServiceQueryable {
 
 	[QueryableFlavor (Name="IndexingService", Domain=QueryDomain.Local, RequireInotify=false)]
-	[PropertyKeywordMapping (Keyword="host", PropertyName="fixme:host", IsKeyword=false, Description="The host of this entitiy.")]
 	public class IndexingServiceQueryable : LuceneQueryable {
 
 		public IndexingServiceQueryable () : base ("IndexingServiceIndex")
@@ -390,6 +392,23 @@
 			return new EmptyResponse ();
 		}
 
+		protected override QueryPart QueryPartHook (QueryPart part)
+		{
+			if (part is QueryPart_Property) {
+				QueryPart_Property prop_part = (QueryPart_Property) part;
+				if (prop_part.Key == "inuri") { // special case
+					QueryPart_Property new_part = new QueryPart_Property ();
+					new_part.Logic = prop_part.Logic;
+					new_part.Key = "beagle:inuri";
+					new_part.Type = PropertyType.Text;
+					new_part.Value = prop_part.Value;
+
+					return new_part;
+				}
+			}
+
+			return part;
+		}
 	}
 
 }

Modified: branches/beagle-rdf/beagled/KMailQueryable/KMailIndexableGenerator.cs
==============================================================================
--- branches/beagle-rdf/beagled/KMailQueryable/KMailIndexableGenerator.cs	(original)
+++ branches/beagle-rdf/beagled/KMailQueryable/KMailIndexableGenerator.cs	Thu Feb 14 22:56:49 2008
@@ -85,7 +85,7 @@
 			if (num_file_in_dir == 0)
 				return;
 			indexer.Progress = (num_dir_crawled + ((double) num_file_in_dir_crawled / num_file_in_dir)) / num_dirs;
-			Log.Debug ("Progress {4} = ({0} + {1}/{2})/{3}", num_dir_crawled, num_file_in_dir_crawled, num_file_in_dir, num_dirs, current_dir.FullName);
+			//Log.Debug ("Progress {4} = ({0} + {1}/{2})/{3}", num_dir_crawled, num_file_in_dir_crawled, num_file_in_dir, num_dirs, current_dir.FullName);
 		}
 
 		private void AddDirectory (string _dir) {

Modified: branches/beagle-rdf/beagled/KonqHistoryQueryable/KonqQueryable.cs
==============================================================================
--- branches/beagle-rdf/beagled/KonqHistoryQueryable/KonqQueryable.cs	(original)
+++ branches/beagle-rdf/beagled/KonqHistoryQueryable/KonqQueryable.cs	Thu Feb 14 22:56:49 2008
@@ -44,7 +44,10 @@
 		// ISO-Latin1 is 28591
 		private Encoding latin_encoding = Encoding.GetEncoding (28591);
 
-		public KonqQueryable () : base ("KonqHistoryIndex")
+		// Store URLs in the right form
+		const int MINOR_VERSION = 1;
+
+		public KonqQueryable () : base ("KonqHistoryIndex", MINOR_VERSION)
 		{
 			/* How to determine kio-http cache location ?
 			 * From KDE web-page it looks like /var/tmp/kdecache-$USERNAME/http
@@ -148,7 +151,7 @@
 		{
 			if (path.EndsWith (".new"))
 				return;
-			Indexable indexable = FileToIndexable (path);
+			Indexable indexable = FileToIndexable (path, false);
 			if (indexable == null)
 				return;
 			Scheduler.Task task = NewAddTask (indexable);
@@ -160,7 +163,7 @@
 
 		/////////////////////////////////////////////////
 		
-		private Indexable FileToIndexable (string path) {
+		private Indexable FileToIndexable (string path, bool crawl_mode) {
 			//Logger.Log.Debug ("KonqQ: Trying to index " + path);
 
 			FileStream stream;
@@ -190,7 +193,7 @@
 					return null; // we wont index bad files and non-html files
 				}
 
-				Logger.Log.Debug ("KonqQ: Indexing " + path + " with url=" + url);
+				//Logger.Log.Debug ("KonqQ: Indexing " + path + " with url=" + url);
 				Uri uri = new Uri (url, true);
 				if (uri.Scheme == Uri.UriSchemeHttps) {
 					Logger.Log.Error ("Indexing secure https:// URIs is not secure!");
@@ -204,6 +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;
 			
 				DateTime date = DateTimeUtil.UnixToDateTimeUtc (0);
 				date = date.AddSeconds (Int64.Parse (creation_date));
@@ -224,7 +228,7 @@
 		{
 			if (current_file == null)
 				return null;
-			return FileToIndexable (current_file.FullName);
+			return FileToIndexable (current_file.FullName, true);
 		}
 		
 		public bool HasNextIndexable ()
@@ -261,5 +265,22 @@
 		public void PostFlushHook ()
 		{ }
 
+		protected override QueryPart QueryPartHook (QueryPart part)
+		{
+			if (part is QueryPart_Property) {
+				QueryPart_Property prop_part = (QueryPart_Property) part;
+				if (prop_part.Key == "inuri") { // special case
+					QueryPart_Property new_part = new QueryPart_Property ();
+					new_part.Logic = prop_part.Logic;
+					new_part.Key = "fixme:urltoken";
+					new_part.Type = PropertyType.Text;
+					new_part.Value = prop_part.Value;
+
+					return new_part;
+				}
+			}
+
+			return part;
+		}
 	}
 }

Modified: branches/beagle-rdf/beagled/LuceneCommon.cs
==============================================================================
--- branches/beagle-rdf/beagled/LuceneCommon.cs	(original)
+++ branches/beagle-rdf/beagled/LuceneCommon.cs	Thu Feb 14 22:56:49 2008
@@ -49,6 +49,7 @@
 	public class LuceneCommon {
 
 		public delegate bool HitFilter (Hit hit);
+		public delegate QueryPart QueryPartHook (QueryPart query_part);
 
 		// VERSION HISTORY
 		// ---------------
@@ -1129,7 +1130,7 @@
 		// Queries
 		//
 
-		static private LNS.Query StringToQuery (string field_name,
+		static internal LNS.Query StringToQuery (string field_name,
 							string text,
 							ArrayList term_list)
 		{
@@ -1386,6 +1387,7 @@
 		static protected void QueryPartToQuery (QueryPart     abstract_part,
 							bool          only_build_primary_query,
 							ArrayList     term_list,
+							QueryPartHook query_part_hook,
 							out LNS.Query primary_query,
 							out LNS.Query secondary_query,
 							out HitFilter hit_filter)
@@ -1409,6 +1411,14 @@
 			if (abstract_part == null)
 				return;
 
+			// Run the backend hook first.
+			// This gives a chance to modify create new queries based on
+			// backend specific properties
+
+			abstract_part = query_part_hook (abstract_part);
+			if (abstract_part == null)
+				return;
+
 			if (abstract_part is QueryPart_Text) {
 				QueryPart_Text part = (QueryPart_Text) abstract_part;
 
@@ -1535,49 +1545,6 @@
 				return;
 			}
 
-			if (abstract_part is QueryPart_Property) {
-				QueryPart_Property part = (QueryPart_Property) abstract_part;
-
-				string field_name;
-				if (part.Key == QueryPart_Property.AllProperties)
-					field_name = TypeToWildcardField (part.Type);
-				else
-					field_name = PropertyToFieldName (part.Type, part.Key);
-
-				if (part.Type == PropertyType.Text)
-					primary_query = StringToQuery (field_name, part.Value, term_list);
-				else {
-					Term term;
-					term = new Term (field_name, part.Value.ToLower ());
-					if (term_list != null)
-						term_list.Add (term);
-					primary_query = new LNS.TermQuery (term);
-				}
-
-				// Properties can live in either index
-				if (! only_build_primary_query && primary_query != null)
-					secondary_query = primary_query.Clone () as LNS.Query;
-
-				return;
-			}
-
-			if (abstract_part is QueryPart_Uri) {
-				QueryPart_Uri part = (QueryPart_Uri) abstract_part;
-
-				// Do a term query on the Uri field.
-				// This is probably less efficient that using a TermEnum;
-				// but this is required for the query API where the uri query
-				// can be part of a prohibited query or a boolean or query.
-				Term term;
-				term = new Term ("Uri", UriFu.UriToEscapedString (part.Uri));
-				if (term_list != null)
-					term_list.Add (term);
-				primary_query = new LNS.TermQuery (term);
-
-				// Query only the primary index
-				return;
-			}
-
 			if (abstract_part is QueryPart_DateRange) {
 
 				QueryPart_DateRange part = (QueryPart_DateRange) abstract_part;
@@ -1619,7 +1586,7 @@
 					// correctly, because we can't tell which part of an OR we matched
 					// against to filter correctly.  This affects date range queries.
 					QueryPartToQuery (sub_part, only_build_primary_query,
-							  term_list,
+							  term_list, query_part_hook,
 							  out p_subq, out s_subq, out sub_hit_filter);
 					if (p_subq != null)
 						p_query.Add (p_subq, false, false);
@@ -1638,6 +1605,52 @@
 				return;
 			} 
 
+			if (abstract_part is QueryPart_Uri) {
+				QueryPart_Uri part = (QueryPart_Uri) abstract_part;
+
+				// Do a term query on the Uri field.
+				// This is probably less efficient that using a TermEnum;
+				// but this is required for the query API where the uri query
+				// can be part of a prohibited query or a boolean or query.
+				Term term;
+				term = new Term ("Uri", UriFu.UriToEscapedString (part.Uri));
+				if (term_list != null)
+					term_list.Add (term);
+				primary_query = new LNS.TermQuery (term);
+
+				// Query only the primary index
+				return;
+			}
+
+			if (abstract_part is QueryPart_Property) {
+				QueryPart_Property part = (QueryPart_Property) abstract_part;
+
+				string field_name;
+				if (part.Key == QueryPart_Property.AllProperties)
+					field_name = TypeToWildcardField (part.Type);
+				else
+					field_name = PropertyToFieldName (part.Type, part.Key);
+
+				if (part.Type == PropertyType.Text)
+					primary_query = StringToQuery (field_name, part.Value, term_list);
+				else {
+					Term term;
+					if (field_name.StartsWith ("prop:k:" + Property.PrivateNamespace))
+						term = new Term (field_name, part.Value);
+					else
+						term = new Term (field_name, part.Value.ToLower ());
+					if (term_list != null)
+						term_list.Add (term);
+					primary_query = new LNS.TermQuery (term);
+				}
+
+				// Properties can live in either index
+				if (! only_build_primary_query && primary_query != null)
+					secondary_query = primary_query.Clone () as LNS.Query;
+
+				return;
+			}
+
 			throw new Exception ("Unhandled QueryPart type! " + abstract_part.ToString ());
 		}
 

Modified: branches/beagle-rdf/beagled/LuceneQueryable.cs
==============================================================================
--- branches/beagle-rdf/beagled/LuceneQueryable.cs	(original)
+++ branches/beagle-rdf/beagled/LuceneQueryable.cs	Thu Feb 14 22:56:49 2008
@@ -76,6 +76,7 @@
 
 		private LuceneQueryingDriver.UriFilter our_uri_filter;
 		private LuceneCommon.HitFilter our_hit_filter;
+		private LuceneCommon.QueryPartHook backend_query_part_hook;
 		private Scheduler.Task our_final_flush_task = null;
 		private Scheduler.Task our_optimize_task = null;
 
@@ -99,6 +100,7 @@
 			driver = BuildLuceneQueryingDriver (this.index_name, this.minor_version, this.read_only_mode);
 			our_uri_filter = new LuceneQueryingDriver.UriFilter (this.HitIsValid);
 			our_hit_filter = new LuceneCommon.HitFilter (this.HitFilter);
+			backend_query_part_hook = new LuceneCommon.QueryPartHook (this.QueryPartHook);
 
 			// If the queryable is in read-only more, don't 
 			// instantiate an indexer for it.
@@ -188,6 +190,12 @@
 			return true;
 		}
 
+		// Should not change passed query part
+		virtual protected QueryPart QueryPartHook (QueryPart part)
+		{
+			return part;
+		}
+
 		/////////////////////////////////////////
 
 		// DEPRECATED: This does nothing, since everything is now
@@ -347,6 +355,7 @@
 			Driver.DoQuery (query, 
 					query_result,
 					added_uris,
+					backend_query_part_hook,
 					our_uri_filter,
 					our_hit_filter);
 		}

Modified: branches/beagle-rdf/beagled/LuceneQueryingDriver.cs
==============================================================================
--- branches/beagle-rdf/beagled/LuceneQueryingDriver.cs	(original)
+++ branches/beagle-rdf/beagled/LuceneQueryingDriver.cs	Thu Feb 14 22:56:49 2008
@@ -54,6 +54,9 @@
 		public delegate bool UriFilter (Uri uri);
 		public delegate double RelevancyMultiplier (Hit hit);
 
+		public LuceneQueryingDriver (string index_name, bool read_only)
+			: this (index_name, -1, read_only) { }
+
 		public LuceneQueryingDriver (string index_name, int minor_version, bool read_only) 
 			: base (index_name, minor_version)
 		{
@@ -388,6 +391,7 @@
 				QueryPartToQuery (part,
 						  false, // we want both primary and secondary queries
 						  part.Logic == QueryPartLogic.Required ? term_list : null,
+						  query_part_hook,
 						  out primary_part_query,
 						  out secondary_part_query,
 						  out part_hit_filter);
@@ -616,6 +620,7 @@
 		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)
 		{

Modified: branches/beagle-rdf/beagled/Makefile.am
==============================================================================
--- branches/beagle-rdf/beagled/Makefile.am	(original)
+++ branches/beagle-rdf/beagled/Makefile.am	Thu Feb 14 22:56:49 2008
@@ -26,6 +26,7 @@
 	$(srcdir)/webinterface/images/beagle-logo.png		\
 	$(srcdir)/webinterface/images/busy-animation.gif	\
 	$(srcdir)/webinterface/images/favicon.png		\
+	$(srcdir)/webinterface/images/system-search.png		\
 	$(srcdir)/webinterface/images/title_bg.png
 
 $(WEBINTERFACE_INDEX_XML): $(WEBINTERFACE_INDEX_XML_IN) $(WEBINTERFACE_FILES)
@@ -381,6 +382,11 @@
 	$(kopetequeryable)/KopeteQueryable.cs 	 		\
 	$(kopetequeryable)/KopeteCrawler.cs
 
+empathyqueryable = $(srcdir)/EmpathyQueryable
+EMPATHY_QUERYABLE_CSFILES =					\
+	$(empathyqueryable)/EmpathyQueryable.cs 	 		\
+	$(empathyqueryable)/EmpathyCrawler.cs
+
 knotesqueryable = $(srcdir)/KNotesQueryable
 KNOTES_QUERYABLE_CSFILES =					\
 	$(knotesqueryable)/KNotesQueryable.cs
@@ -438,7 +444,9 @@
 	$(OPERA_QUERYABLE_CSFILES)				\
 	$(NAUTILUS_QUERYABLE_CSFILES)				\
 	$(NETWORK_SERVICES_QUERYABLE)				\
+	$(EMPATHY_QUERYABLE_CSFILES)			\
 	$(srcdir)/AssemblyInfo.cs				\
+	$(srcdir)/BatteryMonitor.cs				\
 	$(srcdir)/ExternalMetadataQueryable.cs			\
 	$(srcdir)/FileAttributes.cs				\
 	$(srcdir)/FileAttributesStore.cs			\
@@ -490,6 +498,7 @@
 	$(BEAGLED_LIBS)                 			\
 	$(DAEMON_DLL_LOCAL_ASSEMBLIES:%=-r:%)			\
 	$(SHARPZIPLIB_LIBS)					\
+	$(NDESK_DBUS_GLIB_LIBS)					\
 	-r:Mono.Data.Sqlite					\
 	-r:Mono.Posix
 
@@ -614,6 +623,7 @@
 DAEMON_ASSEMBLIES =				\
 	$(BEAGLED_LIBS)				\
 	$(SHARPZIPLIB_LIBS)			\
+	$(NDESK_DBUS_GLIB_LIBS)			\
 	$(DAEMON_LOCAL_ASSEMBLIES:%=-r:%)	\
 	-r:Mono.Posix
 
@@ -658,6 +668,7 @@
 	$(BEAGLED_LIBS)				\
 	$(SHARPZIPLIB_LIBS)			\
 	$(INDEX_HELPER_LOCAL_ASSEMBLIES:%=-r:%)	\
+	$(NDESK_DBUS_GLIB_LIBS)			\
 	-r:Mono.Posix
 
 $(INDEX_HELPER_TARGET): $(INDEX_HELPER_CSFILES) $(INDEX_HELPER_LOCAL_ASSEMBLIES)
@@ -810,6 +821,7 @@
 BUILD_INDEX_ASSEMBLIES = \
 	$(BEAGLED_LIBS)				\
 	$(DAEMON_LOCAL_ASSEMBLIES:%=-r:%)	\
+	$(NDESK_DBUS_GLIB_LIBS)			\
 	-r:Mono.Posix
 
 $(BUILD_INDEX_TARGET): $(BUILD_INDEX_CSFILES) $(BUILD_INDEX_LOCAL_ASSEMBLIES)
@@ -1001,6 +1013,7 @@
 	$(SNIPPET_TEST_WRAPPER)
 
 EXTRA_DIST = \
+	$(srcdir)/Zeroconf.cs			\
 	$(autostart_DATA)			\
 	$(WEBINTERFACE_INDEX_XML_IN)		\
 	$(webinterface_DATA)			\

Modified: branches/beagle-rdf/beagled/ManageIndex.cs
==============================================================================
--- branches/beagle-rdf/beagled/ManageIndex.cs	(original)
+++ branches/beagle-rdf/beagled/ManageIndex.cs	Thu Feb 14 22:56:49 2008
@@ -41,8 +41,6 @@
 {
 	class ManageIndex 
 	{
-		static private LuceneIndexingDriver driver;
-
 		// Files and directories that are allowed to be in the target
 		// directory before we blow it away.  If we encounter any file
 		// or dir not in this list, we'll bail out.
@@ -78,7 +76,7 @@
 			// Be *EXTRA PARANOID* about the contents of the target
 			// directory, because creating an indexing driver will
 			// nuke it.
-			if (Directory.Exists (index_dir)) {
+			if (args [1] != "info" && Directory.Exists (index_dir)) {
 
 				foreach (FileInfo info in DirectoryWalker.GetFileInfos (index_dir)) {
 					if (Array.IndexOf (allowed_files, info.Name) == -1) {
@@ -95,8 +93,6 @@
 				}
 			}
 
-			driver = new LuceneIndexingDriver (index_dir, false);
-
 			switch (args [1]) {
 #if false
 			case "list":
@@ -107,15 +103,15 @@
 				break;
 #endif
 			case "info":
-				ExecuteInfo ();
+				ExecuteInfo (index_dir);
 				break;
 
 			case "merge":
-				ExecuteMerge (args [2]);
+				ExecuteMerge (index_dir, args [2]);
 				break;
 
 			case "optimize":
-				ExecuteOptimize ();
+				ExecuteOptimize (index_dir);
 				break;
 			default:
 				Console.WriteLine ("Unknown command: {0}", args [1]);
@@ -222,8 +218,10 @@
 		// join the primary- and secondary lucene indexes and if available, the
 		// file attributes store.
 
-		static void ExecuteMerge (string index_to_merge) 
+		static void ExecuteMerge (string index_dir, string index_to_merge) 
 		{
+			LuceneIndexingDriver driver = new LuceneIndexingDriver (index_dir, false);
+
 			if (!Path.IsPathRooted (index_to_merge))
 				index_to_merge = Path.GetFullPath (index_to_merge);
 			
@@ -271,8 +269,10 @@
 		
 		// Get the total number of entries from the index.
 		
-		static void ExecuteInfo ()
+		static void ExecuteInfo (string index_dir)
 		{
+			LuceneQueryingDriver driver = new LuceneQueryingDriver (index_dir, true);
+
 			Console.WriteLine ("Total number of entries in index: {0}", driver.GetItemCount());
 		}
 
@@ -280,8 +280,10 @@
 		
 		// Execute a lucene optimize-task on the index.
 
-		static void ExecuteOptimize ()
+		static void ExecuteOptimize (string index_dir)
 		{
+			LuceneIndexingDriver driver = new LuceneIndexingDriver (index_dir, false);
+
 			// Set system priorities so we don't slow down the system
 			SystemPriorities.ReduceIoPriority ();
 			SystemPriorities.SetSchedulerPolicyBatch ();

Modified: branches/beagle-rdf/beagled/NautilusMetadataQueryable/NautilusMetadataQueryable.cs
==============================================================================
--- branches/beagle-rdf/beagled/NautilusMetadataQueryable/NautilusMetadataQueryable.cs	(original)
+++ branches/beagle-rdf/beagled/NautilusMetadataQueryable/NautilusMetadataQueryable.cs	Thu Feb 14 22:56:49 2008
@@ -36,9 +36,7 @@
 
 namespace Beagle.Daemon.NautilusMetadataQueryable {
 
-	[PropertyKeywordMapping (Keyword="emblem",  PropertyName="nautilus:emblem", IsKeyword=true, Description="Use emblem to identify items tagged with a specific emblem in nautilus.")]
-	[QueryableFlavor (Name="NautilusMetadata", Domain=QueryDomain.Local, RequireInotify=false,
-			  DependsOn="Files")]
+	[QueryableFlavor (Name="NautilusMetadata", Domain=QueryDomain.Local, RequireInotify=false, DependsOn="Files")]
 	public class NautilusMetadataQueryable : ExternalMetadataQueryable, IIndexableGenerator  {
 
 		private string nautilus_dir;
@@ -182,6 +180,13 @@
 		
 		public void PostFlushHook () { }
 
+		static private bool IsXmlFile (string path, string name)
+		{
+			return (Path.GetExtension (name) == ".xml" && File.Exists (Path.Combine (path, name)));
+		}
+
+		private DirectoryWalker.FileFilter is_xml_file = new DirectoryWalker.FileFilter (IsXmlFile);
+
 		public bool HasNextIndexable ()
 		{
 			if (metadata != null) {
@@ -195,7 +200,7 @@
 
 			while (metadata == null) {
 				if (metafiles == null)
-					metafiles = DirectoryWalker.GetFiles (nautilus_dir).GetEnumerator ();
+					metafiles = DirectoryWalker.GetItems (nautilus_dir, is_xml_file).GetEnumerator ();
 
 				if (! metafiles.MoveNext ())
 					return false;

Modified: branches/beagle-rdf/beagled/PropertyKeywordFu.cs
==============================================================================
--- branches/beagle-rdf/beagled/PropertyKeywordFu.cs	(original)
+++ branches/beagle-rdf/beagled/PropertyKeywordFu.cs	Thu Feb 14 22:56:49 2008
@@ -26,46 +26,17 @@
 
 using System;
 using System.Collections;
+using System.Collections.Generic;
 using System.IO;
 using System.Text;
+using System.Xml;
+using System.Xml.Serialization;
 
 using Beagle;
 using Beagle.Util;
 
 namespace Beagle.Daemon {
-	
-	public class PropertyDetail {
-		private PropertyType type;
-		private string property_name;
-		// a short description, so that frontends can get the description from here
-		// and they dont need to guess the meaning of a query keyword (being too nice ?!)
-		private string short_desc;
-		
-		public PropertyType Type { 
-			get { return type;} 
-		}
-
-		public string PropertyName { 
-			get { return property_name;} 
-		}
-		
-		public string Description { 
-			get { return short_desc; } 
-		}
-
-		public PropertyDetail (PropertyType type, string property_name) {
-		    this.type = type;
-		    this.property_name = property_name;
-		    this.short_desc = "";
-		}
-		
-		public PropertyDetail (PropertyType type, string property_name, string desc) {
-		    this.type = type;
-		    this.property_name = property_name;
-		    this.short_desc = desc;
-		}
-	}
-	
+
 	public class PropertyKeywordFu {
 		// mapping
 		private static Hashtable property_table;
@@ -73,10 +44,6 @@
 		// static class
 		private PropertyKeywordFu () { }
 
-		static PropertyKeywordFu () {
-			PopulatePropertyTable ();
-		}
-
 		public static IEnumerable Keys {
 			get { return property_table.Keys; }
 		}
@@ -86,80 +53,88 @@
 				yield break;
 
 			object o = property_table [keyword];
-			if (o is PropertyDetail)
+			if (o is QueryKeywordMapping)
 				yield return o;
 			else if (o is ArrayList) {
-				foreach (PropertyDetail detail in ((ArrayList) o))
-					yield return detail;
+				foreach (QueryKeywordMapping mapping in ((ArrayList) o))
+					yield return mapping;
 			}
 		}
 
-		// FIXME handle i18n issues... user might use a i18n-ised string for "title"
-		private static void PopulatePropertyTable () {
+		////////////////////////////////////////////////////////
+
+		public static void ReadKeywordMappings ()
+		{
 			property_table = new Hashtable ();
-			
-			// Mapping between human query keywords and beagle index property keywords
-			// These are some of the standard mapping which is available to all backends and filters.
-			
-			property_table.Add ("title",
-					    new PropertyDetail (PropertyType.Text, "dc:title", "Title"));
-			
-			property_table.Add ("creator",
-					    new PropertyDetail (PropertyType.Text, "dc:creator", "Creator of the content"));
-
-			property_table.Add ("author",
-					    new PropertyDetail (PropertyType.Text, "dc:author", "Author of the content"));
-
-			property_table.Add ("summary",
-					    new PropertyDetail (PropertyType.Text, "dc:subject", "Brief description of the content"));
-
-			property_table.Add ("source",
-					    new PropertyDetail (PropertyType.Keyword, "beagle:Source", "Name of the backend"));
-
-			property_table.Add ("type",
-					    new PropertyDetail (PropertyType.Keyword, "beagle:HitType", "Hittype of the content e.g. File, IMLog, MailMessage"));
-
-			property_table.Add ("mimetype",
-					    new PropertyDetail (PropertyType.Keyword, "beagle:MimeType", "Mimetype of the content"));
-
-			property_table.Add ("filetype",
-					    new PropertyDetail (PropertyType.Keyword, "beagle:FileType", "Type of content for HitType File"));
-					    
-			
+
+			// FIXME: No need for a SerializerFactory here, since we need the serializer
+			// only once
+			XmlSerializerFactory xsf = new XmlSerializerFactory();
+			XmlSerializer xs = xsf.CreateSerializer (typeof (QueryMapping), new Type[] { typeof (QueryKeywordMapping)});
+
+			QueryMapping query_mapping = null;
+
+			// <keyword name, can override>
+			Dictionary<string, bool> mapping_override = new Dictionary<string, bool> ();
+
+			using (Stream s = File.OpenRead (Path.Combine (PathFinder.ConfigDataDir, "query-mapping.xml"))) {
+				try {			
+					query_mapping = (QueryMapping) xs.Deserialize (s);
+					foreach (QueryKeywordMapping mapping in query_mapping.Mappings) {
+						PropertyKeywordFu.RegisterMapping (mapping);
+						mapping_override [mapping.Keyword] = true;
+					}
+				} catch (XmlException e) {
+					Logger.Log.Error (e, "Unable to parse global query-mapping.xml");
+				}
+			}
+
+			// Override global mappings by local mappings
+
+			if (! File.Exists (Path.Combine (PathFinder.StorageDir, "query-mapping.xml")))
+				return;
+
+			using (Stream s = File.OpenRead (Path.Combine (PathFinder.StorageDir, "query-mapping.xml"))) {
+				try {			
+					query_mapping = (QueryMapping) xs.Deserialize (s);
+					foreach (QueryKeywordMapping mapping in query_mapping.Mappings) {
+						if (mapping_override.ContainsKey (mapping.Keyword)) {
+							property_table.Remove (mapping.Keyword);
+							mapping_override [mapping.Keyword] = false;
+						}
+
+						PropertyKeywordFu.RegisterMapping (mapping);
+					}
+				} catch (XmlException e) {
+					Logger.Log.Error (e, "Unable to parse local query-mapping.xml");
+				}
+			}
 		}
 
-		public static void RegisterMapping (PropertyKeywordMapping mapping)
+		private static void RegisterMapping (QueryKeywordMapping mapping)
 		{
 			// If multiple mapping as registered, create an OR query for them
 			// Store the multiple matchings in a list
 			if (property_table.Contains (mapping.Keyword)) {
 				object o = property_table [mapping.Keyword];
 				if (o is ArrayList) {
-					((ArrayList)o).Add (new PropertyDetail ( 
-						mapping.IsKeyword ? PropertyType.Keyword : PropertyType.Text,
-						mapping.PropertyName, 
-						mapping.Description));
-				} else if (o is PropertyDetail) {
+					((ArrayList)o).Add (mapping);
+				} else if (o is QueryKeywordMapping) {
 					ArrayList list = new ArrayList (2);
 					list.Add (o);
-					list.Add (new PropertyDetail ( 
-						mapping.IsKeyword ? PropertyType.Keyword : PropertyType.Text,
-						mapping.PropertyName, 
-						mapping.Description));
+					list.Add (mapping);
 					property_table [mapping.Keyword] = list;
 				}
 				return;
 			}
 
-			property_table.Add (mapping.Keyword,
-					    new PropertyDetail ( 
-						mapping.IsKeyword ? PropertyType.Keyword : PropertyType.Text,
-						mapping.PropertyName, 
-						mapping.Description));
+			property_table.Add (mapping.Keyword, mapping);
 		}
 
+		////////////////////////////////////////////////////////
+
 		// return false if property not found!
-		public static bool GetPropertyDetails (string keyword, out int num, out string[] name, out PropertyType[] type) {
+		public static bool GetMapping (string keyword, out int num, out string[] name, out PropertyType[] type) {
 			num = 0;
 			name = null;
 			type = null;
@@ -175,18 +150,32 @@
 				type = new PropertyType [num];
 
 				for (int i = 0; i < num; ++i) {
-					PropertyDetail detail = (PropertyDetail) (list [i]);
-					name [i] = detail.PropertyName;
-					type [i] = detail.Type;
+					QueryKeywordMapping mapping = (QueryKeywordMapping) (list [i]);
+					name [i] = mapping.PropertyName;
+					type [i] = (mapping.IsKeyword ? PropertyType.Keyword : PropertyType.Text);
 				}
-			} else if (o is PropertyDetail) {
+			} else if (o is QueryKeywordMapping) {
 				num = 1;
 				name = new string [num];
 				type = new PropertyType [num];
-				name [0] = ((PropertyDetail) o).PropertyName;
-				type [0] = ((PropertyDetail) o).Type;
+				name [0] = ((QueryKeywordMapping) o).PropertyName;
+				type [0] = (((QueryKeywordMapping) o).IsKeyword ? PropertyType.Keyword : PropertyType.Text);
 			}
 			return true;
 		}
 	}
+
+	public class QueryMapping
+	{
+		private List<QueryKeywordMapping> property_mappings = new List<QueryKeywordMapping> ();
+
+		[XmlArray]
+		[XmlArrayItem (ElementName="Mapping", Type=typeof (QueryKeywordMapping))]
+		public List<QueryKeywordMapping> Mappings {
+			get { return property_mappings; }
+			set { property_mappings = value; }
+		}
+
+		public QueryMapping () { }
+	}
 }

Modified: branches/beagle-rdf/beagled/QueryDriver.cs
==============================================================================
--- branches/beagle-rdf/beagled/QueryDriver.cs	(original)
+++ branches/beagle-rdf/beagled/QueryDriver.cs	Thu Feb 14 22:56:49 2008
@@ -32,6 +32,7 @@
 using System.Text;
 using System.Threading;
 using Beagle.Util;
+using System.Xml.Serialization;
 
 namespace Beagle.Daemon {
 	
@@ -136,8 +137,10 @@
 		// Use introspection to find all classes that implement IQueryable, the construct
 		// associated Queryables objects.
 
-		static ArrayList queryables = new ArrayList ();
 		static Hashtable iqueryable_to_queryable = new Hashtable ();
+		static ICollection Queryables {
+			get { return iqueryable_to_queryable.Values; }
+		}
 
 		// (1) register themselves in AssemblyInfo.cs:IQueryableTypes and
 		// (2) has a QueryableFlavor attribute attached
@@ -147,7 +150,6 @@
 			int count = 0;
 
 			foreach (Type type in ReflectionFu.GetTypesFromAssemblyAttribute (assembly, typeof (IQueryableTypesAttribute))) {
-				bool type_accepted = false;
 				foreach (QueryableFlavor flavor in ReflectionFu.ScanTypeForAttribute (type, typeof (QueryableFlavor))) {
 					if (! UseQueryable (flavor.Name))
 						continue;
@@ -171,62 +173,17 @@
 
 					if (iq != null) {
 						Queryable q = new Queryable (flavor, iq);
-						queryables.Add (q);
 						iqueryable_to_queryable [iq] = q;
 						++count;
-						type_accepted = true;
 						break;
 					}
 				}
-
-				if (! type_accepted)
-					continue;
-
-				object[] attributes = type.GetCustomAttributes (false);
-				foreach (object attribute in attributes) {
-					PropertyKeywordMapping mapping = attribute as PropertyKeywordMapping;
-					if (mapping == null)
-						continue;
-					//Logger.Log.Debug (mapping.Keyword + " => " 
-					//		+ mapping.PropertyName + 
-					//		+ " is-keyword=" + mapping.IsKeyword + " (" 
-					//		+ mapping.Description + ") "
-					//		+ "(" + type.FullName + ")");
-					PropertyKeywordFu.RegisterMapping (mapping);
-				}
-					
 			}
 			Logger.Log.Debug ("Found {0} backends in {1}", count, assembly.Location);
 		}
 
 		////////////////////////////////////////////////////////
 
-		public static void ReadKeywordMappings ()
-		{
-			Logger.Log.Debug ("Reading mapping from filters");
-			ArrayList assemblies = ReflectionFu.ScanEnvironmentForAssemblies ("BEAGLE_FILTER_PATH", PathFinder.FilterDir);
-
-			foreach (Assembly assembly in assemblies) {
-				foreach (Type type in ReflectionFu.GetTypesFromAssemblyAttribute (assembly, typeof (FilterTypesAttribute))) {
-					object[] attributes = type.GetCustomAttributes (false);
-					foreach (object attribute in attributes) {
-						
-						PropertyKeywordMapping mapping = attribute as PropertyKeywordMapping;
-						if (mapping == null)
-							continue;
-						//Logger.Log.Debug (mapping.Keyword + " => " 
-						//		+ mapping.PropertyName
-						//		+ " is-keyword=" + mapping.IsKeyword + " (" 
-						//		+ mapping.Description + ") "
-						//		+ "(" + type.FullName + ")");
-						PropertyKeywordFu.RegisterMapping (mapping);
-					}
-				}
-			}
-		}
-
-		////////////////////////////////////////////////////////
-
 		// Scans PathFinder.SystemIndexesDir after available 
 		// system-wide indexes.
 		static void LoadSystemIndexes () 
@@ -324,8 +281,6 @@
 			flavor.Domain = query_domain;
 
 			Queryable queryable = new Queryable (flavor, static_queryable);
-			queryables.Add (queryable);
-
 			iqueryable_to_queryable [static_queryable] = queryable;
 
 			return true;
@@ -363,12 +318,15 @@
 			
 			assemblies = null;
 
-			ReadKeywordMappings ();
+			PropertyKeywordFu.ReadKeywordMappings ();
 
 			LoadSystemIndexes ();
 			LoadStaticQueryables ();
 
-			if (indexing_delay <= 0 || Environment.GetEnvironmentVariable ("BEAGLE_EXERCISE_THE_DOG") != null)
+			if (indexing_delay < 0)
+				return;
+
+			if (indexing_delay == 0 || Environment.GetEnvironmentVariable ("BEAGLE_EXERCISE_THE_DOG") != null)
 				StartQueryables ();
 			else {
 				Logger.Log.Debug ("Waiting {0} seconds before starting queryables", indexing_delay);
@@ -383,7 +341,7 @@
 			ArrayList started_queryables = new ArrayList ();
 			ArrayList delayed_queryables = new ArrayList ();
 
-			ICollection queryables_to_start = queryables;
+			ICollection queryables_to_start = Queryables;
 			int last_count;
 
 			do {
@@ -417,7 +375,6 @@
 
 				foreach (Queryable q in queryables_to_start) {
 					Log.Info ("  - {0}", q.Name);
-					queryables.Remove (q);
 					iqueryable_to_queryable.Remove (q.IQueryable);
 				}
 			}
@@ -459,7 +416,7 @@
 
 		static public Queryable GetQueryable (string name)
 		{
-			foreach (Queryable q in queryables) {
+			foreach (Queryable q in Queryables) {
 				if (q.Name == name)
 					return q;
 			}
@@ -640,7 +597,7 @@
 			if (! result.WorkerStart (dummy_worker))
 				return;
 			
-			foreach (Queryable queryable in queryables)
+			foreach (Queryable queryable in Queryables)
 				DoOneQuery (queryable, query, result, null);
 			
 			result.WorkerFinished (dummy_worker);
@@ -692,7 +649,7 @@
 
 		static public IEnumerable GetIndexInformation ()
 		{
-			foreach (Queryable q in queryables)
+			foreach (Queryable q in Queryables)
 				yield return q.GetQueryableStatus ();
 		}
 
@@ -706,7 +663,7 @@
 				if (! queryables_started)
 					return true;
 
-				foreach (Queryable q in queryables) {
+				foreach (Queryable q in Queryables) {
 					QueryableStatus status = q.GetQueryableStatus ();
 
 					if (status == null)

Modified: branches/beagle-rdf/beagled/QueryStringParser.cs
==============================================================================
--- branches/beagle-rdf/beagled/QueryStringParser.cs	(original)
+++ branches/beagle-rdf/beagled/QueryStringParser.cs	Thu Feb 14 22:56:49 2008
@@ -224,6 +224,17 @@
 				}
 			}
 
+			// Special case
+			if (key == "inuri") {
+				QueryPart_Property inuri_part = new QueryPart_Property ();
+				inuri_part.Logic = (IsProhibited ? QueryPartLogic.Prohibited : QueryPartLogic.Required);
+				inuri_part.Key = "inuri";
+				inuri_part.Value = text;
+				inuri_part.Type = PropertyType.Keyword;
+				Log.Debug ("Handing special query 'inuri:{0}'", text);
+				return inuri_part;
+			}
+
 			// Non-keyword queries by directly using property names
 			// Query of form property:namespace:name=value
 			// which is translated to a non-keyword query
@@ -266,7 +277,7 @@
 			PropertyType[] prop_type;
 			int num;
 
-			is_present = PropertyKeywordFu.GetPropertyDetails (key, out num, out prop_string, out prop_type);
+			is_present = PropertyKeywordFu.GetMapping (key, out num, out prop_string, out prop_type);
 			// if key is not present in the mapping, assume the query is a text query
 			// i.e. if token is foo:bar and there is no mappable property named foo,
 			// assume "foo:bar" as text query

Modified: branches/beagle-rdf/beagled/Server.cs
==============================================================================
--- branches/beagle-rdf/beagled/Server.cs	(original)
+++ branches/beagle-rdf/beagled/Server.cs	Thu Feb 14 22:56:49 2008
@@ -427,7 +427,10 @@
 			if (this.executor != null) {
 				this.executor.Cleanup ();
 				this.executor.AsyncResponseEvent -= OnAsyncResponse;
+				this.executor = null;
 			}
+
+			Server.RunGC ();
 		}
 
 		public void WatchCallback (IAsyncResult ar)
@@ -632,10 +635,19 @@
 
 		public static Hashtable item_handlers = new Hashtable ();
 
+		private static System.Timers.Timer gc_timer = null;
+
 		static Server ()
 		{
 			foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies ())
 				ScanAssemblyForExecutors (assembly);
+
+			if (Environment.GetEnvironmentVariable ("BEAGLE_FORCE_GC") != null) {
+				gc_timer = new System.Timers.Timer ();
+				gc_timer.Interval = 60000; // GC Collect to run after xxx msecs of last client closing
+				gc_timer.Elapsed += new ElapsedEventHandler (GCTimerElapsed);
+				gc_timer.AutoReset = false;
+			}
 		}
 
 		public Server (string name, bool indexhelper, bool enable_network_svc)
@@ -676,6 +688,32 @@
 			}
 		}
 
+		static int gc_count = 0;
+
+		static internal void RunGC ()
+		{
+			if (gc_timer == null)
+				return;
+
+			gc_timer.Stop ();
+			gc_timer.AutoReset = true;
+			gc_count = 5;
+			gc_timer.Start ();
+		}
+
+		private static void GCTimerElapsed (object sender, ElapsedEventArgs e)
+    		{
+			Console.WriteLine("After GC collection: {0} (RSS {1})", GC.GetTotalMemory (false), SystemInformation.VmRss);
+
+			GC.Collect (2); // The argument is a no-op in mono
+			GC.WaitForPendingFinalizers();
+
+			if (--gc_count == 0) {
+				gc_timer.AutoReset = false;
+				gc_timer.Stop ();
+			}
+    		}
+
 		private static void OnShutdown ()
 		{
 			lock (live_handlers) {
@@ -688,7 +726,6 @@
 
 		private void Run ()
 		{
-			this.running = true;
 			this.unix_listener.Start ();
 
 			if (! Shutdown.WorkerStart (this, String.Format ("server '{0}'", socket_path)))
@@ -729,7 +766,7 @@
 
 			Logger.Log.Debug ("Server '{0}' shut down", this.socket_path);
 		}
-		
+
 		private void HttpRun ()
 		{
 			http_listener = new HttpListener ();
@@ -860,6 +897,17 @@
 			http_listener = null;
 		}
 
+		private void RunInThread ()
+		{
+			try {
+				this.Run ();
+			} catch (ThreadAbortException) {
+				Thread.ResetAbort ();
+				Log.Debug ("Breaking out of UnixListener -- shutdown requested");
+				Shutdown.WorkerFinished (this);
+			}
+		}
+
 		public void Start ()
 		{
 			if (!initialized)
@@ -868,6 +916,8 @@
 			if (Shutdown.ShutdownRequested)
 				return;
 
+			this.running = true;
+
 			if (! indexhelper) {
 				Config config = Conf.Get (Conf.Names.NetworkingConfig);
 				webinterface = config.GetOption ("WebInterface", false);
@@ -878,15 +928,7 @@
 					ExceptionHandlingThread.Start (new ThreadStart (this.HttpRun));
 			}
 
-			ExceptionHandlingThread.Start (new ThreadStart (delegate () {
-							    try {
-								    this.Run ();
-							    } catch (ThreadAbortException) {
-								    Thread.ResetAbort ();
-							    	    Log.Debug ("Breaking out of UnixListener -- shutdown requested");
-							    	    Shutdown.WorkerFinished (this);
-							    }
-						    }));
+			ExceptionHandlingThread.Start (new ThreadStart (this.RunInThread));
 		}
 
 		private void StartWebserver ()
@@ -899,6 +941,9 @@
 
 		public void Stop ()
 		{
+			if (gc_timer != null)
+				gc_timer.Stop ();
+
 			if (this.running) {
 				this.running = false;
 				this.unix_listener.Stop ();

Modified: branches/beagle-rdf/beagled/SqliteUtils.cs
==============================================================================
--- branches/beagle-rdf/beagled/SqliteUtils.cs	(original)
+++ branches/beagle-rdf/beagled/SqliteUtils.cs	Thu Feb 14 22:56:49 2008
@@ -72,17 +72,23 @@
 			return DoNonQuery (connection, command_text, null, null);
 		}
 
-		public static SqliteCommand QueryCommand (SqliteConnection connection, string where_format, params object [] where_args)
+		public static int DoNonQuery (SqliteCommand command)
 		{
-			SqliteCommand command;
-			command = new SqliteCommand ();
-			command.Connection = connection;
-			command.CommandText =
-				"SELECT unique_id, directory, filename, last_mtime, last_attrtime, filter_name, filter_version " +
-				"FROM file_attributes WHERE " + 
-				String.Format (where_format, where_args);
-			return command;
+			int ret = 0;
+			while (true) {
+				try {
+					ret = command.ExecuteNonQuery ();
+					break;
+				} catch (SqliteBusyException ex) {
+					Thread.Sleep (50);
+				} catch (Exception e) {
+					Log.Error ( e, "SQL that caused the exception: {0}", command.CommandText);
+					throw;
+				}
+			}
+			return ret;
 		}
+		
 
 		public static SqliteDataReader ExecuteReaderOrWait (SqliteCommand command)
 		{

Modified: branches/beagle-rdf/beagled/StaticQueryable.cs
==============================================================================
--- branches/beagle-rdf/beagled/StaticQueryable.cs	(original)
+++ branches/beagle-rdf/beagled/StaticQueryable.cs	Thu Feb 14 22:56:49 2008
@@ -36,12 +36,10 @@
 
 namespace Beagle.Daemon {
 
-	[PropertyKeywordMapping (Keyword="ext", PropertyName="beagle:FilenameExtension", IsKeyword=true, Description="File extension, e.g. ext:jpeg. Use ext: to search in files with no extension.")]
-
 	public class StaticQueryable : LuceneQueryable 	{
-		
+
 		protected TextCache text_cache;
-		
+
 		public StaticQueryable (string index_name, string index_path, bool read_only_mode) : base (index_path, read_only_mode)
 		{
 			Logger.Log.Debug ("Initializing static queryable: {0}", index_path);

Modified: branches/beagle-rdf/beagled/TextCache.cs
==============================================================================
--- branches/beagle-rdf/beagled/TextCache.cs	(original)
+++ branches/beagle-rdf/beagled/TextCache.cs	Thu Feb 14 22:56:49 2008
@@ -50,7 +50,10 @@
 
 		private const string SELF_CACHE_TAG = "*self*";
 		private const string BLOB_TAG = "*blob*";
-
+		public SqliteCommand InsertCommand;
+		public SqliteCommand LookupPathCommand;
+		public SqliteCommand LookupDataCommand;
+		public SqliteCommand DeleteCommand;
 		private string text_cache_dir;
 		internal string TextCacheDir {
 			get { return text_cache_dir; }
@@ -166,8 +169,20 @@
 							"  data     BLOB                     " +
 							")");
 			}
+			this.InitCommands ();
 		}
 
+		private void InitCommands ()
+		{
+			InsertCommand = new SqliteCommand (this.connection);
+			InsertCommand.CommandText = "INSERT OR REPLACE INTO textcache_data (uri, filename, data) VALUES (@uri,@filename,@data)";
+			LookupPathCommand = new SqliteCommand (this.connection);
+			LookupPathCommand.CommandText = "SELECT filename FROM textcache_data WHERE uri= uri";
+			LookupDataCommand = new SqliteCommand (this.connection);
+			LookupDataCommand.CommandText = "SELECT filename, data FROM textcache_data WHERE uri= uri";
+			DeleteCommand = new SqliteCommand (this.connection);
+			DeleteCommand.CommandText = "DELETE FROM textcache_data WHERE uri= uri";
+		}
 		private SqliteConnection Open (string db_filename)
 		{
 			SqliteConnection connection = new SqliteConnection ();
@@ -194,10 +209,11 @@
 		{
 			lock (connection) {
 				MaybeStartTransaction_Unlocked ();
-				SqliteUtils.DoNonQuery (connection,
-							"INSERT OR REPLACE INTO textcache_data (uri, filename, data) VALUES (@uri,@filename,@data)",
-							new string [] {"@uri", "@filename", "@data"},
-							new object [] {UriToString (uri), filename, data});
+				InsertCommand.Parameters.AddWithValue ("@uri",UriToString (uri));
+				InsertCommand.Parameters.AddWithValue ("@filename",filename);
+				InsertCommand.Parameters.AddWithValue ("@data", data);
+				SqliteUtils.DoNonQuery (InsertCommand);
+
 			}
 		}
 
@@ -210,18 +226,14 @@
 		// Returns raw path as stored in the db i.e. relative path wrt the text_cache_dir
 		private string LookupPathRawUnlocked (Uri uri)
 		{
-			SqliteCommand command;
-			SqliteDataReader reader = null;
+			//SqliteCommand command;
 			string path = null;
-
-			command = NewCommand ("SELECT filename FROM textcache_data WHERE uri='{0}'", 
-			                      UriToString (uri));
-			reader = SqliteUtils.ExecuteReaderOrWait (command);
-			if (SqliteUtils.ReadOrWait (reader))
-				path = reader.GetString (0);
-			reader.Close ();
-			command.Dispose ();
-
+			LookupPathCommand.Parameters.AddWithValue ("@uri", UriToString (uri));
+			using (SqliteDataReader reader = SqliteUtils.ExecuteReaderOrWait (LookupPathCommand)) {
+				if (SqliteUtils.ReadOrWait (reader))
+					path = reader.GetString (0);
+			}
+			
 			return path;
 		}
 
@@ -441,26 +453,24 @@
 		// If self_cache is true when called, then self_cache will be set upon return
 		public TextReader GetReader (Uri uri, ref bool self_cache)
 		{
-			SqliteCommand command;
-			SqliteDataReader reader = null;
 			byte[] blob = null;
 			string filename = null;
 
 			lock (connection) {
-				command = NewCommand ("SELECT filename, data FROM textcache_data WHERE uri='{0}'", 
-				                      UriToString (uri));
-				reader = SqliteUtils.ExecuteReaderOrWait (command);
-				if (! SqliteUtils.ReadOrWait (reader)) {
-					if (self_cache)
-						self_cache = false;
-					return null;
-				}
+				
+				LookupDataCommand.Parameters.AddWithValue("@uri",UriToString (uri));
+				using (SqliteDataReader reader = SqliteUtils.ExecuteReaderOrWait (LookupDataCommand)) {
+					if (! SqliteUtils.ReadOrWait (reader)) {
+						if (self_cache)
+							self_cache = false;
+						return null;
+					}
 
 				filename = reader.GetString (0);
 				if (! reader.IsDBNull (1))
 					blob = reader.GetValue (1) as byte [];
-				reader.Close ();
-				command.Dispose ();
+				}
+
 			}
 
 			if (filename == SELF_CACHE_TAG) {
@@ -500,10 +510,8 @@
 				string path = LookupPathRawUnlocked (uri);
 				if (path != null) {
 					MaybeStartTransaction_Unlocked ();
-					SqliteUtils.DoNonQuery (connection,
-								"DELETE FROM textcache_data WHERE uri= uri", 
-								new string [] {"@uri"},
-								new object [] {UriToString (uri)}); 
+					DeleteCommand.Parameters.AddWithValue("@uri", UriToString (uri));
+					SqliteUtils.DoNonQuery (DeleteCommand);
 					if (path != SELF_CACHE_TAG && path != BLOB_TAG)
 						File.Delete (Path.Combine (text_cache_dir, path));
 				}

Modified: branches/beagle-rdf/beagled/TomboyQueryable/TomboyQueryable.cs
==============================================================================
--- branches/beagle-rdf/beagled/TomboyQueryable/TomboyQueryable.cs	(original)
+++ branches/beagle-rdf/beagled/TomboyQueryable/TomboyQueryable.cs	Thu Feb 14 22:56:49 2008
@@ -36,7 +36,6 @@
 namespace Beagle.Daemon.TomboyQueryable {
 
 	[QueryableFlavor (Name="Tomboy", Domain=QueryDomain.Local, RequireInotify=false)]
-	[PropertyKeywordMapping (Keyword="notetag", PropertyName="note:tag", IsKeyword=false, Description="Tag associated with a tomboy note.")]
 	public class TomboyQueryable : LuceneFileQueryable, IIndexableGenerator  {
 
 		string tomboy_dir;

Modified: branches/beagle-rdf/beagled/WebServer.cs
==============================================================================
--- branches/beagle-rdf/beagled/WebServer.cs	(original)
+++ branches/beagle-rdf/beagled/WebServer.cs	Thu Feb 14 22:56:49 2008
@@ -72,6 +72,7 @@
 			mappings.Add ("/images/beagle-logo.png", new PageMapping ("images/beagle-logo.png", "image/png"));
 			mappings.Add ("/images/busy-animation.gif", new PageMapping ("images/busy-animation.gif", "image/gif"));
 			mappings.Add ("/images/favicon.png", new PageMapping ("images/favicon.png", "image/png"));
+			mappings.Add ("/images/system-search.png", new PageMapping ("images/system-search.png", "image/png"));
 
 			webserver_dir = Environment.GetEnvironmentVariable ("BEAGLE_WEBSERVER_DIR");
 			if (webserver_dir != null) {

Modified: branches/beagle-rdf/beagled/beagle-dump-index.1
==============================================================================
--- branches/beagle-rdf/beagled/beagle-dump-index.1	(original)
+++ branches/beagle-rdf/beagled/beagle-dump-index.1	Thu Feb 14 22:56:49 2008
@@ -24,6 +24,9 @@
 .B --term-frequencies
 Dump term frequencies
 .TP
+.B --fields
+Dump all fields
+.TP
 .B --show-counts
 Show index count totals (default)
 .TP

Modified: branches/beagle-rdf/beagled/beagled.in
==============================================================================
--- branches/beagle-rdf/beagled/beagled.in	(original)
+++ branches/beagle-rdf/beagled/beagled.in	Thu Feb 14 22:56:49 2008
@@ -24,6 +24,10 @@
 	    export BEAGLE_WEBSERVER_DIR="./webinterface"
     fi
 
+    if [ -z $BEAGLE_CONF_DIR ]; then
+	    export BEAGLE_CONF_DIR="../conf-data"
+    fi
+
 else
 
     # Otherwise default to running in the background

Modified: branches/beagle-rdf/beagled/webinterface/default.css
==============================================================================
--- branches/beagle-rdf/beagled/webinterface/default.css	(original)
+++ branches/beagle-rdf/beagled/webinterface/default.css	Thu Feb 14 22:56:49 2008
@@ -27,7 +27,7 @@
 	color: #444;
 	background: #fff url(images/title_bg.png) 0 -80px repeat-x;
 	position: relative;
-	margin: 40px;
+	margin: 30px;
 	font-family: trebuchet ms,luxi sans,sans-serif;
 	font-size: 96%;
 	text-align: center;
@@ -35,6 +35,11 @@
 
 /************ header ***************/
 
+#menubar {
+	margin: -30px; /* with respect to body margin */
+	float: right;
+}
+
 #header img {
 	float: left;
 	margin: 0.5em;
@@ -53,7 +58,13 @@
 	margin-bottom: 1.8em;
 }
 
-#headerlinks {
+#querytext {
+	background-image: url('images/system-search.png');
+	background-repeat: no-repeat;
+	padding-left:20px;
+}
+
+#searchoptions {
 	margin-right: 1.2em;
 }
 
@@ -171,6 +182,10 @@
 	width: 50%;
 }
 
+.Timestamp .Filesize {
+	color: #808080;
+}
+
 .Timestamp {
 	float: right;
 	text-align: right;
@@ -205,6 +220,11 @@
 	visibility: visible;
 }
 
+td.SearchProperty a img {
+	height: 15px;
+	border: 0px;
+}
+
 .PropertyValue {
 	color: #000066;
 }

Modified: branches/beagle-rdf/beagled/webinterface/default.js
==============================================================================
--- branches/beagle-rdf/beagled/webinterface/default.js	(original)
+++ branches/beagle-rdf/beagled/webinterface/default.js	Thu Feb 14 22:56:49 2008
@@ -541,31 +541,39 @@
 /************* Datetime parsing routines ***************/
 
 // We're putting these here so they're reused. Much faster this way.
-var regexp = /^(.{4})(.{2})(.{2})/;
-var time = new Date ().toLocaleFormat ("%Y%m%d%H%M%S");
-var timestamp = new Date ();
+var regexp = /^(.{4})(.{2})(.{2})(.{2})(.{2})(.{2})/;
 function humanise_timestamp (ts) 
 {
 	var array = regexp.exec (ts);
-	timestamp.setFullYear (array [1]);
 	// Erm. Months are counted from 0 in javascript for some reason <_<
-	timestamp.setMonth (array [2] - 1);
-	timestamp.setDate (array [3]);
-	// < 1 day
-	if ( (time - ts) < 1000000 ) {
-		return "Today";
-	// < 2 days
-	} else if ( (time - ts) < 2000000 ) {
-		return "Yesterday";
-	// < 7 days
-	} else if ( (time - ts) < 7000000 ) {
-		return timestamp.toLocaleFormat ('%A');
-	// < 1 year
-	} else if ( (time - ts) < 10000000000 ) {
+	var timestamp = new Date (Date.UTC (array [1], array [2] - 1, array [3], array [4], array [5], array [6]));
+
+	var now = new Date ();
+	var today = new Date (now.getFullYear (), now.getMonth (), now.getDate ());
+
+	if (timestamp >= today ) {
+		return "Today " + timestamp.toLocaleFormat ('%I:%M %p');
+	}
+
+	// 1 day = 86,400,000 msecs
+	var yesterday = new Date (today.getTime () - 86400000);
+	if (timestamp >= yesterday) {
+		return "Yesterday " + timestamp.toLocaleFormat ('%I:%M %p');
+	}
+	
+	// This week (ignoring the seconds part)
+	var week_begin = new Date (today.getTime () - (86400000 * today.getDay ()));
+	if (timestamp >= week_begin) {
+		return timestamp.toLocaleFormat ('%A') + " " + timestamp.toLocaleFormat ('%I:%M %p');
+	}
+
+	// This year
+	var year_begin = new Date (today.getFullYear, 0, 1);
+	if (timestamp >= year_begin) {
 		return timestamp.toLocaleFormat ('%B %e');
-	} else {
-		return timestamp.toLocaleFormat ('%B %e, %Y')
 	}
+
+	return timestamp.toLocaleFormat ('%B %e, %Y')
 }
 
 /**************** Code to handle styles and ui issues ******************/
@@ -702,6 +710,35 @@
 	}
 }
 
+/******* Add to bookmark *******************************************/
+
+function bookmark_query ()
+{
+	// Firefox specific !
+	if (! window.sidebar) {
+		alert ("Adding bookmarks only supported in Firefox!");
+		return;
+	}
+
+	var title = document.queryform.querytext.value;
+	if (title == "")
+		return;
+
+	var url = "http://"; + document.location.host + "/?search=" + escape (title);
+
+	// Using window.sidebar.addPanel () will create bookmark that will open in sidebar
+	var answer = confirm ("Due to limitations in Firefox the bookmark will open in the sidebar. To open it in the main window, uncheck the option in the Property of this bookmark. Continue ?");
+	if (answer)
+		window.sidebar.addPanel (title, url, "");
+}
+
+/******* Advance search GUI ****************************************/
+
+function show_advanced_search ()
+{
+	alert ("Not implemented.");
+}
+
 /******* Initial fetching and loading of the xsl/xml files *********/
 
 // processing of query string parameters, if called as

Modified: branches/beagle-rdf/beagled/webinterface/hitresult.xsl
==============================================================================
--- branches/beagle-rdf/beagled/webinterface/hitresult.xsl	(original)
+++ branches/beagle-rdf/beagled/webinterface/hitresult.xsl	Thu Feb 14 22:56:49 2008
@@ -59,6 +59,13 @@
 				</a>
 			</span>
 			<span class="Timestamp" name="Timestamp">
+				<!-- Pushing the filesize information to the right, just before the timestamp -->
+				<xsl:if test="Properties/Property[ Key='fixme:filesize']">
+					<span class="Filesize" name="Filesize">
+						<xsl:variable name="filesize"><xsl:value-of select="Properties/Property[ Key='fixme:filesize']/@Value"/></xsl:variable>
+						<i><xsl:value-of select="ceiling ($filesize div 1024)"/> KB</i>&nbsp;
+					</span>
+				</xsl:if>
 				<xsl:value-of select="@Timestamp"/>
 			</span>
 		</div>
@@ -119,7 +126,7 @@
 		<xsl:for-each select="Property">
 			<xsl:if test="@Name != ''">
 				<tr class="Property">
-				<td class="SearchProperty"><a href="#" onclick="search_property(this); return false;">Search</a></td>
+				<td class="SearchProperty"><a href="#" onclick="search_property(this); return false;"><img src="images/system-search.png" alt="Search for this property and value" title="Search for this property and value" /></a></td>
 				<td class="PropertyKey" key="{ Key}"><xsl:value-of select="@Name"/></td>
 				<td class="PropertyValue" type="{ Type}"><xsl:value-of select="@Value"/></td>
 				</tr>

Modified: branches/beagle-rdf/beagled/webinterface/index.xsl
==============================================================================
--- branches/beagle-rdf/beagled/webinterface/index.xsl	(original)
+++ branches/beagle-rdf/beagled/webinterface/index.xsl	Thu Feb 14 22:56:49 2008
@@ -85,15 +85,19 @@
 </xsl:template>
 
 <xsl:template name="header">
+	<div id="menubar">
+		<a href="#" onclick='get_information (); return false;'>Current Status</a>&nbsp;|&nbsp;
+		<a href="#" onclick='alert ("Not implemented"); return false;'>Settings</a>&nbsp;|&nbsp;
+		<a href="help.html" target="_blank" >Help</a>
+	</div>
 	<a href="."><img src="images/beagle-logo.png"/></a>
 	<form name="queryform" onsubmit='search (); return false;' action="POST">
-		<input name="querytext" type="text" size="50" />
+		<input name="querytext" id="querytext" type="text" size="50" />
 		<input name="querysubmit" type="submit" value="Search"/>
 	</form>
-	<span id="headerlinks">
-		<a href="#" onclick='get_information (); return false;'>Current Status</a>&nbsp;|&nbsp;
-		<a href="#" onclick='alert ("Not implemented"); return false;'>Beagle settings</a>&nbsp;|&nbsp;
-		<a href="help.html" target="_blank" >Help</a>
+	<span id="searchoptions">
+		<a href="#" onclick='show_advanced_search (); return false;'>Advance search</a>&nbsp;|&nbsp;
+		<a href="#" onclick='bookmark_query (); return false;'>Bookmark current search</a>
 	</span>
 </xsl:template>
 

Modified: branches/beagle-rdf/beagled/webinterface/propname-table.js
==============================================================================
--- branches/beagle-rdf/beagled/webinterface/propname-table.js	(original)
+++ branches/beagle-rdf/beagled/webinterface/propname-table.js	Thu Feb 14 22:56:49 2008
@@ -17,6 +17,7 @@
 'beagle:NoContent': '',
 'beagle:InternalUri': '',
 'beagle:ParentDirUri': 'Parent dir',
+'fixme:filesize': '',
 // FilterAbiword.cs
 'fixme:appname': 'Creating application',
 'dc:description': 'Description',

Modified: branches/beagle-rdf/beagled/wrapper.in
==============================================================================
--- branches/beagle-rdf/beagled/wrapper.in	(original)
+++ branches/beagle-rdf/beagled/wrapper.in	Thu Feb 14 22:56:49 2008
@@ -12,6 +12,11 @@
     export MONO_PATH="../Util:../BeagleClient${MONO_PATH+:$MONO_PATH}"
     export LD_LIBRARY_PATH="../glue/.libs${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
     export BEAGLE_FILTER_PATH="../Filters${BEAGLE_FILTER_PATH+:$BEAGLE_FILTER_PATH}"
+
+    if [ -z $BEAGLE_CONF_DIR ]; then
+	    export BEAGLE_CONF_DIR="../conf-data"
+    fi
+
 else
     THIS_PATH="@pkglibdir@"
     THIS_EXE="@pkglibdir@/@target@"

Modified: branches/beagle-rdf/bludgeon/Makefile.am
==============================================================================
--- branches/beagle-rdf/bludgeon/Makefile.am	(original)
+++ branches/beagle-rdf/bludgeon/Makefile.am	Thu Feb 14 22:56:49 2008
@@ -32,7 +32,7 @@
 	$(srcdir)/Token.cs		\
 	$(srcdir)/EventTracker.cs	\
 	$(srcdir)/Action.cs		\
-					\
+	$(srcdir)/CommandLineFu.cs	\
 	$(srcdir)/FileSystemObject.cs	\
 	$(srcdir)/Bzip2FileObject.cs	\
 	$(srcdir)/DirectoryObject.cs	\

Modified: branches/beagle-rdf/configure.in
==============================================================================
--- branches/beagle-rdf/configure.in	(original)
+++ branches/beagle-rdf/configure.in	Thu Feb 14 22:56:49 2008
@@ -4,7 +4,7 @@
 
 AC_INIT(beagled/BeagleDaemon.cs)
 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(beagle, 0.3.1)
+AM_INIT_AUTOMAKE(beagle, 0.3.3)
 
 ########################################################################
 
@@ -14,7 +14,9 @@
 
 MONO_REQUIRED=1.2.4
 MONODOC_REQUIRED=1.2.4
-GTK_SHARP_REQUIRED=2.4.0
+NDESK_DBUS_REQUIRED=0.5.2
+NDESK_DBUS_GLIB_REQUIRED=0.3.0
+GTK_SHARP_REQUIRED=2.6.0
 GMIME_SHARP_REQUIRED=2.2.0
 EVOLUTION_SHARP_REQUIRED=0.13.3
 GSF_SHARP_REQUIRED=0.6
@@ -85,6 +87,12 @@
 SHARPZIPLIB_LIBS="-r:ICSharpCode.SharpZipLib"
 AC_SUBST(SHARPZIPLIB_LIBS)
 
+# D-Bus libraries
+PKG_CHECK_MODULES(NDESK_DBUS, ndesk-dbus-1.0 >= $NDESK_DBUS_REQUIRED)
+
+PKG_CHECK_MODULES(NDESK_DBUS_GLIB, ndesk-dbus-glib-1.0 >= $NDESK_DBUS_GLIB_REQUIRED)
+AC_SUBST(NDESK_DBUS_GLIB_LIBS)
+
 # check for OS
 case "$target" in
   *-*-linux*)
@@ -117,10 +125,9 @@
 # I18N
 #
 
-AC_PROG_INTLTOOL([0.23])
+IT_PROG_INTLTOOL([0.35.0])
 GETTEXT_PACKAGE=beagle
 AC_SUBST(GETTEXT_PACKAGE)
-ALL_LINGUAS="ar bg ca cs da de dz el en_CA en_GB es eu fi fr gl he hi hu it ja ka ko lt lv mk nb nl oc pa pl pt pt_BR ru sl sr sr Latn sv th tr uk vi zh_CN zh_HK zh_TW"
 AM_GLIB_GNU_GETTEXT
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the package for translations])
 
@@ -244,6 +251,7 @@
 PKG_CHECK_MODULES(EVO,
                   evolution-sharp >= $EVOLUTION_SHARP_REQUIRED 	\
                   gconf-sharp-2.0 >= $GTK_SHARP_REQUIRED	\
+		  glib-sharp-2.0 >= $GTK_SHARP_REQUIRED
                   gmime-sharp >= $GMIME_SHARP_REQUIRED,
                   have_evo_dependencies=yes, have_evo_dependencies=no)
 AC_SUBST(EVO_LIBS)
@@ -341,9 +349,24 @@
 
 dnl taglib-sharp: Needed for indexing audio formats
 
-PKG_CHECK_MODULES(TAGLIB_SHARP, taglib-sharp >= 2.0, internal_taglib=no, internal_taglib=yes)
+AC_ARG_ENABLE([internal-taglib],
+	AC_HELP_STRING([--enable-internal-taglib], [Use internal taglib-sharp (default auto)]),
+	enable_internal_taglib=$enableval,
+	enable_internal_taglib=auto)
+
+if test "x$enable_internal_taglib" != "xyes"; then
+	PKG_CHECK_MODULES(TAGLIB_SHARP, taglib-sharp >= 2.0, internal_taglib=no, internal_taglib=yes)
+	if test "x$enable_internal_taglib" = "xno" -a "x$internal_taglib" = "xyes"; then
+		AC_MSG_ERROR([taglib-sharp >= 2.0 not found])
+	else
+		enable_internal_taglib=$internal_taglib
+	fi
+else
+	enable_internal_taglib="yes"
+fi
+
 AC_SUBST(TAGLIB_SHARP_LIBS)
-AM_CONDITIONAL(INTERNAL_TAGLIB, test "x$internal_taglib" = "xyes")
+AM_CONDITIONAL(INTERNAL_TAGLIB, test "x$enable_internal_taglib" = "xyes")
 
 dnl ----------------------------------------------
 
@@ -528,6 +551,26 @@
 
 dnl ----------------------------------------------
 
+dnl Qt beagle-settings
+
+AC_ARG_ENABLE([qt],
+	AC_HELP_STRING([--enable-qt], [Enable Qt GUI for beagle-settings (default no)]),
+	enable_qt=$enableval,
+	enable_qt=no)
+
+if test "x$enable_qt" != "xno"; then
+	PKG_CHECK_MODULES(QYOTO, qyoto >= 4.3.0, has_qyoto=yes, has_qyoto=no)
+	if test "x$enable_qt" = "xyes" -a "x$has_qyoto" != "xyes"; then
+		AC_MSG_ERROR([qyoto >= 4.3.0 not found])
+	else
+		enable_qt=$has_qyoto
+	fi
+fi
+
+AM_CONDITIONAL(ENABLE_QT, test "x$enable_qt" = "xyes")
+
+dnl ----------------------------------------------
+
 dnl Monodoc
 
 AC_ARG_ENABLE(docs,
@@ -592,6 +635,7 @@
 doc/api/Makefile
 bludgeon/Makefile
 RDFAdapter/Makefile
+conf-data/Makefile
 beagle-0.0.pc
 beagle-daemon.pc
 beagle-ui-0.0.pc
@@ -619,10 +663,12 @@
 	Epiphany Extension?	  ${enable_epiphany_extension}
 	Thunderbird Extension? 	  ${enable_tbird}
 
-	Local taglib-sharp?       ${internal_taglib}
+	Local taglib-sharp?       ${enable_internal_taglib}
 
 	Monitor screensaver       ${have_xss}
 	beagle-search GUI	  ${enable_gui}
 
+	Qt beagle-settings GUI    ${enable_qt}
+
 	Build docs?               ${with_docs}
 "

Modified: branches/beagle-rdf/doc/api/BeagleClient/Beagle/EmptyResponse.xml
==============================================================================
--- branches/beagle-rdf/doc/api/BeagleClient/Beagle/EmptyResponse.xml	(original)
+++ branches/beagle-rdf/doc/api/BeagleClient/Beagle/EmptyResponse.xml	Thu Feb 14 22:56:49 2008
@@ -8,16 +8,20 @@
     <BaseTypeName>Beagle.ResponseMessage</BaseTypeName>
   </Base>
   <Interfaces />
-  <Members/>
+  <Members>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public EmptyResponse ();" />
+      <MemberType>Constructor</MemberType>
+      <Parameters />
+      <Docs>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+  </Members>
   <Docs>
     <summary>This represents an empty response from the service.</summary>
     <remarks>Currently these messages can return empty responses:
-	<list type="bullet">
-	    <item><term>sending data using <see cref="T:Beagle.IndexingServiceRequest"/>.</term></item>
-	    <item><term>sending a <see cref="T:Beagle.ShutdownRequest"/>.</term></item>
-	    <item><term>sending a <see cref="T:Beagle.ReloadConfigRequest"/>.</term></item>
-	    <item><term>sending a <see cref="T:Beagle.OptimizeIndexesRequest"/>.</term></item>
-	</list>
-    </remarks>
+	<list type="bullet"><item><term>sending data using <see cref="T:Beagle.IndexingServiceRequest" />.</term></item><item><term>sending a <see cref="T:Beagle.ShutdownRequest" />.</term></item><item><term>sending a <see cref="T:Beagle.ReloadConfigRequest" />.</term></item><item><term>sending a <see cref="T:Beagle.OptimizeIndexesRequest" />.</term></item></list></remarks>
   </Docs>
 </Type>

Modified: branches/beagle-rdf/doc/api/BeagleClient/Beagle/Hit.xml
==============================================================================
--- branches/beagle-rdf/doc/api/BeagleClient/Beagle/Hit.xml	(original)
+++ branches/beagle-rdf/doc/api/BeagleClient/Beagle/Hit.xml	Thu Feb 14 22:56:49 2008
@@ -279,11 +279,11 @@
       </Docs>
     </Member>
     <Member MemberName="MimeType">
-      <MemberSignature Language="C#" Value="public string MimeType { set; get; };" />
+      <MemberSignature Language="C#" Value="public string MimeType { get; };" />
       <MemberType>Property</MemberType>
       <Attributes>
         <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlAttribute</AttributeName>
+          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
         </Attribute>
       </Attributes>
       <ReturnValue>
@@ -353,19 +353,33 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="property_list">
-      <MemberSignature Language="C#" Value="public Beagle.PropertyList property_list { set; get; };" />
+    <Member MemberName="Score">
+      <MemberSignature Language="C#" Value="public double Score { set; get; };" />
       <MemberType>Property</MemberType>
       <Attributes>
         <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlArrayItem(ElementName="Property", Type=typeof(Beagle.Property))</AttributeName>
+          <AttributeName>System.Xml.Serialization.XmlAttribute</AttributeName>
         </Attribute>
+      </Attributes>
+      <ReturnValue>
+        <ReturnType>System.Double</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Source">
+      <MemberSignature Language="C#" Value="public string Source { get; };" />
+      <MemberType>Property</MemberType>
+      <Attributes>
         <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlArray(ElementName="Properties")</AttributeName>
+          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
         </Attribute>
       </Attributes>
       <ReturnValue>
-        <ReturnType>Beagle.PropertyList</ReturnType>
+        <ReturnType>System.String</ReturnType>
       </ReturnValue>
       <Docs>
         <summary>To be added.</summary>
@@ -373,16 +387,16 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="Score">
-      <MemberSignature Language="C#" Value="public double Score { set; get; };" />
+    <Member MemberName="SourceObject">
+      <MemberSignature Language="C#" Value="public object SourceObject { set; get; };" />
       <MemberType>Property</MemberType>
       <Attributes>
         <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlAttribute</AttributeName>
+          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
         </Attribute>
       </Attributes>
       <ReturnValue>
-        <ReturnType>System.Double</ReturnType>
+        <ReturnType>System.Object</ReturnType>
       </ReturnValue>
       <Docs>
         <summary>To be added.</summary>
@@ -390,12 +404,12 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="Source">
-      <MemberSignature Language="C#" Value="public string Source { set; get; };" />
+    <Member MemberName="Type">
+      <MemberSignature Language="C#" Value="public string Type { get; };" />
       <MemberType>Property</MemberType>
       <Attributes>
         <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlAttribute</AttributeName>
+          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
         </Attribute>
       </Attributes>
       <ReturnValue>
@@ -407,8 +421,8 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="SourceObject">
-      <MemberSignature Language="C#" Value="public object SourceObject { set; get; };" />
+    <Member MemberName="Uri">
+      <MemberSignature Language="C#" Value="public Uri Uri { set; get; };" />
       <MemberType>Property</MemberType>
       <Attributes>
         <Attribute>
@@ -416,7 +430,7 @@
         </Attribute>
       </Attributes>
       <ReturnValue>
-        <ReturnType>System.Object</ReturnType>
+        <ReturnType>System.Uri</ReturnType>
       </ReturnValue>
       <Docs>
         <summary>To be added.</summary>
@@ -424,12 +438,12 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="Type">
-      <MemberSignature Language="C#" Value="public string Type { set; get; };" />
+    <Member MemberName="FileType">
+      <MemberSignature Language="C#" Value="public string FileType { get; };" />
       <MemberType>Property</MemberType>
       <Attributes>
         <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlAttribute</AttributeName>
+          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
         </Attribute>
       </Attributes>
       <ReturnValue>
@@ -441,16 +455,19 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="Uri">
-      <MemberSignature Language="C#" Value="public Uri Uri { set; get; };" />
+    <Member MemberName="PropertyList">
+      <MemberSignature Language="C#" Value="public Beagle.PropertyList PropertyList { set; get; };" />
       <MemberType>Property</MemberType>
       <Attributes>
         <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
+          <AttributeName>System.Xml.Serialization.XmlArrayItem(ElementName="Property", Type=typeof(Beagle.Property))</AttributeName>
+        </Attribute>
+        <Attribute>
+          <AttributeName>System.Xml.Serialization.XmlArray(ElementName="Properties")</AttributeName>
         </Attribute>
       </Attributes>
       <ReturnValue>
-        <ReturnType>System.Uri</ReturnType>
+        <ReturnType>Beagle.PropertyList</ReturnType>
       </ReturnValue>
       <Docs>
         <summary>To be added.</summary>

Modified: branches/beagle-rdf/doc/api/BeagleClient/Beagle/Query.xml
==============================================================================
--- branches/beagle-rdf/doc/api/BeagleClient/Beagle/Query.xml	(original)
+++ branches/beagle-rdf/doc/api/BeagleClient/Beagle/Query.xml	Thu Feb 14 22:56:49 2008
@@ -45,36 +45,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="AddHitType">
-      <MemberSignature Language="C#" Value="public void AddHitType (string str);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue>
-        <ReturnType>System.Void</ReturnType>
-      </ReturnValue>
-      <Parameters>
-        <Parameter Name="str" Type="System.String" />
-      </Parameters>
-      <Docs>
-        <param name="str">To be added.</param>
-        <summary>To be added.</summary>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
-    <Member MemberName="AddMimeType">
-      <MemberSignature Language="C#" Value="public void AddMimeType (string str);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue>
-        <ReturnType>System.Void</ReturnType>
-      </ReturnValue>
-      <Parameters>
-        <Parameter Name="str" Type="System.String" />
-      </Parameters>
-      <Docs>
-        <param name="str">To be added.</param>
-        <summary>To be added.</summary>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
     <Member MemberName="AddPart">
       <MemberSignature Language="C#" Value="public void AddPart (Beagle.QueryPart part);" />
       <MemberType>Method</MemberType>
@@ -90,21 +60,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="AddSource">
-      <MemberSignature Language="C#" Value="public void AddSource (string str);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue>
-        <ReturnType>System.Void</ReturnType>
-      </ReturnValue>
-      <Parameters>
-        <Parameter Name="str" Type="System.String" />
-      </Parameters>
-      <Docs>
-        <param name="str">To be added.</param>
-        <summary>To be added.</summary>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
     <Member MemberName="AddText">
       <MemberSignature Language="C#" Value="public void AddText (string str);" />
       <MemberType>Method</MemberType>
@@ -136,54 +91,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="AllowsHitType">
-      <MemberSignature Language="C#" Value="public bool AllowsHitType (string str);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue>
-        <ReturnType>System.Boolean</ReturnType>
-      </ReturnValue>
-      <Parameters>
-        <Parameter Name="str" Type="System.String" />
-      </Parameters>
-      <Docs>
-        <param name="str">To be added.</param>
-        <summary>To be added.</summary>
-        <returns>To be added.</returns>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
-    <Member MemberName="AllowsMimeType">
-      <MemberSignature Language="C#" Value="public bool AllowsMimeType (string str);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue>
-        <ReturnType>System.Boolean</ReturnType>
-      </ReturnValue>
-      <Parameters>
-        <Parameter Name="str" Type="System.String" />
-      </Parameters>
-      <Docs>
-        <param name="str">To be added.</param>
-        <summary>To be added.</summary>
-        <returns>To be added.</returns>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
-    <Member MemberName="AllowsSource">
-      <MemberSignature Language="C#" Value="public bool AllowsSource (string str);" />
-      <MemberType>Method</MemberType>
-      <ReturnValue>
-        <ReturnType>System.Boolean</ReturnType>
-      </ReturnValue>
-      <Parameters>
-        <Parameter Name="str" Type="System.String" />
-      </Parameters>
-      <Docs>
-        <param name="str">To be added.</param>
-        <summary>To be added.</summary>
-        <returns>To be added.</returns>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
     <Member MemberName="ClearParts">
       <MemberSignature Language="C#" Value="public void ClearParts ();" />
       <MemberType>Method</MemberType>
@@ -207,52 +114,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="HasHitTypes">
-      <MemberSignature Language="C#" Value="public bool HasHitTypes { get; };" />
-      <MemberType>Property</MemberType>
-      <Attributes>
-        <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
-        </Attribute>
-      </Attributes>
-      <ReturnValue>
-        <ReturnType>System.Boolean</ReturnType>
-      </ReturnValue>
-      <Docs>
-        <summary>To be added.</summary>
-        <value>To be added.</value>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
-    <Member MemberName="HasMimeTypes">
-      <MemberSignature Language="C#" Value="public bool HasMimeTypes { get; };" />
-      <MemberType>Property</MemberType>
-      <ReturnValue>
-        <ReturnType>System.Boolean</ReturnType>
-      </ReturnValue>
-      <Docs>
-        <summary>To be added.</summary>
-        <value>To be added.</value>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
-    <Member MemberName="HasSources">
-      <MemberSignature Language="C#" Value="public bool HasSources { get; };" />
-      <MemberType>Property</MemberType>
-      <Attributes>
-        <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
-        </Attribute>
-      </Attributes>
-      <ReturnValue>
-        <ReturnType>System.Boolean</ReturnType>
-      </ReturnValue>
-      <Docs>
-        <summary>To be added.</summary>
-        <value>To be added.</value>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
     <Member MemberName="HitsAddedEvent">
       <MemberSignature Language="C#" Value="public event Beagle.Query.HitsAdded HitsAddedEvent;" />
       <MemberType>Event</MemberType>
@@ -275,26 +136,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="HitTypes">
-      <MemberSignature Language="C#" Value="public System.Collections.ArrayList HitTypes { get; };" />
-      <MemberType>Property</MemberType>
-      <Attributes>
-        <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlArray(ElementName="HitTypes")</AttributeName>
-        </Attribute>
-        <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlArrayItem(ElementName="HitType", Type=typeof(System.String))</AttributeName>
-        </Attribute>
-      </Attributes>
-      <ReturnValue>
-        <ReturnType>System.Collections.ArrayList</ReturnType>
-      </ReturnValue>
-      <Docs>
-        <summary>To be added.</summary>
-        <value>To be added.</value>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
     <Member MemberName="IsEmpty">
       <MemberSignature Language="C#" Value="public bool IsEmpty { get; };" />
       <MemberType>Property</MemberType>
@@ -336,26 +177,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="MimeTypes">
-      <MemberSignature Language="C#" Value="public System.Collections.ArrayList MimeTypes { get; };" />
-      <MemberType>Property</MemberType>
-      <Attributes>
-        <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlArray(ElementName="MimeTypes")</AttributeName>
-        </Attribute>
-        <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlArrayItem(ElementName="MimeType", Type=typeof(System.String))</AttributeName>
-        </Attribute>
-      </Attributes>
-      <ReturnValue>
-        <ReturnType>System.Collections.ArrayList</ReturnType>
-      </ReturnValue>
-      <Docs>
-        <summary>To be added.</summary>
-        <value>To be added.</value>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
     <Member MemberName="Parts">
       <MemberSignature Language="C#" Value="public System.Collections.ArrayList Parts { get; };" />
       <MemberType>Property</MemberType>
@@ -435,26 +256,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="Sources">
-      <MemberSignature Language="C#" Value="public System.Collections.ArrayList Sources { get; };" />
-      <MemberType>Property</MemberType>
-      <Attributes>
-        <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlArray(ElementName="Sources")</AttributeName>
-        </Attribute>
-        <Attribute>
-          <AttributeName>System.Xml.Serialization.XmlArrayItem(ElementName="Source", Type=typeof(System.String))</AttributeName>
-        </Attribute>
-      </Attributes>
-      <ReturnValue>
-        <ReturnType>System.Collections.ArrayList</ReturnType>
-      </ReturnValue>
-      <Docs>
-        <summary>To be added.</summary>
-        <value>To be added.</value>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
     <Member MemberName="StemmedText">
       <MemberSignature Language="C#" Value="public System.Collections.ICollection StemmedText { get; };" />
       <MemberType>Property</MemberType>
@@ -489,17 +290,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName="UnknownHostFoundEvent">
-      <MemberSignature Language="C#" Value="public event Beagle.Util.AvahiEventHandler UnknownHostFoundEvent;" />
-      <MemberType>Event</MemberType>
-      <ReturnValue>
-        <ReturnType>Beagle.Util.AvahiEventHandler</ReturnType>
-      </ReturnValue>
-      <Docs>
-        <summary>To be added.</summary>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
   </Members>
   <Docs>
     <summary>Represents a search query that can be asynchronously sent to the service.</summary>

Modified: branches/beagle-rdf/doc/api/BeagleClient/Beagle/SnippetList.xml
==============================================================================
--- branches/beagle-rdf/doc/api/BeagleClient/Beagle/SnippetList.xml	(original)
+++ branches/beagle-rdf/doc/api/BeagleClient/Beagle/SnippetList.xml	Thu Feb 14 22:56:49 2008
@@ -95,6 +95,23 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
+    <Member MemberName="Snippets">
+      <MemberSignature Language="C#" Value="public System.Collections.IEnumerable Snippets { get; };" />
+      <MemberType>Property</MemberType>
+      <Attributes>
+        <Attribute>
+          <AttributeName>System.Xml.Serialization.XmlIgnore</AttributeName>
+        </Attribute>
+      </Attributes>
+      <ReturnValue>
+        <ReturnType>System.Collections.IEnumerable</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
   </Members>
   <Docs>
     <summary>To be added.</summary>

Modified: branches/beagle-rdf/doc/api/BeagleClient/Beagle/Transport.xml
==============================================================================
--- branches/beagle-rdf/doc/api/BeagleClient/Beagle/Transport.xml	(original)
+++ branches/beagle-rdf/doc/api/BeagleClient/Beagle/Transport.xml	Thu Feb 14 22:56:49 2008
@@ -18,18 +18,6 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
-    <Member MemberName=".ctor">
-      <MemberSignature Language="C#" Value="public Transport (string id);" />
-      <MemberType>Constructor</MemberType>
-      <Parameters>
-        <Parameter Name="id" Type="System.String" />
-      </Parameters>
-      <Docs>
-        <param name="id">To be added.</param>
-        <summary>To be added.</summary>
-        <remarks>To be added.</remarks>
-      </Docs>
-    </Member>
     <Member MemberName="AsyncResponse">
       <MemberSignature Language="C#" Value="public event Beagle.Transport.AsyncResponseDelegate AsyncResponse;" />
       <MemberType>Event</MemberType>
@@ -257,6 +245,30 @@
         <remarks>To be added.</remarks>
       </Docs>
     </Member>
+    <Member MemberName=".ctor">
+      <MemberSignature Language="C#" Value="public Transport (bool local);" />
+      <MemberType>Constructor</MemberType>
+      <Parameters>
+        <Parameter Name="local" Type="System.Boolean" />
+      </Parameters>
+      <Docs>
+        <param name="local">To be added.</param>
+        <summary>To be added.</summary>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="IsLocal">
+      <MemberSignature Language="C#" Value="public bool IsLocal { get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.Boolean</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
   </Members>
   <Docs>
     <summary>To be added.</summary>

Modified: branches/beagle-rdf/doc/api/BeagleClient/index.xml
==============================================================================
--- branches/beagle-rdf/doc/api/BeagleClient/index.xml	(original)
+++ branches/beagle-rdf/doc/api/BeagleClient/index.xml	Thu Feb 14 22:56:49 2008
@@ -83,6 +83,17 @@
       <Type Name="QueryDomain" />
       <Type Name="QueryPartLogic" />
       <!-- Ignore <Type Name="RequestWrapper" /> -->
+      <Type Name="RequestWrapper" />
+      <Type Name="RequestMessageExecutor" />
+      <Type Name="RequestMessageAttribute" />
+      <Type Name="ResponseWrapper" />
+      <Type Name="RequestMessageTypesAttribute" />
+      <Type Name="ResponseMessageTypesAttribute" />
+      <Type Name="RequestMessageExecutorTypesAttribute" />
+      <Type Name="PropertyList" />
+      <Type Name="ISnippetReader" />
+      <Type Name="Versioned" />
+      <Type Name="RequestMessageExecutor+AsyncResponse" />
     </Namespace>
   </Types>
   <Title>BeagleClient</Title>

Modified: branches/beagle-rdf/firefox-extension/Makefile.am
==============================================================================
--- branches/beagle-rdf/firefox-extension/Makefile.am	(original)
+++ branches/beagle-rdf/firefox-extension/Makefile.am	Thu Feb 14 22:56:49 2008
@@ -1,33 +1,36 @@
 
 PROJECT = beagle
-VERSION = 1.0.1
+VERSION = 1.0.2
 
 all: $(PROJECT).xpi
 
 XPI_FILES = 			\
 	chrome.manifest		\
 	install.rdf		\
+	\
 	chrome/content/contents.rdf		\
-	chrome/content/beagleOverlay.js	\
+	chrome/content/beagleOverlay.js		\
 	chrome/content/beagleOverlay.xul	\
 	chrome/content/beaglePrefs.js		\
 	chrome/content/beaglePrefs.xul		\
 	chrome/content/beagleAddFilter.xul	\
 	chrome/content/beagleAddFilter.js	\
-	chrome/content/indexLink.xul	\
-	chrome/content/indexLink.js	\
-	chrome/content/indexBookmark.js	\
+	chrome/content/beagleSearch.js		\
+	chrome/content/indexLink.xul		\
+	chrome/content/indexLink.js		\
+	chrome/content/indexBookmark.js		\
 	chrome/content/md5.js			\
-	chrome/content/utils.js	\
-	chrome/content/i18n.js	\
-	chrome/content/json.js	\
+	chrome/content/utils.js			\
+	chrome/content/i18n.js			\
+	chrome/content/json.js			\
+	chrome/content/sidebar.xul		\
 	\
 	chrome/content/jslib/jslib.js		\
-	chrome/content/jslib/modules.js	\
+	chrome/content/jslib/modules.js		\
 	chrome/content/jslib/debug/debug.js	\
 	chrome/content/jslib/io/dir.js		\
 	chrome/content/jslib/io/dirUtils.js	\
-	chrome/content/jslib/io/file.js	\
+	chrome/content/jslib/io/file.js		\
 	chrome/content/jslib/io/fileUtils.js	\
 	chrome/content/jslib/io/filesystem.js	\
 	\
@@ -41,10 +44,11 @@
 	\
 	chrome/skin/classic/contents.rdf	\
 	chrome/skin/classic/beagle-big.png	\
-	chrome/skin/classic/beagle-disabled.png\
+	chrome/skin/classic/beagle-disabled.png	\
 	chrome/skin/classic/beagle-error.png	\
-	chrome/skin/classic/beagle.png\
-	chrome/skin/classic/overlay.css	
+	chrome/skin/classic/beagle.png		\
+	chrome/skin/classic/overlay.css		\
+	chrome/skin/classic/sidebar.css
 
 $(PROJECT).xpi: $(XPI_FILES)
 	zip -q9 $@ $^

Modified: branches/beagle-rdf/firefox-extension/README
==============================================================================
--- branches/beagle-rdf/firefox-extension/README	(original)
+++ branches/beagle-rdf/firefox-extension/README	Thu Feb 14 22:56:49 2008
@@ -29,6 +29,12 @@
 Localization:
 	Add your localization files to chrome/locale/your-language/ 
 
+Sidebar:
+	Since 0.3.3, included is a sidebar to search in the indexed webpages and bookmarks. The search returns the latest 20 results and marks the bookmarked webpages. Clicking on the results will open the links in a new tab.
+
 Visit http://beagle-project.org/Browser_Extension for details.
 This extension was written as a part of Google Summer of Code project, 2007 by Tao Fei (filia tao gmail com).
 
+Changelog:
+    1.0.1 - initial version
+    1.0.2 - added sidebar

Modified: branches/beagle-rdf/firefox-extension/chrome/content/beagleOverlay.js
==============================================================================
--- branches/beagle-rdf/firefox-extension/chrome/content/beagleOverlay.js	(original)
+++ branches/beagle-rdf/firefox-extension/chrome/content/beagleOverlay.js	Thu Feb 14 22:56:49 2008
@@ -212,7 +212,7 @@
         if(storage_directory == "")
             storage_directory = this.ENV.get("HOME") + "/.beagle";
         if (!this.FILE_UTILS.exists (storage_directory)) {
-            alert(_("beagle_check_env_error"));
+            alert(_f("beagle_check_env_error",[storage_directory]));
             return false;
         }
         this.dataPath = storage_directory + "/ToIndex";
@@ -421,6 +421,13 @@
         {
             meta.push("t:fixme:referrer=" + page.referrer);
         }
+
+	// Tokenize the url
+	var loc = page.location;
+	var url_tokenized = loc.host + " " + loc.port + " " + loc.pathname + " " + loc.hash + " " + loc.search;
+	url_tokenized = url_tokenized.replace(/\./g, " ").replace(/\//g, " ").replace(/&/g, " ").replace (/\+/g, " ").replace (/=/g, " ").replace(/%../g, " ");
+	meta.push("t:beagle:inuri=" + url_tokenized);
+
         meta = meta.concat(this.tasks[url]['meta'])
         beagle.writeRawMetadata(meta,tmpfilepath);
     },

Modified: branches/beagle-rdf/firefox-extension/chrome/content/beagleOverlay.xul
==============================================================================
Binary files. No diff available.

Modified: branches/beagle-rdf/firefox-extension/chrome/content/beaglePrefs.xul
==============================================================================
Binary files. No diff available.

Modified: branches/beagle-rdf/firefox-extension/chrome/locale/en-US/beagle.dtd
==============================================================================
--- branches/beagle-rdf/firefox-extension/chrome/locale/en-US/beagle.dtd	(original)
+++ branches/beagle-rdf/firefox-extension/chrome/locale/en-US/beagle.dtd	Thu Feb 14 22:56:49 2008
@@ -36,3 +36,7 @@
 
 <!ENTITY beagle.bookmark.index.modified.label       "Index The Modified Bookmarks">
 
+<!ENTITY beagle.sidebar.title "Beagle Search History Sidebar">
+<!ENTITY beagle.sidebar.commandkey "B">
+<!ENTITY beagle.sidebar.modifierskey "shift accel">
+

Modified: branches/beagle-rdf/firefox-extension/chrome/locale/en-US/beagle.properties
==============================================================================
--- branches/beagle-rdf/firefox-extension/chrome/locale/en-US/beagle.properties	(original)
+++ branches/beagle-rdf/firefox-extension/chrome/locale/en-US/beagle.properties	Thu Feb 14 22:56:49 2008
@@ -4,7 +4,7 @@
 beagle_tooltip_error=Beagle indexing error: %S
 beagle_not_found=beagle not found
 beagle_run_error=beagle run error
-beagle_check_env_error=Beagle storage directory not found.\nPlease set beagle.storage.directory in about:config to corresponding direcotry.
+beagle_check_env_error="%S" is not accessible. Generally beagled needs to be running for this extension to work. If you have beagled with a different BEAGLE_HOME, set the variable beagle.storage.directory in about:config.
 beagle_write_error_confirm=Fail to write content/metadata.\n Would you like to disable beagle now ?
 beagle_statuslabel_indexing=beagle is indexing %S
 beagle_index_link_connect=Connecting ... %S

Modified: branches/beagle-rdf/firefox-extension/chrome/locale/zh-CN/beagle.properties
==============================================================================
--- branches/beagle-rdf/firefox-extension/chrome/locale/zh-CN/beagle.properties	(original)
+++ branches/beagle-rdf/firefox-extension/chrome/locale/zh-CN/beagle.properties	Thu Feb 14 22:56:49 2008
@@ -4,7 +4,7 @@
 beagle_tooltip_error=åçéè: %S
 beagle_not_found=æææåBeagle 
 beagle_run_error=Beagle èèéè
-beagle_check_env_error=æææåBeagle ååçå.\n èåabout:config äåbeagle.storage.directoryèçäåéçå.
+beagle_check_env_error=ææèé%S. äèæåäææåéèbeagledèèæèæååäãåææçbeagledäåääBEAGLE_HOMEèè èåabout:configäèç beagle.storage.directory
 beagle_write_error_confirm=ååååååææéè.\n æåççèåçå?
 beagle_statuslabel_indexing=Beagle æåçå %S
 beagle_index_link_connect=èæ ... %S

Modified: branches/beagle-rdf/firefox-extension/install.rdf
==============================================================================
Binary files. No diff available.

Modified: branches/beagle-rdf/glue/spawn-glue.c
==============================================================================
--- branches/beagle-rdf/glue/spawn-glue.c	(original)
+++ branches/beagle-rdf/glue/spawn-glue.c	Thu Feb 14 22:56:49 2008
@@ -54,6 +54,7 @@
 
 void
 spawn_async_with_pipes_and_limits (char   **argv,
+				   char   **envp,
 				   int      cpu_limit,
 				   int      mem_limit,
 				   GPid    *child_pid,
@@ -77,7 +78,7 @@
 
 	g_spawn_async_with_pipes (NULL,
 				  argv,
-				  NULL,
+				  envp,
 				  flag,
 				  limit_setup_func,
 				  &info,

Modified: branches/beagle-rdf/glue/xdgmime/README
==============================================================================
--- branches/beagle-rdf/glue/xdgmime/README	(original)
+++ branches/beagle-rdf/glue/xdgmime/README	Thu Feb 14 22:56:49 2008
@@ -17,6 +17,8 @@
 all of which are fixed in the GTK+ copy and none of which are fixed in the
 upstream copy: #5241, #6824, #7496, #9544, #9560.
 
+xdgmimecache.c contains a fix for bugs.freedesktop.org #12512 which is not present in the GTK+ copy.
+
 Joe Shaw  <joeshaw novell com>
 12 Septermber 2006
 

Modified: branches/beagle-rdf/glue/xdgmime/xdgmimecache.c
==============================================================================
--- branches/beagle-rdf/glue/xdgmime/xdgmimecache.c	(original)
+++ branches/beagle-rdf/glue/xdgmime/xdgmimecache.c	Thu Feb 14 22:56:49 2008
@@ -297,7 +297,7 @@
 	  for (n = 0; n < n_mime_types; n++)
 	    {
 	      if (mime_types[n] && 
-		  xdg_mime_mime_type_equal (mime_types[n], non_match))
+		  _xdg_mime_mime_type_equal (mime_types[n], non_match))
 		mime_types[n] = NULL;
 	    }
 	}

Modified: branches/beagle-rdf/po/POTFILES.in
==============================================================================
--- branches/beagle-rdf/po/POTFILES.in	(original)
+++ branches/beagle-rdf/po/POTFILES.in	Thu Feb 14 22:56:49 2008
@@ -1,69 +1,69 @@
 # 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/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/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/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/F-Spot/Exif.cs
-Util/F-Spot/IptcFile.cs
-Util/F-Spot/MetadataStore.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/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-rdf/po/POTFILES.skip
==============================================================================
--- branches/beagle-rdf/po/POTFILES.skip	(original)
+++ branches/beagle-rdf/po/POTFILES.skip	Thu Feb 14 22:56:49 2008
@@ -1,5 +1,8 @@
-epiphany-extension/beagle.py
 beagled/DumpIndex.cs
+epiphany-extension/beagle.py
 search/beagle-search.desktop.in
 tools/beagle-settings.desktop.in
 Util/DigikamTags.cs
+Util/F-Spot/Exif.cs
+Util/F-Spot/IptcFile.cs
+Util/F-Spot/MetadataStore.cs

Modified: branches/beagle-rdf/search/Makefile.am
==============================================================================
--- branches/beagle-rdf/search/Makefile.am	(original)
+++ branches/beagle-rdf/search/Makefile.am	Thu Feb 14 22:56:49 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,81 +28,70 @@
 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/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/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/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/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		\
@@ -108,12 +100,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@
 
@@ -142,10 +148,7 @@
 	rm -f $(DESTDIR)$(bindir)/beagle-search
 
 EXTRA_DIST =			\
-	$(CSFILES)		\
-	$(TILES)		\
-	$(PAGES)		\
-	$(TRAY)			\
+	$(SOURCES)		\
 	$(man_MANS)		\
 	$(desktop_DATA).in	\
 	$(autostart_DATA)	\
@@ -153,8 +156,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-rdf/search/beagle-search-autostart.desktop
==============================================================================
--- branches/beagle-rdf/search/beagle-search-autostart.desktop	(original)
+++ branches/beagle-rdf/search/beagle-search-autostart.desktop	Thu Feb 14 22:56:49 2008
@@ -6,4 +6,3 @@
 StartupNotify=false
 X-KDE-autostart-phase=2
 X-KDE-autostart-after=panel
-X-GNOME-Autostart-enabled=false

Modified: branches/beagle-rdf/search/beagle-search.1
==============================================================================
--- branches/beagle-rdf/search/beagle-search.1	(original)
+++ branches/beagle-rdf/search/beagle-search.1	Thu Feb 14 22:56:49 2008
@@ -16,6 +16,9 @@
 .B --icon
 Add an icon to the notification area rather than opening a search window.
 .TP
+.B --search-docs
+Also search the system-wide documentation index.
+.TP
 .B --help
 Display a summary of command-line options
 .SH AUTHOR

Modified: branches/beagle-rdf/search/beagle-search.in
==============================================================================
--- branches/beagle-rdf/search/beagle-search.in	(original)
+++ branches/beagle-rdf/search/beagle-search.in	Thu Feb 14 22:56:49 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="../BeagleClient:../images:../Util${MONO_PATH+:MONO_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-rdf/tools/Config.cs
==============================================================================
--- branches/beagle-rdf/tools/Config.cs	(original)
+++ branches/beagle-rdf/tools/Config.cs	Thu Feb 14 22:56:49 2008
@@ -64,6 +64,19 @@
 			"  --beagled-reload-config\tAsk the beagle daemon to reload\n" +
 			"                         \tthe configuration file.\n" +
 			"  --list-backends\t\tList the available backends.\n" +
+			"\n" +
+			"  Xml based operations:\n" +
+			"  The following two methods can be used by non-C# programs to\n" +
+			"  read and set config options.\n" +
+			"  --write-xml SECTION\t\tPrint the section in xml format.\n" +
+			"                     \t\tSuitable for parsing by other programs.\n" +
+			"  --read-xml SECTION\t\tReads the xml of a section from stdin.\n" +
+			"                    \t\tSuitable for setting options by other programs.\n" +
+			"  In case of any error, the following error codes are returned:\n" +
+			"     1 : Bad section name\n" +
+			"     2 : Invalid xml\n" +
+			"     3 : Xml does not correspond to the section name\n" +
+			"\n" +
 			"  --help\t\t\tPrint this usage message.\n" +
 			"  --version\t\t\tPrint version information.\n\n";
 
@@ -156,7 +169,7 @@
 		for (int i = 0; i < args.Length; i ++) {
 			switch (args [i]) {
 			case "--list-sections":
-				ListSectionsAndExit ();
+				ListSections ();
 				return;
 
 			case "--list-backends":
@@ -165,7 +178,19 @@
 
 			case "--reload":
 			case "--beagled-reload-config":
-				ReloadConfigAndExit ();
+				ReloadConfig ();
+				return;
+
+			case "--write-xml":
+				if (args.Length == i + 1)
+					PrintUsageAndExit ();
+				PrintSectionXml (args [i + 1]);
+				return;
+
+			case "--read-xml":
+				if (args.Length == i + 1)
+					PrintUsageAndExit ();
+				ReadSectionXml (args [i + 1]);
 				return;
 
 			case "--help":
@@ -183,6 +208,9 @@
 			}
 		}
 
+		if (args [0].StartsWith ("--"))
+			PrintUsageAndExit ();
+
 		Config config = Conf.Load (args [0]);
 
 		if (config == null) {
@@ -205,7 +233,7 @@
 			ShowOption (config, option);
 	}
 
-	private static void ListSectionsAndExit ()
+	private static void ListSections ()
 	{
 		string global_dir = Path.Combine (Path.Combine (ExternalStringsHack.SysConfDir, "beagle"), "config-files");
 		string local_dir = Path.Combine (PathFinder.StorageDir, "config");
@@ -224,17 +252,23 @@
 			local_configs = new string [0];
 		}
 
+		for (int i = 0; i < global_configs.Length; ++ i)
+			global_configs [i] = Path.GetFileNameWithoutExtension (global_configs [i]);
+
+		for (int i = 0; i < local_configs.Length; ++ i)
+			local_configs [i] = Path.GetFileNameWithoutExtension (local_configs [i]);
+
 		Console.WriteLine ("Available sections:");
 		foreach (string file in global_configs)
-			Console.WriteLine (" - {0}", Path.GetFileNameWithoutExtension (file));
+			Console.WriteLine (" - {0}", file);
 
 		foreach (string file in local_configs)
 			if (Array.IndexOf (global_configs, file) == -1)
-				Console.WriteLine (" - {0}", Path.GetFileNameWithoutExtension (file));
+				Console.WriteLine (" - {0}", file);
 
 	}
 
-	private static void ReloadConfigAndExit ()
+	private static void ReloadConfig ()
 	{
 		try {
 			ReloadConfigRequest request = new ReloadConfigRequest ();
@@ -246,7 +280,74 @@
 			System.Environment.Exit (-1);
 		}
 	}
-		
+
+	const int ERROR_CONFIG_NO_SECTION = 1; // Bad section name
+	const int ERROR_CONFIG_XML = 2; // Invalid xml
+	const int ERROR_CONFIG_BAD = 3; // Xml does not correspond to the right config
+	const int ERROR_CONFIG_LOAD = 4; // Error in loading config
+	const int ERROR_CONFIG_SAVE = 5; // Error in saving config
+
+	private static void PrintSectionXml (string section)
+	{
+		Log.Level = LogLevel.Always; // shhhh... silence
+
+		Config config = null;
+		try {
+			config = Conf.Load (section);
+		} catch {
+			System.Environment.Exit (ERROR_CONFIG_LOAD);
+		}
+
+		if (config == null) {
+			System.Environment.Exit (ERROR_CONFIG_NO_SECTION);
+		}
+
+		try {
+			Conf.WriteSectionXml (config, Console.Out);
+		} catch {
+			System.Environment.Exit (ERROR_CONFIG_XML);
+		}
+
+		System.Environment.Exit (0);
+	}
+
+	private static void ReadSectionXml (string section)
+	{
+		Log.Level = LogLevel.Always; // shhhh... silence
+
+		Config config = null;
+		try {
+			config = Conf.Load (section);
+		} catch {
+			System.Environment.Exit (ERROR_CONFIG_LOAD);
+		}
+
+		if (config == null) {
+			System.Environment.Exit (ERROR_CONFIG_NO_SECTION);
+		}
+
+		try {
+			if (! Conf.ReadSectionXml (config, Console.In))
+				System.Environment.Exit (ERROR_CONFIG_BAD);
+		} catch (System.Xml.XmlException) {
+			System.Environment.Exit (ERROR_CONFIG_XML);
+		} catch (Exception) {
+			System.Environment.Exit (ERROR_CONFIG_BAD);
+		}
+
+		//Console.WriteLine ("Successfully read config for {0}", section);
+		//Conf.WriteSectionXml (config, Console.Out);
+		//Console.WriteLine ();
+
+		try {
+			Conf.Save (config);
+		} catch {
+			System.Environment.Exit (ERROR_CONFIG_SAVE);
+		}
+
+		System.Environment.Exit (0);
+	}
+
 	private static bool HandleArgs (Config config, string[] args)
 	{
 		Option option = (Option) config.Options [args [1]];

Modified: branches/beagle-rdf/tools/Makefile.am
==============================================================================
--- branches/beagle-rdf/tools/Makefile.am	(original)
+++ branches/beagle-rdf/tools/Makefile.am	Thu Feb 14 22:56:49 2008
@@ -6,7 +6,7 @@
 	../Util/Util.dll		\
 	../BeagleClient/Beagle.dll	\
 	../beagled/BeagleDaemonPlugins.dll \
-	../beagled/BeagleDaemonLib.dll
+	../beagled/BeagleDaemonLib.dll	
 
 ASSEMBLIES =				\
 	$(BEAGLED_LIBS)			\
@@ -35,24 +35,6 @@
 
 crondir = $(sysconfdir)/cron.daily
 
-CRAWL_RULES = \
-	$(srcdir)/crawl-rules/crawl-windows		\
-	$(srcdir)/crawl-rules/crawl-applications	\
-	$(srcdir)/crawl-rules/crawl-documentation
-
-# FIXME: Per-distribution specific crawl rules
-configdir = $(sysconfdir)/beagle
-config_DATA = $(CRAWL_RULES)
-
-GLOBAL_CONFIG_FILES = \
-	$(srcdir)/config-files/BeagleSearch.xml		\
-	$(srcdir)/config-files/Daemon.xml		\
-	$(srcdir)/config-files/FilesQueryable.xml	\
-	$(srcdir)/config-files/Networking.xml
-
-global_config_filesdir = $(sysconfdir)/beagle/config-files
-global_config_files_DATA = $(GLOBAL_CONFIG_FILES)
-
 DOC_EXTRACTOR_TARGET  = DocExtractor.exe
 DOC_EXTRACTOR_WRAPPER = beagle-doc-extractor
 DOC_EXTRACTOR_CSFILES = $(srcdir)/DocExtractor.cs
@@ -127,6 +109,24 @@
 	$(WRAPPER_SED) -e "s|\ target\@|$(SETTINGS_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
 	chmod +x $(SETTINGS_WRAPPER)
 
+QT_SETTINGS_TARGET = SettingsQt.exe
+QT_SETTINGS_WRAPPER = beagle-settings-qt
+QT_SETTINGS_CSFILES = $(srcdir)/SettingsQt.cs
+QT_SETTINGS_UIFILE = $(srcdir)/beagle-settings-qt.ui
+QT_SETTINGS_UI_CSFILE = $(srcdir)/beagle-settings-qt.cs
+QT_SETTINGS_ASSEMBLIES = -r:../Util/Util.dll -pkg:qyoto
+QT_SETTINGS_ICON = $(srcdir)/kerry.png
+
+$(QT_SETTINGS_UI_CSFILE): $(QT_SETTINGS_UIFILE)
+	uics $(QT_SETTINGS_UIFILE) -o $@
+
+$(QT_SETTINGS_TARGET): $(QT_SETTINGS_CSFILES) $(QT_SETTINGS_UI_CSFILE) $(LOCAL_ASSEMBLIES)
+	$(CSC) -out:$@ $(CSFLAGS) $(QT_SETTINGS_CSFILES) $(QT_SETTINGS_UI_CSFILE) $(ASSEMBLIES) $(QT_SETTINGS_ASSEMBLIES)
+
+$(QT_SETTINGS_WRAPPER): $(WRAPPER_IN)
+	$(WRAPPER_SED) -e "s|\ target\@|$(QT_SETTINGS_TARGET)|g" < $(srcdir)/$(WRAPPER_IN) > $@
+	chmod +x $(QT_SETTINGS_WRAPPER)
+
 TARGETS = 				\
 	$(INFO_TARGET)			\
 	$(SHUTDOWN_TARGET)		\
@@ -137,6 +137,10 @@
 TARGETS += $(SETTINGS_TARGET)
 endif
 
+if ENABLE_QT
+TARGETS += $(QT_SETTINGS_TARGET)
+endif
+
 if ENABLE_WV1
 TARGETS += $(DOC_EXTRACTOR_TARGET)
 endif
@@ -157,6 +161,10 @@
 BUILT_WRAPPERS += $(DOC_EXTRACTOR_WRAPPER)
 endif
 
+if ENABLE_QT
+BUILT_WRAPPERS += $(QT_SETTINGS_WRAPPER)
+endif
+
 PREBUILT_WRAPPERS =		\
 	beagle-index-info	\
 	beagle-ping		\
@@ -230,11 +238,12 @@
 	$(SETTINGS_CSFILES)		\
 	$(SETTINGS_RESOURCES)		\
 	$(man_MANS)			\
-	$(CRAWL_RULES)			\
-	$(GLOBAL_CONFIG_FILES)		\
 	$(cron_SCRIPTS)			\
 	$(desktop_in_files)		\
 	$(desktop_DATA) 		\
+	$(QT_SETTINGS_CSFILES)		\
+	$(QT_SETTINGS_UIFILE)		\
+	$(QT_SETTINGS_ICON)		\
 	beagle-index-info		\
 	beagle-ping			\
 	beagle-status			\
@@ -248,6 +257,7 @@
 	$(CRAWL_WRAPPER)		\
 	$(desktop_DATA)		 	\
 	$(desktop_h_files)		\
+	$(QT_SETTINGS_UI_CSFILE)	\
 	settings.glade.h
 
 

Modified: branches/beagle-rdf/tools/Query.cs
==============================================================================
--- branches/beagle-rdf/tools/Query.cs	(original)
+++ branches/beagle-rdf/tools/Query.cs	Thu Feb 14 22:56:49 2008
@@ -194,46 +194,6 @@
 		System.Environment.Exit (0);
 	}
 
-	private static void ReadBackendMappings ()
-	{
-		ArrayList assemblies = ReflectionFu.ScanEnvironmentForAssemblies ("BEAGLE_BACKEND_PATH", PathFinder.BackendDir);
-
-		// Add BeagleDaemonLib if it hasn't already been added.
-		bool found_daemon_lib = false;
-		foreach (Assembly assembly in assemblies) {
-			if (assembly.GetName ().Name == "BeagleDaemonLib") {
-				found_daemon_lib = true;
-				break;
-			}
-		}
-
-		if (!found_daemon_lib) {
-			try {
-				assemblies.Add (Assembly.LoadFrom (Path.Combine (PathFinder.PkgLibDir, "BeagleDaemonLib.dll")));
-			} catch (FileNotFoundException) {
-				Console.WriteLine ("WARNING: Could not find backend list.");
-				Environment.Exit (1);
-			}
-		}
-
-		foreach (Assembly assembly in assemblies) {
-			foreach (Type type in ReflectionFu.GetTypesFromAssemblyAttribute (assembly, typeof (IQueryableTypesAttribute))) {
-				object[] attributes = type.GetCustomAttributes (false);
-				foreach (object attribute in attributes) {
-					PropertyKeywordMapping mapping = attribute as PropertyKeywordMapping;
-					if (mapping == null)
-						continue;
-					//Logger.Log.Debug (mapping.Keyword + " => " 
-					//		+ mapping.PropertyName + 
-					//		+ " is-keyword=" + mapping.IsKeyword + " (" 
-					//		+ mapping.Description + ") "
-					//		+ "(" + type.FullName + ")");
-					PropertyKeywordFu.RegisterMapping (mapping);
-				}
-			}
-		}
-	}
-
 	private static void OnClosed ()
 	{
 		if (flood)
@@ -314,17 +274,16 @@
 				keep_running = true;
 				break;
 			case "--keywords":
-				ReadBackendMappings ();
-				QueryDriver.ReadKeywordMappings ();
+				PropertyKeywordFu.ReadKeywordMappings ();
 
 				Console.WriteLine ("Supported query keywords are:");
 
 				foreach (string key in PropertyKeywordFu.Keys) {
-					foreach (PropertyDetail prop in PropertyKeywordFu.Properties (key)) {
+					foreach (QueryKeywordMapping mapping in PropertyKeywordFu.Properties (key)) {
 						// Dont print properties without description; they confuse people
-						if (string.IsNullOrEmpty (prop.Description))
+						if (string.IsNullOrEmpty (mapping.Description))
 							continue;
-						Console.WriteLine ("  {0,-20} for {1}", key, prop.Description);
+						Console.WriteLine ("  {0,-20} for {1}", key, mapping.Description);
 					}
 				}
 

Modified: branches/beagle-rdf/tools/Settings.cs
==============================================================================
--- branches/beagle-rdf/tools/Settings.cs	(original)
+++ branches/beagle-rdf/tools/Settings.cs	Thu Feb 14 22:56:49 2008
@@ -421,11 +421,9 @@
 		reader.Close ();
 
 		if (! enabled) {
-			// FIXME: gnome-session has a bug in which autostart overrides
-			// break if Hidden=true is set.
-			writer.WriteLine ("# FIXME: Hidden=true has to be commented out for GNOME autostart to be");
-			writer.WriteLine ("# disabled, but KDE requires it to disable autostart.");
-			writer.WriteLine ("#Hidden=true");
+			writer.WriteLine ("# Setting Hidden=true unintuitively disables autostart on KDE and");
+			writer.WriteLine ("# GNOME >= 2.19.2, but it breaks disabling of autostart in older GNOME.");
+			writer.WriteLine ("Hidden=true");
 			writer.WriteLine ("X-GNOME-Autostart-enabled=false");
 		}
 
@@ -439,11 +437,9 @@
 		reader.Close ();
 
 		if (! enabled) {
-			// FIXME: gnome-session has a bug in which autostart overrides
-			// break if Hidden=true is set.
-			writer.WriteLine ("# FIXME: Hidden=true has to be commented out for GNOME autostart to be");
-			writer.WriteLine ("# disabled, but KDE requires it to disable autostart.");
-			writer.WriteLine ("#Hidden=true");
+			writer.WriteLine ("# Setting Hidden=true unintuitively disables autostart on KDE and");
+			writer.WriteLine ("# GNOME >= 2.19.2, but it breaks disabling of autostart in older GNOME.");
+			writer.WriteLine ("Hidden=true");
 			writer.WriteLine ("X-GNOME-Autostart-enabled=false");
 		}
 
@@ -887,14 +883,14 @@
 			column.Title = Catalog.GetString ("Name");
 			CellRendererText renderer = new CellRendererText ();
 			column.PackStart (renderer, true);
-			column.SetCellDataFunc (renderer, NameCellFunc);
+			column.SetCellDataFunc (renderer, new TreeCellDataFunc (NameCellFunc));
 			AppendColumn (column);
 
                         column = new TreeViewColumn ();
                         column.Title = Catalog.GetString ("Address");
                         renderer = new CellRendererText ();
                         column.PackStart (renderer, true);
-                        column.SetCellDataFunc (renderer, AddressCellFunc);
+                        column.SetCellDataFunc (renderer, new TreeCellDataFunc (AddressCellFunc));
                         AppendColumn (column);
 		
 		}
@@ -1584,7 +1580,13 @@
 			"NetworkServices", // This should be configurable in the network tab
 			"Opera",
 			"Pidgin",
-			"Tomboy"
+			"Tomboy",
+			/* System-wide indexes */
+			"applications",
+			"documentation",
+			"manpages",
+			"monodoc",
+			"windows"
 		};
 
 		private string[] descriptions = new string[] {
@@ -1608,7 +1610,13 @@
 			"Search other search services in the network (EXPERIMENTAL)",
 			"Opera's bookmarks and browsing history.",
 			"IMs and chats from Pidgin.",
-			"Notes from Tomboy."
+			"Notes from Tomboy.",
+			/* System-wide indexes */
+			"(System) Applications",
+			"(System) Help files",
+			"(System) Manual pages",
+			"(System) Mono documentation",
+			"(System) Files from Windows' partition"
 		};
 
 		public BackendView ()

Modified: branches/beagle-rdf/tools/beagle-crawl-system.in
==============================================================================
--- branches/beagle-rdf/tools/beagle-crawl-system.in	(original)
+++ branches/beagle-rdf/tools/beagle-crawl-system.in	Thu Feb 14 22:56:49 2008
@@ -45,11 +45,11 @@
 MONO_SHARED_DIR=`mktemp -d -p $TMPDIR .beagleindexwapi.XXXXXXXXXX`|| ( echo "$0: Can't create wapi directory!" ; exit 1 )
 chown $CRAWL_USER $MONO_SHARED_DIR
 
-for crawl_file in @sysconfdir@/beagle/crawl-*; do
-    unset CRAWL_ENABLED CRAWL_DISABLE_FILTERING CRAWL_RECURSIVE CRAWL_CACHE_TEXT CRAWL_ALLOW_PATTERNS CRAWL_DENY_PATTERNS CRAWL_PATHS CRAWL_INDEX_NAME
+for crawl_file in @sysconfdir@/beagle/crawl-rules/crawl-*; do
+    unset CRAWL_ENABLED CRAWL_DISABLE_FILTERING CRAWL_DISABLE_DIRECTORIES CRAWL_DISABLE_ON_BATTERY CRAWL_RECURSIVE CRAWL_CACHE_TEXT CRAWL_ALLOW_PATTERNS CRAWL_DENY_PATTERNS CRAWL_PATHS CRAWL_INDEX_NAME CRAWL_REMOVE_DELETED_FILES
 
     if [ "$DEBUG" = "1" ]; then
-	echo "$0: Processing files in @sysconfdir@/beagle..."
+	echo "$0: Processing files in @sysconfdir@/beagle/crawl-rules/..."
     fi
 
     if [ -f $crawl_file ] ; then
@@ -82,6 +82,9 @@
 	    OPTIONS="$OPTIONS `test -n "$CRAWL_DENY_PATTERNS" && \
                      echo --deny-pattern $CRAWL_DENY_PATTERNS`"
 	    
+	    OPTIONS="$OPTIONS `test -n "$CRAWL_REMOVE_DELETED_FILES" && \
+                     echo --enable-deletion`"
+	    
 	    IONICE=`which ionice 2>/dev/null`
             if [ -n "$IONICE" ]; then
                 IONICE="$IONICE -c 3"

Modified: branches/beagle-rdf/tools/wrapper.in
==============================================================================
--- branches/beagle-rdf/tools/wrapper.in	(original)
+++ branches/beagle-rdf/tools/wrapper.in	Thu Feb 14 22:56:49 2008
@@ -17,6 +17,11 @@
     THIS_EXE="$TOOLDIR/@target@"
     THIS_FILTERS="$TOOLDIR/../Filters"
     THIS_BACKENDS="$TOOLDIR/../beagled"
+
+    if [ -z $BEAGLE_CONF_DIR ]; then
+	    export BEAGLE_CONF_DIR="../conf-data"
+    fi
+
 else
     THIS_LIB_DIR="@pkglibdir@:@libdir@"
     THIS_PATH="@pkglibdir@:@libdir@"



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