]> saetta.ns0.it Git - zakform/ini/commitdiff
First adjustments.
authorAndrea Zagli <azagli@libero.it>
Sat, 9 Apr 2016 08:50:06 +0000 (10:50 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 9 Apr 2016 08:50:06 +0000 (10:50 +0200)
src/Makefile.am
src/form.c

index c806bf1e63f97d40a65c1b6238e37c334411a67f..d4b0cf4ba734adf33081ce0930b9de2b32a976a3 100644 (file)
@@ -15,4 +15,4 @@ libzakformini_include_HEADERS = \
                                 libzakformini.h \
                                 form.h
 
-libzakformgini_includedir = $(includedir)/libzakformini
+libzakformini_includedir = $(includedir)/libzakformini
index ff83e19b3c0073f58bef376a99bc61614696adbd..400b27ff7d77d8890bbd3afd66ba9073ebeaf470 100644 (file)
@@ -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
                                {