Skip to content
Commit 303c00a6 authored by Sébastien Wilmet's avatar Sébastien Wilmet
Browse files

SearchContext: re-implement match_link() with list of GPatternSpec's

The commit 30075bd6 changed the
implementation, it introduced a regression in functionality, because the
keywords needed to be in the good order.

It can be useful to do a search with several keywords, but with the
keywords not necessarily in the same order as in the DhLink name.

If we want to match the keywords in the same order, there is anyway the
possibility to use globs, as in "gtk_source_region*region". How the
search works needs to be documented, when I reported bug #782257 I
didn't know how the search worked, and I didn't know that it was
possible to use '*' and '?'. The lack of user documentation (i.e. in
Mallard) is the root of the problem, I plan to fix that.

Note that the new implementation is different than before
commit 30075bd6, now it matches by
prefix only for the first keyword, which is more logical (see the
comment in the code). Another difference is that it always uses the
GPatternSpec's, even if the original keyword doesn't contain globs (the
code can be optimized later if we see that there is a performance
problem).

The rationale for the new implementation is well explained in the code,
and unit tests are added, it will prevent a future developer from
introducing a regression (hum hum).

https://bugzilla.gnome.org/show_bug.cgi?id=782257
parent a4c82b8a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment