コード例 #1
0
		public KMaildirIndexableGenerator (KMailIndexer indexer, ArrayList mail_directories)
		{
			this.indexer = indexer;
			this.indexer.Progress = 0;
			this.indexer.Queryable.Indexing = true;

			dirs_to_scan = new ArrayList ();

			foreach (string directory in mail_directories) {
				AddDirectory (directory);
			}
			dir_enumerator = dirs_to_scan.GetEnumerator ();

			this.num_dirs = dirs_to_scan.Count;
		}
コード例 #2
0
        public KMaildirIndexableGenerator(KMailIndexer indexer, ArrayList mail_directories)
        {
            this.indexer                    = indexer;
            this.indexer.Progress           = 0;
            this.indexer.Queryable.Indexing = true;

            dirs_to_scan = new ArrayList();

            foreach (string directory in mail_directories)
            {
                AddDirectory(directory);
            }
            dir_enumerator = dirs_to_scan.GetEnumerator();

            this.num_dirs = dirs_to_scan.Count;
        }
コード例 #3
0
		public KMailQueryable () : base ("KMailIndex")
		{
			// the local mail path is different for different distributions
			local_path = GuessLocalFolderPath (true);
			if (local_path == null) {
				Log.Debug ("KMail folders not found. Will keep trying ");
			} else
				Log.Debug ("Guessing location of KMail folders: found at " + local_path);
			// I hope there is no ambiguity over imap path :P
			dimap_path = Path.Combine (PathFinder.HomeDir, ".kde");
			dimap_path = Path.Combine (dimap_path, "share");
			dimap_path = Path.Combine (dimap_path, "apps");
			dimap_path = Path.Combine (dimap_path, "kmail");
			dimap_path = Path.Combine (dimap_path, "dimap");

			local_indexer = null;
			dimap_indexer = null;
			sentmail_foldername = "sent-mail";
		}
コード例 #4
0
        /**
         * called by Start(), starts actual work
         * create indexers
         * ask indexers to crawl the mails
         * for non-inotify case, ask to poll
         */
        private void StartWorker()
        {
            Log.Debug("Starting KMail backend");

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            // check if there is at all anything to crawl
            if (local_path == null && (!Directory.Exists(dimap_path)))
            {
                GLib.Timeout.Add(60000, new GLib.TimeoutHandler(CheckForExistence));
                Log.Debug("KMail directories (local mail) " + dimap_path + " not found, will repoll.");
                return;
            }

            Log.Debug("Starting mail crawl");
            if (local_path != null)
            {
                local_indexer = new KMailIndexer(this, "local", local_path);
                local_indexer.Crawl();
            }
            // FIXME: parse kmailrc to get dimap account name
            if (Directory.Exists(dimap_path))
            {
                dimap_indexer = new KMailIndexer(this, "dimap", dimap_path);
                dimap_indexer.Crawl();
            }
            Log.Debug("Mail crawl done");

            if (!Inotify.Enabled)
            {
                Scheduler.Task task = Scheduler.TaskFromHook(new Scheduler.TaskHook(CrawlHook));
                task.Tag         = "Crawling Maildir directories";
                task.Source      = this;
                task.TriggerTime = DateTime.Now.AddSeconds(polling_interval_in_seconds);
                ThisScheduler.Add(task);
            }

            stopwatch.Stop();
            Log.Debug("KMail driver worker thread done in {0}", stopwatch);
        }
コード例 #5
0
        public KMailQueryable() : base("KMailIndex")
        {
            // the local mail path is different for different distributions
            local_path = GuessLocalFolderPath(true);
            if (local_path == null)
            {
                Log.Debug("KMail folders not found. Will keep trying ");
            }
            else
            {
                Log.Debug("Guessing location of KMail folders: found at " + local_path);
            }
            // I hope there is no ambiguity over imap path :P
            dimap_path = Path.Combine(PathFinder.HomeDir, ".kde");
            dimap_path = Path.Combine(dimap_path, "share");
            dimap_path = Path.Combine(dimap_path, "apps");
            dimap_path = Path.Combine(dimap_path, "kmail");
            dimap_path = Path.Combine(dimap_path, "dimap");

            local_indexer       = null;
            dimap_indexer       = null;
            sentmail_foldername = "sent-mail";
        }
コード例 #6
0
		public KMailMboxIndexableGenerator (KMailIndexer indexer, string mbox_file, bool initial_scan)
		{
			this.indexer = indexer;
			this.mbox_file = mbox_file;
			this.initial_scan = initial_scan;
		}
コード例 #7
0
		/**
		 * called by Start(), starts actual work
		 * create indexers
		 * ask indexers to crawl the mails
		 * for non-inotify case, ask to poll
		 */
		private void StartWorker ()
		{
			Log.Debug ("Starting KMail backend");

			Stopwatch stopwatch = new Stopwatch ();
			stopwatch.Start ();

			// check if there is at all anything to crawl
                        if ( local_path == null && (!Directory.Exists (dimap_path))) {
				GLib.Timeout.Add (60000, new GLib.TimeoutHandler (CheckForExistence));
				Log.Debug ("KMail directories (local mail) " + dimap_path + " not found, will repoll.");
                                return;
			}

			Log.Debug ("Starting mail crawl");
			if (local_path != null) {
				local_indexer = new KMailIndexer (this, "local", local_path);
				local_indexer.Crawl ();
			}
			// FIXME: parse kmailrc to get dimap account name
			if (Directory.Exists (dimap_path)) {
				dimap_indexer = new KMailIndexer (this, "dimap", dimap_path);
				dimap_indexer.Crawl ();
			}
			Log.Debug ("Mail crawl done");

			if (! Inotify.Enabled) {
				Scheduler.Task task = Scheduler.TaskFromHook (new Scheduler.TaskHook (CrawlHook));
				task.Tag = "Crawling Maildir directories";
				task.Source = this;
				task.TriggerTime = DateTime.Now.AddSeconds (polling_interval_in_seconds);
				ThisScheduler.Add (task);
			}

			stopwatch.Stop ();
			Log.Debug ("KMail driver worker thread done in {0}", stopwatch);
		}
コード例 #8
0
 public KMailMboxIndexableGenerator(KMailIndexer indexer, string mbox_file, bool initial_scan)
 {
     this.indexer      = indexer;
     this.mbox_file    = mbox_file;
     this.initial_scan = initial_scan;
 }