From 108f026239933b1a798248cde239b39dedd11f32 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 9 Apr 2016 10:50:06 +0200 Subject: [PATCH] First adjustments. --- src/Makefile.am | 2 +- src/form.c | 29 +++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index c806bf1..d4b0cf4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,4 +15,4 @@ libzakformini_include_HEADERS = \ libzakformini.h \ form.h -libzakformgini_includedir = $(includedir)/libzakformini +libzakformini_includedir = $(includedir)/libzakformini diff --git a/src/form.c b/src/form.c index ff83e19..400b27f 100644 --- a/src/form.c +++ b/src/form.c @@ -103,7 +103,7 @@ zak_form_iprovider_interface_init (ZakFormIProviderInterface *iface) * Returns: the newly created #ZakFormIniProvider object. */ ZakFormIniProvider -*zak_form_ini_provider_new (GKeyFile *kfile, const gchar *group) +*zak_form_ini_provider_new_from_gkeyfile (GKeyFile *kfile, const gchar *group) { ZakFormIniProvider *zak_form_ini_provider; ZakFormIniProviderPrivate *priv; @@ -118,6 +118,27 @@ ZakFormIniProvider return zak_form_ini_provider; } +/** + * zak_form_ini_provider_new_from_file: + * @filename: + * @group: + * + * Returns: the newly created #ZakFormIniProvider object. + */ +ZakFormIniProvider +*zak_form_ini_provider_new_from_file (const gchar *filename, const gchar *group) +{ + GKeyFile *kfile; + + ZakFormIniProvider *zak_form_ini_provider; + + kfile = g_key_file_new (); + g_key_file_load_from_file (kfile, filename, G_KEY_FILE_NONE, NULL); + zak_form_ini_provider = zak_form_ini_provider_new_from_gkeyfile (kfile, group); + + return zak_form_ini_provider; +} + /* PRIVATE */ static void zak_form_ini_provider_set_property (GObject *object, @@ -230,7 +251,7 @@ static GValue if (gdt == NULL) { - ret = gda_value_new_null (); + ret = zak_utils_gvalue_new_string (""); } else { @@ -253,7 +274,7 @@ static GValue if (gdt == NULL) { - ret = gda_value_new_null (); + ret = zak_utils_gvalue_new_string (""); } else { @@ -276,7 +297,7 @@ static GValue if (gdt == NULL) { - ret = gda_value_new_null (); + ret = zak_utils_gvalue_new_string (""); } else { -- 2.49.0