From 8d2ed36a1bdc4f5c5c7a5eab39562764c69139ce Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 16 Feb 2020 14:24:03 +0100 Subject: contentprovider: Add gdk_content_provider_new_typed() Gets around the boilerplate required to create and initialize a GValue by having this function doing it via G_VALUE_COLLECT(). --- tests/testentryicons.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tests/testentryicons.c') diff --git a/tests/testentryicons.c b/tests/testentryicons.c index 796295a61f..14d3cb6b5d 100644 --- a/tests/testentryicons.c +++ b/tests/testentryicons.c @@ -100,7 +100,6 @@ main (int argc, char **argv) GtkWidget *button4; GIcon *icon; GdkContentProvider *content; - GValue value = G_VALUE_INIT; gboolean done = FALSE; gtk_init (); @@ -165,10 +164,7 @@ main (int argc, char **argv) GTK_ENTRY_ICON_PRIMARY, "Save a file"); - g_value_init (&value, G_TYPE_STRING); - g_value_set_string (&value, "Amazing"); - content = gdk_content_provider_new_for_value (&value); - g_value_unset (&value); + content = gdk_content_provider_new_typed (G_TYPE_STRING, "Amazing"); gtk_entry_set_icon_drag_source (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, content, GDK_ACTION_COPY); -- cgit v1.2.1