Re: [evolution-patches] Re: patch for junk-api implementation (eds/servers/groupwise)



On Tue, 2005-06-28 at 04:17 -0600, Jain Vivek wrote:

+                       if (!g_ascii_strcasecmp (field, "useJunkList")) {
+                               if (val_param)
+                                       val = soup_soap_parameter_get_int_value (val_param);
+                               *use_junk = val;
+                       }
+                       if (!g_a

The field should be freed. Once the value is obtained, the forth coming comparisons with field can be bypassed. val should be assigned only if val_param is present.

  soup_soap_message_start_element (msg, "setting", NULL, NULL);
+               e_gw_message_write_string_parameter (msg, "field", NULL, "useJunkList");
+               e_gw_message_write_int_parameter (msg, "value", NULL, use_junk);
+               soup_soap_message_end_element (msg);

A helper function can be written to get the setting values.

 value = soup_soap_parameter_get_string_value (subparam);
+       junk_entry->id = g_strdup (value);
+       g_free (value);
+

The value can be directly assigned instead of duping and freeing it.

The parsing logic and the structures specific to junk settings should be moved to some other file, generic to handle all the settings in groupwise. Probably this can be done as a separate task.

thanks, chenthill.




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