[devhelp] KeywordModel: do not look for exact match if nonprefix search



commit 3fac5c086630ee016c4a67f357fc006691b84ccb
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jan 18 21:24:34 2018 +0100

    KeywordModel: do not look for exact match if nonprefix search

 src/dh-keyword-model.c  |    2 +-
 src/dh-search-context.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/dh-keyword-model.c b/src/dh-keyword-model.c
index 848f60d..8c106e8 100644
--- a/src/dh-keyword-model.c
+++ b/src/dh-keyword-model.c
@@ -380,7 +380,7 @@ search_single_book (DhBook          *book,
 
                 g_queue_push_tail (ret, link);
 
-                if (exact_link == NULL)
+                if (exact_link == NULL || !settings->prefix)
                         continue;
 
                 /* Look for an exact link match. If the link is a PAGE, we can
diff --git a/src/dh-search-context.c b/src/dh-search-context.c
index cd04f8b..1bb097a 100644
--- a/src/dh-search-context.c
+++ b/src/dh-search-context.c
@@ -370,7 +370,7 @@ _dh_search_context_match_link (DhSearchContext *search,
 /* This function assumes:
  * - That checking that the DhBook (book_id) matches has already been done (to
  *   not check the book_id for each DhLink).
- * - That _dh_search_context_match_link() returns TRUE for @link.
+ * - That _dh_search_context_match_link(prefix=TRUE) returns TRUE for @link.
  */
 gboolean
 _dh_search_context_is_exact_link (DhSearchContext *search,


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