summaryrefslogtreecommitdiff
path: root/libview/ev-jobs.c
diff options
context:
space:
mode:
authorrootavish <[email protected]>2014-08-06 15:34:02 +0530
committerrootavish <[email protected]>2014-08-06 15:34:02 +0530
commit56880392a6678ccec12bbec016939597acd49b07 (patch)
treefd127f796f5127a63f564a5dea82d64f422a9580 /libview/ev-jobs.c
parent5f3f572777cfcb64a92a4671fb2aff5faa5cefa4 (diff)
downloadatril-56880392a6678ccec12bbec016939597acd49b07.tar.bz2
atril-56880392a6678ccec12bbec016939597acd49b07.tar.xz
Searching in epub documents
I added the capability to search through documents. The search is quite buggy, and we'll be taking care of each bug one at a time.
Diffstat (limited to 'libview/ev-jobs.c')
-rw-r--r--libview/ev-jobs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libview/ev-jobs.c b/libview/ev-jobs.c
index 155990e9..3a7dfd27 100644
--- a/libview/ev-jobs.c
+++ b/libview/ev-jobs.c
@@ -1379,7 +1379,7 @@ ev_job_find_run (EvJob *job)
ev_page = ev_document_get_page (job->document, job_find->current_page);
if (job->document->iswebdocument) {
- job_find->has_results = ev_document_find_check_for_hits(find, ev_page, job_find->text,
+ job_find->results[job_find->current_page] = ev_document_find_check_for_hits(find, ev_page, job_find->text,
job_find->case_sensitive);
}else {
matches = ev_document_find_find_text (find, ev_page, job_find->text,
@@ -1393,10 +1393,14 @@ ev_job_find_run (EvJob *job)
if (!job_find->has_results && !job->document->iswebdocument) {
job_find->has_results = (matches != NULL);
}
-
+ else if (!job_find->has_results && job->document->iswebdocument){
+ job_find->has_results = (job_find->results[job_find->current_page] > 0);
+ }
+
if (job->document->iswebdocument == FALSE) {
job_find->pages[job_find->current_page] = matches;
}
+
g_signal_emit (job_find, job_find_signals[FIND_UPDATED], 0, job_find->current_page);
job_find->current_page = (job_find->current_page + 1) % job_find->n_pages;