Re: Grilo config problem when loading config files



On 1/18/2011 10:23 AM, Iago Toral wrote:

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:


Hi,

As far as I can see, using GKeyFile to hold data should be possible as we can declare the pspec to be a G_TYPE_BOXED or G_TYPE_BYTE_ARRAY. We should be able to hash the config key from the pspec name or nick.

Fabien

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
_______________________________________________
grilo-list mailing list
grilo-list gnome org
http://mail.gnome.org/mailman/listinfo/grilo-list


--
 Fabien Lebaillif - Delamare



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]