On 09/24/2010 06:01 PM, Denys Vlasenko wrote:
On Fri, 2010-09-24 at 14:03 +0200, Nikola Pajkovsky wrote:
>>> and I'd like end up with one simple structure like that
>>>
>>> struct settings {
>>> GList *opengpg;
>>> GList *black_listed_pkgs;
>>> GList *black_listed_paths;
>>> ...
>>> ...
>>> };
>>>
>>> what do you think?
>>
>> How do you see this structure to be used?
>>
>> For example, currently we use settings like this:
>>
>> if (g_settings_nMaxCrashReportsSize> 0)
>> {
>> char *worst_dir = NULL;
>> while (g_settings_nMaxCrashReportsSize> 0
>> &&
get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR,&worst_dir, name) / (1024*1024)>=
g_settings_nMaxCrashReportsSize
>> && worst_dir
>> ) {
>> ...
>> }
>> }
>>
>> How will it look after the switch to structure?
>>
>
> Something like if I use structure.
>
> if (settings->nMaxCrashReportsSize> 0)
> { // ^^ needs better name
> char *worst_dir = NULL;
> while (settings->nMaxCrashReportsSize> 0
> &&
get_dirsize_find_largest_dir(DEBUG_DUMPS_DIR,&worst_dir, name) / (1024*1024)>=
settings->nMaxCrashReportsSize
> && worst_dir
> ) {
> ...
> }
> }
What is the point of having the settings pointer?
Do you plan to have more than one instance of settings?
Yep. This is actually Karel's idea.
one for loading config from /etc/abrt and second loading from $HOME/.abrt.
Configs from $HOME/.abrt have higher priority then /etc/abrt. So we can easily
merge them together and we have pretty easily a new shadowed config ;)
--
Nikola