Devhelp.KeywordModel¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Devhelp.KeywordModel(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
Devhelp.KeywordModel
object.- Return type:
- filter(search_string, current_book_id, profile)¶
- Parameters:
search_string (
str
) – a search query.current_book_id (
str
orNone
) – the ID of the book currently shown, orNone
.profile (
Devhelp.Profile
orNone
) – aDevhelp.Profile
, orNone
for the default profile.
- Returns:
the
Devhelp.Link
that matches exactly search_string, orNone
if no suchDevhelp.Link
was found within the maximum number of matches.- Return type:
Devhelp.Link
orNone
Searches in the
Devhelp.BookList
of profile the list ofDevhelp.Link
's that correspond to search_string, and fills the self with that list (erasing the previous content).Attention, when calling this function the self needs to be disconnected from the
Gtk.TreeView
, because theGtk.TreeModel
signals are not emitted, to improve the performances (sending a lot of signals is slow) and have a simpler implementation. The previous row selection is anyway no longer relevant.Note that there is a maximum number of matches (configured internally). When the maximum is reached the search is stopped, to avoid blocking the GUI (since this function runs synchronously) if the search_string contains for example only one character. (And it is anyway not very useful to show to the user tens of thousands search results).