mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-06-28 14:49:30 +00:00
calls-contacts-box: Adapt to GtkContainer removal
https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-gtkcontainer-removal Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
This commit is contained in:
parent
0727996edf
commit
3617f7b7cb
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue