Revision 1491 libsylph/mh.c
| mh.c (revision 1491) | ||
|---|---|---|
| 1 | 1 |
/* |
| 2 | 2 |
* LibSylph -- E-Mail client library |
| 3 |
* Copyright (C) 1999-2006 Hiroyuki Yamamoto
|
|
| 3 |
* Copyright (C) 1999-2007 Hiroyuki Yamamoto
|
|
| 4 | 4 |
* |
| 5 | 5 |
* This library is free software; you can redistribute it and/or |
| 6 | 6 |
* modify it under the terms of the GNU Lesser General Public |
| ... | ... | |
| 56 | 56 |
static GSList *mh_get_msg_list (Folder *folder, |
| 57 | 57 |
FolderItem *item, |
| 58 | 58 |
gboolean use_cache); |
| 59 |
static GSList *mh_get_uncached_msg_list(Folder *folder, |
|
| 60 |
FolderItem *item); |
|
| 59 | 61 |
static gchar *mh_fetch_msg (Folder *folder, |
| 60 | 62 |
FolderItem *item, |
| 61 | 63 |
gint num); |
| ... | ... | |
| 143 | 145 |
mh_create_tree, |
| 144 | 146 |
|
| 145 | 147 |
mh_get_msg_list, |
| 148 |
mh_get_uncached_msg_list, |
|
| 146 | 149 |
mh_fetch_msg, |
| 147 | 150 |
mh_get_msginfo, |
| 148 | 151 |
mh_add_msg, |
| ... | ... | |
| 191 | 194 |
folder_local_folder_init(folder, name, path); |
| 192 | 195 |
} |
| 193 | 196 |
|
| 194 |
static GSList *mh_get_msg_list(Folder *folder, FolderItem *item, |
|
| 195 |
gboolean use_cache)
|
|
| 197 |
static GSList *mh_get_msg_list_full(Folder *folder, FolderItem *item,
|
|
| 198 |
gboolean use_cache, gboolean uncached_only)
|
|
| 196 | 199 |
{
|
| 197 | 200 |
GSList *mlist; |
| 198 | 201 |
GHashTable *msg_table; |
| 199 | 202 |
time_t cur_mtime; |
| 203 |
GSList *newlist = NULL; |
|
| 200 | 204 |
#ifdef MEASURE_TIME |
| 201 | 205 |
GTimer *timer; |
| 202 | 206 |
#endif |
| ... | ... | |
| 218 | 222 |
item->cache_dirty = TRUE; |
| 219 | 223 |
} |
| 220 | 224 |
} else if (use_cache) {
|
| 221 |
GSList *newlist, *cur, *next;
|
|
| 225 |
GSList *cur, *next; |
|
| 222 | 226 |
gboolean strict_cache_check = prefs_common.strict_cache_check; |
| 223 | 227 |
|
| 224 | 228 |
if (item->stype == F_QUEUE || item->stype == F_DRAFT) |
| ... | ... | |
| 251 | 255 |
} else {
|
| 252 | 256 |
mlist = mh_get_uncached_msgs(NULL, item); |
| 253 | 257 |
item->cache_dirty = TRUE; |
| 258 |
newlist = mlist; |
|
| 254 | 259 |
} |
| 255 | 260 |
|
| 256 | 261 |
procmsg_set_flags(mlist, item); |
| ... | ... | |
| 277 | 282 |
procmsg_write_flags_list(item, mlist); |
| 278 | 283 |
} |
| 279 | 284 |
|
| 285 |
if (uncached_only) {
|
|
| 286 |
GSList *cur; |
|
| 287 |
|
|
| 288 |
if (newlist == NULL) {
|
|
| 289 |
procmsg_msg_list_free(mlist); |
|
| 290 |
return NULL; |
|
| 291 |
} |
|
| 292 |
if (mlist == newlist) |
|
| 293 |
return newlist; |
|
| 294 |
for (cur = mlist; cur != NULL; cur = cur->next) {
|
|
| 295 |
if (cur->next == newlist) {
|
|
| 296 |
cur->next = NULL; |
|
| 297 |
procmsg_msg_list_free(mlist); |
|
| 298 |
return newlist; |
|
| 299 |
} |
|
| 300 |
} |
|
| 301 |
procmsg_msg_list_free(mlist); |
|
| 302 |
return NULL; |
|
| 303 |
} |
|
| 304 |
|
|
| 280 | 305 |
return mlist; |
| 281 | 306 |
} |
| 282 | 307 |
|
| 308 |
static GSList *mh_get_msg_list(Folder *folder, FolderItem *item, |
|
| 309 |
gboolean use_cache) |
|
| 310 |
{
|
|
| 311 |
return mh_get_msg_list_full(folder, item, use_cache, FALSE); |
|
| 312 |
} |
|
| 313 |
|
|
| 314 |
static GSList *mh_get_uncached_msg_list(Folder *folder, FolderItem *item) |
|
| 315 |
{
|
|
| 316 |
return mh_get_msg_list_full(folder, item, TRUE, TRUE); |
|
| 317 |
} |
|
| 318 |
|
|
| 283 | 319 |
static gchar *mh_fetch_msg(Folder *folder, FolderItem *item, gint num) |
| 284 | 320 |
{
|
| 285 | 321 |
gchar *path; |
Also available in: Unified diff