Re: Grilo config problem when loading config files
- From: Iago Toral <itoral igalia com>
- To: <grilo-list gnome org>
- Subject: Re: Grilo config problem when loading config files
- Date: Tue, 18 Jan 2011 10:23:37 +0000
Hi,
On Tue, 18 Jan 2011 09:52:30 +0000, Lionel Landwerlin
<lionel g landwerlin linux intel com> wrote:
Hello everyone,
I'm trying to use the grl_plugin_registry_add_config_from_file()
function to load a ".ini" style file as configuration setup for
Grilo.
However, once I did load the file with the function above, I'm not
able
to request any other data except string. It seems to be an
underlaying
problem of using GValue in the grl_config_* functions.
As the grl_plugin_registry_add_config_from_file function stores
key/values from the given config file with values considered as
string,
the GValue structure remains stuck to use the g_value_get_string().
And
so in the end, you're not able to use anything else than
grl_config_get_string for all keys loaded from a config file.
My suggestion is to rewrite grl_config to use GKeyFile as underlaying
storing system instead of GValue. I can do this work today, if we're
agree on this solution.
Any though ?
the idea looks good to me except for one thing:
Recently, Fabien mentioned the need to store binary blobs as
configuration data (for example certain API keys), he even provided a
patch to add support for that as G_TYPE_BYTE_ARRAY values.
Unfortunately, GKeyFile does not provide any kind of support for this
AFAICS.
Maybe g_key_file_{get/set}_integer_list could be used to do this kind
of thing instead, but I dislike the fact that it uses 'gint' values
instead of 'gint8' and I wonder if that could pose problems in certain
cases. Another option would we to handle blobs outside the GKeyFile
backend completely (still use GValues for those), so the implementation
fo grl_config_get/set_data would still work with GValues and the current
GrlConfig hashtable.
what do you think?
Iago
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]