stringlist: Call splice() for adding items after construction

This has the benefit of actually allowing NULL to be passed.
This commit is contained in:
Benjamin Otte
2020-06-30 23:31:02 +02:00
parent c4e4de36f6
commit f6c2c2edbd

View File

@@ -434,12 +434,10 @@ GtkStringList *
gtk_string_list_new (const char * const *strings)
{
GtkStringList *self;
guint i;
self = g_object_new (GTK_TYPE_STRING_LIST, NULL);
for (i = 0; strings[i]; i++)
g_sequence_append (self->items, gtk_string_object_new (strings[i]));
gtk_string_list_splice (self, 0, 0, strings);
return self;
}