diff options
author | Benjamin Otte <otte@redhat.com> | 2020-02-16 14:24:03 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2020-02-16 20:10:30 +0100 |
commit | 8d2ed36a1bdc4f5c5c7a5eab39562764c69139ce (patch) | |
tree | e2abac8376acdf46f9f239d20df3ea6ff83d991b /gtk/gtkcalendar.c | |
parent | 762c4602fbb88e3712336426a326adf813e5b280 (diff) | |
download | gtk+-8d2ed36a1bdc4f5c5c7a5eab39562764c69139ce.tar.gz |
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().
Diffstat (limited to 'gtk/gtkcalendar.c')
-rw-r--r-- | gtk/gtkcalendar.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 70b34ff84c..769d85f68d 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -1166,8 +1166,6 @@ get_calendar_content (GtkCalendar *calendar) GtkCalendarPrivate *priv = gtk_calendar_get_instance_private (calendar); GDate *date; gchar str[128]; - GValue value = G_VALUE_INIT; - GdkContentProvider *content; date = g_date_new_dmy (g_date_time_get_day_of_month (priv->date), g_date_time_get_month (priv->date), @@ -1175,12 +1173,7 @@ get_calendar_content (GtkCalendar *calendar) g_date_strftime (str, 127, "%x", date); g_free (date); - g_value_init (&value, G_TYPE_STRING); - g_value_set_string (&value, str); - content = gdk_content_provider_new_for_value (&value); - g_value_unset (&value); - - return content; + return gdk_content_provider_new_typed (G_TYPE_STRING, str); } static void |