Added support for initialization of configuration, opening GKeyFile.
[cascardo/atompub.git] / config / gkeyfile.c
index 34c6c58..9023d83 100644 (file)
@@ -34,3 +34,18 @@ gkeyfile_atom_config_get_str (AtomCtx *ctx, gchar * key)
     }
   return value;
 }
+
+void
+gkeyfile_atom_config_init (AtomCtx *ctx)
+{
+  GKeyFile *keyfile;
+  GError *error = NULL;
+  keyfile = g_key_file_new ();
+  if (!g_key_file_load_from_file (keyfile, "atompub.conf",
+                                 G_KEY_FILE_NONE, &error))
+    {
+      atom_error_set (ctx, error);
+      return;
+    }
+  atom_config_data_set (ctx, keyfile);
+}