diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-08-02 09:54:22 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-08-02 09:54:22 +0800 |
commit | 34706b4a56700d9cb2ca5929c66c216bbb75244a (patch) | |
tree | 4f92ba250e1743b25684ee649f4e49dd07962002 /e-util | |
parent | 108958944abcbb18fdd34d04a3503f53b3873343 (diff) | |
download | gsoc2013-evolution-34706b4a56700d9cb2ca5929c66c216bbb75244a.tar.gz gsoc2013-evolution-34706b4a56700d9cb2ca5929c66c216bbb75244a.tar.zst gsoc2013-evolution-34706b4a56700d9cb2ca5929c66c216bbb75244a.zip |
Fixed the load statement here by just using array_from_string.
2001-08-01 Christopher James Lahey <clahey@ximian.com>
* e-categories-master-list-wombat.c (ecmlw_load): Fixed the load
statement here by just using array_from_string.
(ecmlw_save): Removed the part where we save the icons and colors
since that's handled in the array_to_string function. Fixes
Ximian bug #4451.
svn path=/trunk/; revision=11561
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 8 | ||||
-rw-r--r-- | e-util/e-categories-master-list-wombat.c | 49 |
2 files changed, 10 insertions, 47 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index d69ef2fe69..6306ed2e1a 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,11 @@ +2001-08-01 Christopher James Lahey <clahey@ximian.com> + + * e-categories-master-list-wombat.c (ecmlw_load): Fixed the load + statement here by just using array_from_string. + (ecmlw_save): Removed the part where we save the icons and colors + since that's handled in the array_to_string function. Fixes + Ximian bug #4451. + 2001-07-27 JP Rosevear <jpr@ximian.com> * e-dbhash.c (string_to_dbt): memset everything to 0 diff --git a/e-util/e-categories-master-list-wombat.c b/e-util/e-categories-master-list-wombat.c index 9b42802a2d..4cf8e78879 100644 --- a/e-util/e-categories-master-list-wombat.c +++ b/e-util/e-categories-master-list-wombat.c @@ -47,36 +47,8 @@ ecmlw_load (ECategoriesMasterListWombat *ecmlw) /* parse the XML string */ if (!def) { - xmlDocPtr doc; - xmlNodePtr node; - xmlNodePtr children; - char *string_copy; - - string_copy = g_strdup (string); - doc = xmlParseMemory (string_copy, strlen (string_copy)); - node = xmlDocGetRootElement (doc); - g_free (string_copy); - - /* add categories and their associated icons/colors */ - for (children = node->xmlChildrenNode; - children != NULL; - children = children->next) { - char *category; - char *icon; - char *color; - - category = e_xml_get_string_prop_by_name (children, "a"); - icon = (char *) e_categories_config_get_icon_file_for (category); - color = (char *) e_categories_config_get_color_for (category); - - e_categories_master_list_append ( - E_CATEGORIES_MASTER_LIST (ecmlw), - category, - color, - icon); - } - - xmlFreeDoc (doc); + e_categories_master_list_array_from_string (E_CATEGORIES_MASTER_LIST_ARRAY (ecmlw), + string); } g_print ("load: %s\n", string); @@ -88,8 +60,6 @@ static void ecmlw_save (ECategoriesMasterListWombat *ecmlw) { char *string; - int i; - int count; CORBA_Environment ev; string = e_categories_master_list_array_to_string (E_CATEGORIES_MASTER_LIST_ARRAY (ecmlw)); @@ -103,21 +73,6 @@ ecmlw_save (ECategoriesMasterListWombat *ecmlw) string, &ev); - /* now save all icons and colors for each category */ - count = e_categories_master_list_count (E_CATEGORIES_MASTER_LIST (ecmlw)); - for (i = 0; i < count; i++) { - gchar *category; - gchar *icon; - gchar *color; - - category = e_categories_master_list_nth (E_CATEGORIES_MASTER_LIST (ecmlw), i); - icon = e_categories_master_list_nth_icon (E_CATEGORIES_MASTER_LIST (ecmlw), i); - color = e_categories_master_list_nth_color (E_CATEGORIES_MASTER_LIST (ecmlw), i); - - e_categories_config_set_icon_for (category, icon); - e_categories_config_set_color_for (category, color); - } - CORBA_exception_free (&ev); g_free (string); |