[LIBREPORT PATCH] skip the workflow selection if there is only 1 available closes #167

Jiri Moskovcak jmoskovc at redhat.com
Wed Jul 17 06:49:29 UTC 2013


On 07/16/2013 03:27 PM, Jakub Filak wrote:
> Please, take a look at set_auto_event_chain() function in wizard.c
> I'm afraid that you cannot simply assign to g_auto_event_list variable.
>
> <snip>
>      GList *wf_event_list = wf_get_event_list(w);
>      while(wf_event_list)
>      {
>          g_auto_event_list = g_list_append(g_auto_event_list,
>                              xstrdup(ec_get_name(wf_event_list->data)));
>          load_single_event_config_data_from_user_storage(
>                              (event_config_t *)wf_event_list->data);
>
>          wf_event_list = g_list_next(wf_event_list);
>      }
> </snip>
>
>
> Or is this version OK?

- good catch, it's not ok, I've send another version which should work 
fine (it has the same subj without suffix)

>
>
>
> On Tue, 2013-07-16 at 14:48 +0200, Jiri Moskovcak wrote:
>> Signed-off-by: Jiri Moskovcak <jmoskovc at redhat.com>
>> ---
>>   src/gui-wizard-gtk/main.c | 19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
>>
>> diff --git a/src/gui-wizard-gtk/main.c b/src/gui-wizard-gtk/main.c
>> index 3239420..235c4bf 100644
>> --- a/src/gui-wizard-gtk/main.c
>> +++ b/src/gui-wizard-gtk/main.c
>> @@ -145,6 +145,25 @@ int main(int argc, char **argv)
>>
>>       load_workflow_config_data(WORKFLOWS_DIR);
>>
>> +    /* list of workflows applicable to the currently processed problem */
>> +    GHashTable *possible_workflows = load_workflow_config_data_from_list(
>> +                list_possible_events_glist(g_dump_dir_name, "workflow"),
>> +                WORKFLOWS_DIR);
>> +
>> +    /* if we have only 1 workflow, we can use the events from it as default */
>> +    if (g_auto_event_list == NULL && g_hash_table_size(possible_workflows) == 1)
>> +    {
>> +        GHashTableIter iter;
>> +        gpointer key, value;
>> +
>> +        g_hash_table_iter_init(&iter, possible_workflows);
>> +        if (g_hash_table_iter_next(&iter, &key, &value))
>> +        {
>> +            VERB1 log("autoselected workflow: '%s'", (char *)key);
>> +            g_auto_event_list = wf_get_event_list((workflow_t *)value);
>> +        }
>> +    }
>> +
>>       problem_data_reload_from_dump_dir();
>>
>>       create_assistant(expert_mode);
>
>



More information about the Crash-catcher mailing list