1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-10-05 18:25:26 +00:00

util: Rename function to calls_find_in_model() and adjust documentation

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 commit is contained in:
Evangelos Ribeiro Tzaras 2022-10-10 08:39:42 +02:00
parent 0b495de9eb
commit 25c87f9c2d
4 changed files with 6 additions and 7 deletions

View file

@ -94,7 +94,7 @@ delete_call_cb (CallsCallRecord *record,
g_return_if_fail (CALLS_IS_CALL_RECORD (record)); g_return_if_fail (CALLS_IS_CALL_RECORD (record));
ok = calls_find_in_store (self->model, ok = calls_find_in_model (self->model,
record, record,
&position); &position);

View file

@ -518,7 +518,7 @@ origin_found_in_any_provider (CallsManager *self,
CallsProvider *provider = CALLS_PROVIDER (value); CallsProvider *provider = CALLS_PROVIDER (value);
GListModel *origins = calls_provider_get_origins (provider); GListModel *origins = calls_provider_get_origins (provider);
if (origins && calls_find_in_store (origins, if (origins && calls_find_in_model (origins,
origin, origin,
&position)) &position))
return TRUE; return TRUE;

View file

@ -95,16 +95,15 @@ calls_number_is_ussd (const char *number)
} }
/** /**
* calls_find_in_store: * calls_find_in_model:
* @list: A #GListModel * @list: A #GListModel
* @item: The #gpointer to find * @item: The #gpointer to find
* @position: (out) (optional): The first position of @item, if it was found. * @position: (out) (optional): The first position of @item, if it was found.
* *
* Returns: Whether @list contains @item. This is mainly a convenience function * Returns: %TRUE if @list contains @item, %FALSE otherwise.
* until we no longer support older glib versions.
*/ */
gboolean gboolean
calls_find_in_store (GListModel *list, calls_find_in_model (GListModel *list,
gpointer item, gpointer item,
guint *position) guint *position)
{ {

View file

@ -119,7 +119,7 @@ gboolean calls_date_time_is_same_year (GDateTime *a,
GDateTime *b); GDateTime *b);
gboolean calls_number_is_ussd (const char *number); gboolean calls_number_is_ussd (const char *number);
gboolean calls_find_in_store (GListModel *list, gboolean calls_find_in_model (GListModel *list,
gpointer item, gpointer item,
guint *position); guint *position);