Since it works for GListModel rename it appropriately.
It used to provide an inline implementation for g_list_store_find()
behind a glib version guard, but we bumped minimum version in
cfd3c2a7fe
so the docstring was updated and made more succinct.
This helps avoiding some log spam when scrolling to the bottom:
16:29:17.1053 CallsHistoryBox[2798409]: DEBUG: Increasing history slice from 1825 to 1875
16:29:17.1215 CallsHistoryBox[2798409]: DEBUG: Increasing history slice from 1875 to 1925
16:29:20.6739 CallsHistoryBox[2798409]: DEBUG: Increasing history slice from 1925 to 1975
16:29:23.1919 CallsHistoryBox[2798409]: DEBUG: Increasing history slice from 1975 to 2025
16:29:24.2533 CallsHistoryBox[2798409]: DEBUG: Increasing history slice from 2025 to 2075
for a history of ~1400 records.
The slice get's increased by 50 items if scrolled to the bottom
and reset to the initial 75 items if scrolled back to the top.
The defined threshholds make sure that the UX still feels smooth.
Having more than ~200 widgets in a GtkListBox comes with a very
performance impact. This is especially noticable during while the main
window is being realized (even if Calls already runs in daemon mode).
We can limit the amount of widgets by using a slice list model.
Fixes: #374
Since passing a CallsContacts pointer down to every class it needs, started to
become laborous - especially since the intermediates classes don't need
the reference themselves - it was made a singleton
* src/calls-contacts.c: Added calls_contacts_get_default () function and
removed calls_contacts_new ()
* src/calls-contacts.h: Added _get_default () prototype and removed the
_new () prototype
* src/calls-application.c: Use calls_contacts_get_default () now
* src/calls-history-box.c: Removed self->contacts completely
* src/calls-history-box.h: Got rid of CallsContacts argument in _new()
* src/calls-main-window.c: Removed self->contacts completely
* src/calls-main-window.h: Got rid of CallsContacts argument in _new()
* src/calls-call-record-row.c: Use calls_contacts_get_default () now
* src/calls-call-record-row.h: Got rid of CallsContacts argument in
_new()
* src/calls-call-holder.c: Use calls_contacts_get_default () now
* src/calls-call-holder.h: Got rid of CallsContacts argument in _new()
* src/calls-call-window.c: Removed self->contacts completely
* src/calls-call-window.h: Got rid of CallsContacts argument in _new()
* src/calls-notifier.c: Use calls_contacts_get_default () now
* src/calls-notifier.h: Got rid of CallsContacts argument in _new()
* src/ui/call-record-row.ui: Add menu, GtkPopover. Surround existing
elements with GtkEventBox to capture longpress/rightclicks
* src/calls-call-record-row.c: Provide functions emiting "call-delete"
signal, add widgets from ui file
* src/calls-record.c: Add "call-delete" signal
* src/calls-history-box.c: Add callback for "call-delete" signal
* src/calls-record-store.c: Add callback for "call-delete" signal
* src/util.c: Add convenience function calls_find_in_store for finding
items in ListModel
* src/util.h: Add declaration of calls_find_in_store
How `g_type_class_peek ()` was used it didn't return the correct parent
class in most cases.
G_DEFINE_TYPE macro creates a pointer we can use to get the parent
class `n_p_parent_class`.
Because we didn't use the correct parent class the object initialisation
wasn't fully completed for some GtkWidgets.
See https://developer.gnome.org/gobject/stable/chapter-gobject.html#gobject-instantiation
for more information.
This commit makes use of the `n_p_parent_class pointer` created for this
specific use case where ever possible.
Fixes: https://source.puri.sm/Librem5/calls/issues/118