Changeset 3696

Show
Ignore:
Timestamp:
06/05/08 20:59:42
Author:
pvanhoof
Message:

Bugfix creating parents in store summary

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store-summary.c

    r3695 r3696  
    297297 
    298298static void  
    299 create_parents (CamelImapStoreSummary *s, const char *path, char dir_sep
     299create_parents (CamelImapStoreSummary *s, const char *path, char dir_sep, char *ns_path
    300300{ 
    301301        gchar *p = g_strdup (path); 
     
    313313 
    314314                                if (!info) { 
    315                                         info = (CamelImapStoreInfo *)camel_store_summary_add_from_path((CamelStoreSummary *)s, p); 
     315 
     316                                        if (!ns_path) 
     317                                                info = (CamelImapStoreInfo *)camel_store_summary_add_from_path((CamelStoreSummary *)s, p); 
     318                                        else { 
     319                                                char *pp = g_strdup_printf ("%s/%s", ns_path, p); 
     320                                                info = (CamelImapStoreInfo *)camel_store_summary_add_from_path((CamelStoreSummary *)s, pp); 
     321                                                g_free (pp); 
     322                                        } 
     323 
    316324                                        if (info) 
    317325                                                camel_store_info_set_string((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_IMAP_STORE_INFO_FULL_NAME, p); 
     
    366374                        prefix = camel_imap_store_summary_full_to_path(s, full_name+len, ns->sep?ns->sep:dir_sep); 
    367375                        if (*ns->path) { 
     376                                create_parents (s, prefix, dir_sep, ns->path); 
    368377                                pathu8 = g_strdup_printf ("%s/%s", ns->path, prefix); 
    369378                                g_free (prefix); 
     
    376385                d(printf("(Cannot find namespace for '%s')\n", full_name)); 
    377386                pathu8 = camel_imap_store_summary_full_to_path(s, full_name, dir_sep); 
    378         } 
    379  
    380         create_parents (s, pathu8, dir_sep); 
     387               create_parents (s, pathu8, dir_sep, NULL); 
     388        } 
     389 
    381390 
    382391        info = (CamelImapStoreInfo *)camel_store_summary_add_from_path((CamelStoreSummary *)s, pathu8);