sets the type of the container the in the container private structure.
authorParthasarathi Susarla <sparthasarathi@novell.com>
Thu, 20 Jan 2005 06:48:23 +0000 (06:48 +0000)
committerParthasarathi Susarla <saps@src.gnome.org>
Thu, 20 Jan 2005 06:48:23 +0000 (06:48 +0000)
2005-01-20  Parthasarathi Susarla <sparthasarathi@novell.com>

* e-gw-container.[ch] (e_gw_container_set_from_soap_parameter):
  sets the type of the container the in the container private
  structure.

servers/groupwise/e-gw-container.c

index 0ac6e3a..c0a3b19 100644 (file)
@@ -37,6 +37,7 @@ struct _EGwContainerPrivate {
        char *owner;    
        GList *user_list;       
        const char *modified;
+       EGwContainerType type ;
        gboolean is_root ;
        gboolean is_writable;
        gboolean is_frequent_contacts; /*indicates  whether this folder is frequent contacts or not */
@@ -198,7 +199,6 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
        /* retrieve the parent container id */
        subparam = soup_soap_parameter_get_first_child_by_name (param, "parent");
        if (!subparam) {
-               g_warning (G_STRLOC ": found container with no parent");
                e_gw_container_set_parent_id (container, "");
                container->priv->is_root = TRUE ;
        } else {
@@ -207,6 +207,29 @@ e_gw_container_set_from_soap_parameter (EGwContainer *container, SoupSoapParamet
                e_gw_container_set_parent_id (container, (const char *) value);
                g_free (value) ;
        }
+
+       /*retrieve the folder type*/
+       subparam = soup_soap_parameter_get_first_child_by_name (param, "type") ;
+       if (!subparam) 
+               container->priv->type = E_GW_CONTAINER_TYPE_FOLDER ;
+       else {
+               value = soup_soap_parameter_get_string_value (subparam);
+               if (!strcmp (value, "Root")) 
+                       container->priv->type = E_GW_CONTAINER_TYPE_ROOT ;
+               else if (!strcmp (value, "Inbox")) 
+                       container->priv->type = E_GW_CONTAINER_TYPE_INBOX ;
+               else if (!strcmp (value, "Outbox")) 
+                       container->priv->type = E_GW_CONTAINER_TYPE_OUTBOX ;
+               else if (!strcmp (value, "Calendar")) 
+                       container->priv->type = E_GW_CONTAINER_TYPE_CALENDAR ;
+               else if (!strcmp (value, "Contacts")) 
+                       container->priv->type = E_GW_CONTAINER_TYPE_CONTACTS ;
+               else if (!strcmp (value, "Draft")) 
+                       container->priv->type = E_GW_CONTAINER_TYPE_DRAFT ;
+               else if (!strcmp (value, "Trash")) 
+                       container->priv->type = E_GW_CONTAINER_TYPE_TRASH ;
+               g_free (value) ;
+       }
        /* retrive the unread and total count */
        subparam = soup_soap_parameter_get_first_child_by_name (param, "hasUnread") ;
        if (!subparam) {