search-view: start searching after 3 characters and 500ms

Add timeout and minimum string length (3 characters) before triggering
searching routine.

App freezes and lags for a few seconds once one starts typing due to
the huge amount of matched events.

Search will be triggered only if passed time since last inserted
charactere is at least 500ms and three characteres have been entered.
If length is already >= 3 but user keeps typing in a quick fashion
(i.e. faster than 500ms per charactere) pre-scheduled search routine
(timeout from the last inserted char) is cancelled and a new one
is created.

https://bugzilla.gnome.org/show_bug.cgi?id=775549
This commit is contained in:
George Willian Condomitti
2017-03-03 21:14:52 -03:00
committed by Georges Basile Stavracas Neto
parent 4d7501f9dc
commit 1ee760ac5c
2 changed files with 61 additions and 29 deletions
+1
View File
@@ -43,6 +43,7 @@ GtkWidget* gcal_search_view_new (void);
void gcal_search_view_connect (GcalSearchView *search_view,
GcalManager *manager);
G_END_DECLS
#endif /* __GCAL_SEARCH_VIEW_H__ */