[evince] libview: Use ev_document_find_find_text_with_options() when running find job



commit 8c14e6b34e3e73518d4a4e607b6c27e86100b6d2
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sun Jun 10 13:05:38 2012 +0200

    libview: Use ev_document_find_find_text_with_options() when running find job

 libview/ev-jobs.c |   22 ++++++++++++++++++++--
 libview/ev-jobs.h |    4 ++++
 2 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/libview/ev-jobs.c b/libview/ev-jobs.c
index e14edff..2fe62e1 100644
--- a/libview/ev-jobs.c
+++ b/libview/ev-jobs.c
@@ -1542,8 +1542,8 @@ ev_job_find_run (EvJob *job)
 #endif
 
 	ev_page = ev_document_get_page (job->document, job_find->current_page);
-	matches = ev_document_find_find_text (find, ev_page, job_find->text,
-					      job_find->case_sensitive);
+	matches = ev_document_find_find_text_with_options (find, ev_page, job_find->text,
+                                                           job_find->options);
 	g_object_unref (ev_page);
 	
 	ev_document_doc_mutex_unlock ();
@@ -1603,12 +1603,30 @@ ev_job_find_new (EvDocument  *document,
 	job->n_pages = n_pages;
 	job->pages = g_new0 (GList *, n_pages);
 	job->text = g_strdup (text);
+        /* Keep for compatibility */
 	job->case_sensitive = case_sensitive;
 	job->has_results = FALSE;
+        if (case_sensitive)
+                job->options |= EV_FIND_CASE_SENSITIVE;
 
 	return EV_JOB (job);
 }
 
+void
+ev_job_find_set_options (EvJobFind     *job,
+                         EvFindOptions  options)
+{
+        job->options = options;
+        /* Keep compatibility */
+        job->case_sensitive = options & EV_FIND_CASE_SENSITIVE;
+}
+
+EvFindOptions
+ev_job_find_get_options (EvJobFind *job)
+{
+        return job->options;
+}
+
 gint
 ev_job_find_get_n_results (EvJobFind *job,
 			   gint       page)
diff --git a/libview/ev-jobs.h b/libview/ev-jobs.h
index 2f1107b..f0d2528 100644
--- a/libview/ev-jobs.h
+++ b/libview/ev-jobs.h
@@ -390,6 +390,7 @@ struct _EvJobFind
 	gchar *text;
 	gboolean case_sensitive;
 	gboolean has_results;
+        EvFindOptions options;
 };
 
 struct _EvJobFindClass
@@ -540,6 +541,9 @@ EvJob          *ev_job_find_new           (EvDocument      *document,
 					   gint             n_pages,
 					   const gchar     *text,
 					   gboolean         case_sensitive);
+void            ev_job_find_set_options   (EvJobFind       *job,
+                                           EvFindOptions    options);
+EvFindOptions   ev_job_find_get_options   (EvJobFind       *job);
 gint            ev_job_find_get_n_results (EvJobFind       *job,
 					   gint             pages);
 gdouble         ev_job_find_get_progress  (EvJobFind       *job);



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