diff options
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/local/camel-maildir-summary.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c index ee9411c297..bc7bf790bd 100644 --- a/camel/providers/local/camel-maildir-summary.c +++ b/camel/providers/local/camel-maildir-summary.c @@ -580,26 +580,23 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca filename = camel_maildir_info_filename(mdi); /* TODO: only store the extension in the mdi->filename struct, not the whole lot */ if (filename == NULL || strcmp(filename, d->d_name) != 0) { -#if defined (DOEPOOLV) || defined (DOESTRV) +#ifdef DOESTRV #warning "cannot modify the estrv after its been setup, for mt-safe code" - d(printf("filename changed: %s to %s\n", filename, d->d_name)); - - /* need to update the summary hash string reference since it might (will) change */ CAMEL_SUMMARY_LOCK(s, summary_lock); - g_hash_table_remove(s->messages_uid, uid); -#ifdef DOEPOOLV - info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name, FALSE); -#else + /* need to update the summary hash ref */ + g_hash_table_remove(s->messages_uid, camel_message_info_uid(info)); info->strings = e_strv_set_ref(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name); - /* we need to re-pack as well */ info->strings = e_strv_pack(info->strings); -#endif /* DOEPOOLV */ g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info); CAMEL_SUMMARY_UNLOCK(s, summary_lock); -#else /* defined (DOEPOOLV) || defined (DOESTRV) */ +#else +# ifdef DOEPOOLV + info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name, FALSE); +# else g_free(mdi->filename); mdi->filename = g_strdup(d->d_name); -#endif +# endif +#endif } camel_folder_summary_info_free((CamelFolderSummary *)cls, info); } @@ -681,7 +678,7 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange int count, i; CamelMessageInfo *info; CamelMaildirMessageInfo *mdi; -#if defined (DOEPOOLV) || defined (DOESTRV) +#ifdef DOESTRV CamelFolderSummary *s = (CamelFolderSummary *)cls; #endif char *name; @@ -732,22 +729,23 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange /* TODO: If this is made mt-safe, then this code could be a problem, since the estrv is being modified. Sigh, this may mean the maildir name has to be cached another way */ -#if defined (DOEPOOLV) || defined (DOESTRV) +#ifdef DOESTRV #warning "cannot modify the estrv after its been setup, for mt-safe code" CAMEL_SUMMARY_LOCK(s, summary_lock); /* need to update the summary hash ref */ g_hash_table_remove(s->messages_uid, camel_message_info_uid(info)); -#ifdef DOEPOOLV - info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname, TRUE); -#else info->strings = e_strv_set_ref_free(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname); info->strings = e_strv_pack(info->strings); -#endif /* DOEPOOLV */ g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info); CAMEL_SUMMARY_UNLOCK(s, summary_lock); -#else /* defined (DOEPOOLV) || defined (DOESTRV) */ +#else +# ifdef DOEPOOLV + info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname, TRUE); + g_free(newname); +# else g_free(mdi->filename); mdi->filename = newname; +# endif #endif } g_free(name); |