Handle the situation where no evolution mail data is available. Index: beagled/EvolutionMailDriver/EvolutionMailDriver.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/EvolutionMailDriver/EvolutionMailDriver.cs,v retrieving revision 1.35 diff -u -B -r1.35 EvolutionMailDriver.cs --- beagled/EvolutionMailDriver/EvolutionMailDriver.cs 20 Feb 2005 20:24:06 -0000 1.35 +++ beagled/EvolutionMailDriver/EvolutionMailDriver.cs 23 Feb 2005 22:35:08 -0000 @@ -42,6 +42,7 @@ public int polling_interval_in_seconds = 60; public static Logger log = Logger.Get ("mail"); + private string local_path, imap_path; private SortedList watched = new SortedList (); private MailCrawler crawler; @@ -52,6 +53,8 @@ public EvolutionMailQueryable () : base ("MailIndex") { + local_path = Path.Combine (PathFinder.HomeDir, ".evolution/mail/local"); + imap_path = Path.Combine (PathFinder.HomeDir, ".evolution/mail/imap"); } private void Crawl () @@ -77,8 +80,13 @@ Stopwatch stopwatch = new Stopwatch (); stopwatch.Start (); - string local_path = Path.Combine (PathFinder.HomeDir, ".evolution/mail/local"); - string imap_path = Path.Combine (PathFinder.HomeDir, ".evolution/mail/imap"); + // Check that we have data to index + if ((! Directory.Exists (local_path)) && (! Directory.Exists (imap_path))) { + // No mails present, repoll every minute + log.Warn ("Evolution mail store not found, watching for it."); + GLib.Timeout.Add (60000, new GLib.TimeoutHandler (CheckForMailData)); + return; + } // Get notification when an index or summary file changes if (Inotify.Enabled) { @@ -177,6 +185,16 @@ break; } + } + + private bool CheckForMailData () + { + if ((! Directory.Exists (local_path)) && (! Directory.Exists (imap_path))) + return true; // continue polling + + // Otherwise stop polling and start indexing + StartWorker(); + return false; } public string Name { Index: beagled/EvolutionMailDriver/MailCrawler.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/EvolutionMailDriver/MailCrawler.cs,v retrieving revision 1.1 diff -u -B -r1.1 MailCrawler.cs --- beagled/EvolutionMailDriver/MailCrawler.cs 20 Feb 2005 20:24:07 -0000 1.1 +++ beagled/EvolutionMailDriver/MailCrawler.cs 23 Feb 2005 22:35:08 -0000 @@ -46,8 +46,10 @@ string local_path = Path.Combine (PathFinder.HomeDir, ".evolution/mail/local"); string imap_path = Path.Combine (PathFinder.HomeDir, ".evolution/mail/imap"); - roots.Add (local_path); - roots.Add (imap_path); + if (Directory.Exists (local_path)) + roots.Add (local_path); + if (Directory.Exists (imap_path)) + roots.Add (imap_path); } private bool FileIsInteresting (FileInfo file)