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.KeywordModelobject.- Return type:
- filter(search_string, current_book_id, profile)¶
- Parameters:
search_string (
str) – a search query.current_book_id (
strorNone) – the ID of the book currently shown, orNone.profile (
Devhelp.ProfileorNone) – aDevhelp.Profile, orNonefor the default profile.
- Returns:
the
Devhelp.Linkthat matches exactly search_string, orNoneif no suchDevhelp.Linkwas found within the maximum number of matches.- Return type:
Devhelp.LinkorNone
Searches in the
Devhelp.BookListof 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.TreeModelsignals 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).