diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 081afd9518..72968d98a4 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -555,7 +555,6 @@ gtk_column_view_get_type GtkColumnViewColumn GtkColumnViewColumn gtk_column_view_column_new -gtk_column_view_column_new_with_factory gtk_column_view_column_get_column_view gtk_column_view_column_set_factory gtk_column_view_column_get_factory diff --git a/gtk/gtkcolumnviewcolumn.c b/gtk/gtkcolumnviewcolumn.c index c1e7c18317..478cc5fe3f 100644 --- a/gtk/gtkcolumnviewcolumn.c +++ b/gtk/gtkcolumnviewcolumn.c @@ -357,25 +357,7 @@ gtk_column_view_column_init (GtkColumnViewColumn *self) /** * gtk_column_view_column_new: * @title: (nullable): Title to use for this column - * - * Creates a new #GtkColumnViewColumn. - * - * You most likely want to call gtk_column_view_add_column() next. - * - * Returns: a new #GtkColumnViewColumn - **/ -GtkColumnViewColumn * -gtk_column_view_column_new (const char *title) -{ - return g_object_new (GTK_TYPE_COLUMN_VIEW_COLUMN, - "title", title, - NULL); -} - -/** - * gtk_column_view_column_new_with_factory: - * @title: (nullable): Title to use for this column - * @factory: (transfer full): The factory to populate items with + * @factory: (transfer full) (nullable): The factory to populate items with * * Creates a new #GtkColumnViewColumn that uses the given @factory for * mapping items to widgets. @@ -385,15 +367,15 @@ gtk_column_view_column_new (const char *title) * The function takes ownership of the * argument, so you can write code like * ``` - * column = gtk_column_view_column_new_with_factory (_("Name"), + * column = gtk_column_view_column_new (_("Name"), * gtk_builder_list_item_factory_new_from_resource ("/name.ui")); * ``` * * Returns: a new #GtkColumnViewColumn using the given @factory **/ GtkColumnViewColumn * -gtk_column_view_column_new_with_factory (const char *title, - GtkListItemFactory *factory) +gtk_column_view_column_new (const char *title, + GtkListItemFactory *factory) { GtkColumnViewColumn *result; @@ -404,7 +386,7 @@ gtk_column_view_column_new_with_factory (const char *title, "title", title, NULL); - g_object_unref (factory); + g_clear_object (&factory); return result; } diff --git a/gtk/gtkcolumnviewcolumn.h b/gtk/gtkcolumnviewcolumn.h index 6125f16f76..5baf5b972c 100644 --- a/gtk/gtkcolumnviewcolumn.h +++ b/gtk/gtkcolumnviewcolumn.h @@ -47,9 +47,7 @@ GDK_AVAILABLE_IN_ALL GType gtk_column_view_column_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL -GtkColumnViewColumn * gtk_column_view_column_new (const char *title); -GDK_AVAILABLE_IN_ALL -GtkColumnViewColumn * gtk_column_view_column_new_with_factory (const char *title, +GtkColumnViewColumn * gtk_column_view_column_new (const char *title, GtkListItemFactory *factory); GDK_AVAILABLE_IN_ALL diff --git a/tests/testcolumnview.c b/tests/testcolumnview.c index aa7e769393..04f09f1ee5 100644 --- a/tests/testcolumnview.c +++ b/tests/testcolumnview.c @@ -662,7 +662,7 @@ add_extra_columns (GtkColumnView *view, for (i = 0; i < G_N_ELEMENTS(extra_columns); i++) { bytes = g_bytes_new_static (extra_columns[i].factory_xml, strlen (extra_columns[i].factory_xml)); - column = gtk_column_view_column_new_with_factory (extra_columns[i].title, + column = gtk_column_view_column_new (extra_columns[i].title, gtk_builder_list_item_factory_new_from_bytes (scope, bytes)); g_bytes_unref (bytes); sorter = GTK_SORTER (gtk_custom_sorter_new (compare_file_attribute, (gpointer) extra_columns[i].attribute, NULL)); diff --git a/tests/testlistdnd.c b/tests/testlistdnd.c index 803ff2164d..60c943715d 100644 --- a/tests/testlistdnd.c +++ b/tests/testlistdnd.c @@ -388,7 +388,7 @@ main (int argc, char *argv[]) g_signal_connect (factory, "unbind", G_CALLBACK (unbind_item), NULL); title = g_strdup_printf ("Column %u", i); - column = gtk_column_view_column_new_with_factory (title, factory); + column = gtk_column_view_column_new (title, factory); gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column); g_object_unref (column); g_free (title);