public OperaIndexableGenerator(OperaIndexer indexer, string cache_dir)
        {
            this.cache_dir = cache_dir;
            this.indexer   = indexer;
            if (history != null && history.GetLastRead() >= Directory.GetLastWriteTime(cache_dir))
            {
                history_enumerator = history.GetEnumerator();
                return;
            }
            try {
                history = new OperaHistory(Path.Combine(cache_dir, "dcache4.url"));

                history_enumerator = history.GetEnumerator();
            } catch (Exception e) {
                Logger.Log.Error(e, "Failed to list cache objects in {0}",
                                 Path.Combine(cache_dir, "dcache4.url"));
            }
        }
		public OperaIndexableGenerator(OperaIndexer indexer, string cache_dir)
		{
			this.cache_dir = cache_dir;
			this.indexer = indexer;
			if(history != null && history.GetLastRead() >= Directory.GetLastWriteTime(cache_dir)){
				history_enumerator = history.GetEnumerator();
				return;
			}
			try {
				history = new OperaHistory (Path.Combine (cache_dir, "dcache4.url"));

				history_enumerator = history.GetEnumerator ();
				
			} catch (Exception e) {
				Logger.Log.Error (e, "Failed to list cache objects in {0}", 
					Path.Combine (cache_dir, "dcache4.url"));
			}
		}
		private void StartWorker ()
		{
			if (!Directory.Exists (root_dir)) {
				GLib.Timeout.Add (60000, new GLib.TimeoutHandler (CheckForExistence));
				return;
			}
			
			Logger.Log.Info ("Starting Opera history backend");
			Stopwatch watch = new Stopwatch ();
			watch.Start ();
			
			//State = QueryableState.Crawling;
			indexer = new OperaIndexer (this, this.FileAttributesStore, root_dir);
			indexer.Crawl ();
			//State = QueryableState.Idle;
			
			watch.Stop ();
			Logger.Log.Info ("Opera history backend done in {0}s", watch.ElapsedTime);
		}
        private void StartWorker()
        {
            if (!Directory.Exists(root_dir))
            {
                GLib.Timeout.Add(60000, new GLib.TimeoutHandler(CheckForExistence));
                return;
            }

            Logger.Log.Info("Starting Opera history backend");
            Stopwatch watch = new Stopwatch();

            watch.Start();

            //State = QueryableState.Crawling;
            indexer = new OperaIndexer(this, this.FileAttributesStore, root_dir);
            indexer.Crawl();
            //State = QueryableState.Idle;

            watch.Stop();
            Logger.Log.Info("Opera history backend done in {0}s", watch.ElapsedTime);
        }