From cbf67cefd7f9da714bd5248c5dbaaba98ba5d05d Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sun, 6 Dec 2015 10:19:14 +0100 Subject: [PATCH] Added function ::gvalue_new_gdatetime. --- src/generic.c | 17 +++++++++++++++++ src/generic.h | 1 + 2 files changed, 18 insertions(+) diff --git a/src/generic.c b/src/generic.c index 76c9ee3..8d9e720 100644 --- a/src/generic.c +++ b/src/generic.c @@ -387,6 +387,23 @@ GValue return gval; } +/** + * zak_utils_gvalue_new_gdatetime: + * @datetime: + * + */ +GValue +*zak_utils_gvalue_new_gdatetime (GDateTime *datetime) +{ + GValue *gval; + + gval = g_new0 (GValue, 1); + g_value_init (gval, G_TYPE_DATE_TIME); + g_value_set_boxed (gval, datetime); + + return gval; +} + /** * zak_utils_str_to_boolean: * @value: diff --git a/src/generic.h b/src/generic.h index 8ea64e1..0ee9247 100644 --- a/src/generic.h +++ b/src/generic.h @@ -43,6 +43,7 @@ GValue *zak_utils_gvalue_new_int (int i); GValue *zak_utils_gvalue_new_string (const gchar *str); GValue *zak_utils_gvalue_new_boolean (gboolean b); GValue *zak_utils_gvalue_new_float (gfloat f); +GValue *zak_utils_gvalue_new_gdatetime (GDateTime *datetime); gboolean zak_utils_str_to_boolean (const gchar *str); -- 2.49.0