1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-28 14:49:30 +00:00
Anton Lazarev 2023-12-15 16:55:58 -08:00
parent 0727996edf
commit 3617f7b7cb

View file

@ -115,7 +115,7 @@ contacts_provider_added (CallsContactsBox *self,
row = calls_contacts_row_new (individual); row = calls_contacts_row_new (individual);
gtk_container_add (GTK_CONTAINER (self->contacts_listbox), row); gtk_list_box_append (GTK_LIST_BOX (self->contacts_listbox), row);
g_signal_connect_object (individual, g_signal_connect_object (individual,
"notify::is-favourite", "notify::is-favourite",
@ -128,13 +128,15 @@ static void
contacts_provider_removed (CallsContactsBox *self, contacts_provider_removed (CallsContactsBox *self,
FolksIndividual *individual) FolksIndividual *individual)
{ {
g_autoptr (GList) list = gtk_container_get_children (GTK_CONTAINER (self->contacts_listbox)); int i = 0;
GList *l; GtkListBoxRow *row = gtk_list_box_get_row_at_index(GTK_LIST_BOX (self->contacts_listbox), i);
for (l = list; l != NULL; l = l->next) { while (row != NULL) {
CallsContactsRow *row = CALLS_CONTACTS_ROW (l->data); if (calls_contacts_row_get_item (CALLS_CONTACTS_ROW (row)) == individual)
if (calls_contacts_row_get_item (row) == individual) gtk_list_box_remove (GTK_LIST_BOX (self->contacts_listbox), GTK_WIDGET (row));
gtk_container_remove (GTK_CONTAINER (self->contacts_listbox), GTK_WIDGET (row));
i += 1;
row = gtk_list_box_get_row_at_index(GTK_LIST_BOX (self->contacts_listbox), i);
} }
} }