1
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
5
* Authors: Michael Zucchi <notzed@ximian.com>
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of version 2 of the GNU Lesser General Public
9
* License as published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this program; if not, write to the
18
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
* Boston, MA 02110-1301, USA.
3
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
5
* Authors: Michael Zucchi <notzed@ximian.com>
7
* This library is free software you can redistribute it and/or modify it
8
* under the terms of the GNU Lesser General Public License as published by
9
* the Free Software Foundation.
11
* This library is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this library; if not, see <http://www.gnu.org/licenses/>.
22
20
#ifdef HAVE_CONFIG_H
187
176
g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary));
189
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
178
camel_folder_summary_lock (summary);
191
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_REF_LOCK);
192
180
g_hash_table_foreach_remove (summary->priv->loaded_infos, remove_each_item, &to_remove_infos);
193
camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_REF_LOCK);
195
g_slist_foreach (to_remove_infos, (GFunc) camel_message_info_free, NULL);
182
g_slist_foreach (to_remove_infos, (GFunc) camel_message_info_unref, NULL);
196
183
g_slist_free (to_remove_infos);
198
camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
185
camel_folder_summary_unlock (summary);
221
208
priv->timeout_handle = 0;
224
if (priv->filter_index != NULL) {
225
g_object_unref (priv->filter_index);
226
priv->filter_index = NULL;
229
if (priv->filter_64 != NULL) {
230
g_object_unref (priv->filter_64);
231
priv->filter_64 = NULL;
234
if (priv->filter_qp != NULL) {
235
g_object_unref (priv->filter_qp);
236
priv->filter_qp = NULL;
239
if (priv->filter_uu != NULL) {
240
g_object_unref (priv->filter_uu);
241
priv->filter_uu = NULL;
244
if (priv->filter_save != NULL) {
245
g_object_unref (priv->filter_save);
246
priv->filter_save = NULL;
249
if (priv->filter_html != NULL) {
250
g_object_unref (priv->filter_html);
251
priv->filter_html = NULL;
254
if (priv->filter_stream != NULL) {
255
g_object_unref (priv->filter_stream);
256
priv->filter_stream = NULL;
259
if (priv->index != NULL) {
260
g_object_unref (priv->index);
211
g_clear_object (&priv->filter_index);
212
g_clear_object (&priv->filter_64);
213
g_clear_object (&priv->filter_qp);
214
g_clear_object (&priv->filter_uu);
215
g_clear_object (&priv->filter_save);
216
g_clear_object (&priv->filter_html);
217
g_clear_object (&priv->filter_stream);
218
g_clear_object (&priv->filter_index);
264
220
if (priv->folder) {
265
221
g_object_weak_unref (G_OBJECT (priv->folder), (GWeakNotify) g_nullify_pointer, &priv->folder);
346
298
switch (property_id) {
347
299
case PROP_FOLDER:
348
300
g_value_set_object (
349
value, camel_folder_summary_get_folder (
302
camel_folder_summary_get_folder (
350
303
CAMEL_FOLDER_SUMMARY (object)));
353
306
case PROP_SAVED_COUNT:
354
307
g_value_set_uint (
355
value, camel_folder_summary_get_saved_count (
309
camel_folder_summary_get_saved_count (
356
310
CAMEL_FOLDER_SUMMARY (object)));
359
313
case PROP_UNREAD_COUNT:
360
314
g_value_set_uint (
361
value, camel_folder_summary_get_unread_count (
316
camel_folder_summary_get_unread_count (
362
317
CAMEL_FOLDER_SUMMARY (object)));
365
320
case PROP_DELETED_COUNT:
366
321
g_value_set_uint (
367
value, camel_folder_summary_get_deleted_count (
323
camel_folder_summary_get_deleted_count (
368
324
CAMEL_FOLDER_SUMMARY (object)));
371
327
case PROP_JUNK_COUNT:
372
328
g_value_set_uint (
373
value, camel_folder_summary_get_junk_count (
330
camel_folder_summary_get_junk_count (
374
331
CAMEL_FOLDER_SUMMARY (object)));
377
334
case PROP_JUNK_NOT_DELETED_COUNT:
378
335
g_value_set_uint (
379
value, camel_folder_summary_get_junk_not_deleted_count (
337
camel_folder_summary_get_junk_not_deleted_count (
380
338
CAMEL_FOLDER_SUMMARY (object)));
383
341
case PROP_VISIBLE_COUNT:
384
342
g_value_set_uint (
385
value, camel_folder_summary_get_visible_count (
344
camel_folder_summary_get_visible_count (
386
345
CAMEL_FOLDER_SUMMARY (object)));
389
348
case PROP_BUILD_CONTENT:
390
349
g_value_set_boolean (
391
value, camel_folder_summary_get_build_content (
351
camel_folder_summary_get_build_content (
392
352
CAMEL_FOLDER_SUMMARY (object)));
395
355
case PROP_NEED_PREVIEW:
396
356
g_value_set_boolean (
397
value, camel_folder_summary_get_need_preview (
358
camel_folder_summary_get_need_preview (
398
359
CAMEL_FOLDER_SUMMARY (object)));
1977
1935
return class->message_info_from_uid (summary, uid);
1939
* camel_folder_summary_get_info_flags:
1940
* @summary: a #CamelFolderSummary object
1943
* Retrieve CamelMessageInfo::flags for a message info with UID @uid.
1944
* This is much quicker than camel_folder_summary_get(), because it
1945
* doesn't require reading the message info from a disk.
1947
* Returns: the flags currently stored for message info with UID @uid,
1953
camel_folder_summary_get_info_flags (CamelFolderSummary *summary,
1956
gpointer ptr_uid = NULL, ptr_flags = NULL;
1958
g_return_val_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary), (~0));
1959
g_return_val_if_fail (uid != NULL, (~0));
1961
camel_folder_summary_lock (summary);
1962
if (!g_hash_table_lookup_extended (summary->priv->uids, uid, &ptr_uid, &ptr_flags)) {
1963
camel_folder_summary_unlock (summary);
1967
camel_folder_summary_unlock (summary);
1969
return GPOINTER_TO_UINT (ptr_flags);
1980
1972
static CamelMessageContentInfo *
1981
1973
perform_content_info_load_from_db (CamelFolderSummary *summary,
1982
1974
CamelMIRecord *mir)
2109
2101
if (time (NULL) - summary->priv->cache_load_time < SUMMARY_CACHE_DROP)
2112
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2104
camel_folder_summary_lock (summary);
2114
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_REF_LOCK);
2115
2106
g_hash_table_foreach_remove (summary->priv->loaded_infos, (GHRFunc) remove_item, &to_remove_infos);
2116
camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_REF_LOCK);
2118
g_slist_foreach (to_remove_infos, (GFunc) camel_message_info_free, NULL);
2108
g_slist_foreach (to_remove_infos, (GFunc) camel_message_info_unref, NULL);
2119
2109
g_slist_free (to_remove_infos);
2121
camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2111
camel_folder_summary_unlock (summary);
2123
2113
summary->priv->cache_load_time = time (NULL);
2284
2277
g_hash_table_destroy (preview_data);
2287
camel_folder_summary_lock (folder->summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2280
camel_folder_summary_lock (folder->summary);
2288
2281
g_hash_table_foreach (folder->summary->priv->loaded_infos, (GHFunc) pick_uids, uids_uncached);
2289
camel_folder_summary_unlock (folder->summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2282
camel_folder_summary_unlock (folder->summary);
2291
2284
for (i = 0; i < uids_uncached->len; i++) {
2292
2285
g_hash_table_remove (uids_hash, uids_uncached->pdata[i]);
2295
camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK);
2288
camel_folder_lock (folder);
2296
2289
if (!is_in_memory)
2297
2290
camel_db_begin_transaction (parent_store->cdb_w, NULL);
2298
2291
g_hash_table_foreach (uids_hash, (GHFunc) msg_update_preview, folder);
2299
2292
if (!is_in_memory)
2300
2293
camel_db_end_transaction (parent_store->cdb_w, NULL);
2301
camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK);
2294
camel_folder_unlock (folder);
2302
2295
camel_folder_free_uids (folder, uids_uncached);
2303
2296
g_hash_table_destroy (uids_hash);
2342
2333
cfs_schedule_info_release_timer (summary);
2344
if (summary->priv->need_preview)
2345
camel_session_submit_job (
2347
(CamelSessionCallback) preview_update,
2348
g_object_ref (summary->priv->folder),
2349
(GDestroyNotify) g_object_unref);
2335
/* FIXME Convert this to a GTask, submitted through
2336
* camel_service_queue_task(). Then it won't
2337
* have to call camel_folder_lock/unlock(). */
2338
if (summary->priv->need_preview) {
2339
CamelSession *session;
2351
g_object_unref (session);
2341
/* This may not be available in a case of this being called as part
2342
of CamelSession's dispose, because the CamelService uses GWeakRef
2343
object which is invalidates its content when it reaches the dispose. */
2344
session = camel_service_ref_session (CAMEL_SERVICE (parent_store));
2346
camel_session_submit_job (
2348
(CamelSessionCallback) preview_update,
2349
g_object_ref (summary->priv->folder),
2350
(GDestroyNotify) g_object_unref);
2351
g_object_unref (session);
2353
2355
return ret == 0 ? 0 : -1;
2567
2569
mir = g_new0 (CamelMIRecord , 1);
2568
2570
mir_from_cols (mir, summary, &data->columns_hash, ncol, cols, name);
2570
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2572
camel_folder_summary_lock (summary);
2571
2573
if (!mir->uid || g_hash_table_lookup (summary->priv->loaded_infos, mir->uid)) {
2572
2574
/* Unlock and better return */
2573
camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2575
camel_folder_summary_unlock (summary);
2574
2576
camel_db_camel_mir_free (mir);
2577
camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2579
camel_folder_summary_unlock (summary);
2579
2581
info = CAMEL_FOLDER_SUMMARY_GET_CLASS (summary)->message_info_from_db (summary, mir);
2681
2676
g_return_if_fail (mir != NULL);
2683
if (!args->migration) {
2684
if (camel_db_write_message_info_record (cdb, full_name, mir, error) != 0) {
2685
camel_db_camel_mir_free (mir);
2689
if (camel_db_write_fresh_message_info_record (cdb, CAMEL_DB_IN_MEMORY_TABLE, mir, error) != 0) {
2690
camel_db_camel_mir_free (mir);
2694
if (args->progress > CAMEL_DB_IN_MEMORY_TABLE_LIMIT) {
2695
g_print ("BULK INsert limit reached \n");
2696
camel_db_flush_in_memory_transactions (cdb, full_name, error);
2697
camel_db_start_in_memory_transactions (cdb, error);
2678
if (camel_db_write_message_info_record (cdb, full_name, mir, error) != 0) {
2679
camel_db_camel_mir_free (mir);
2704
2683
/* Reset the dirty flag which decides if the changes are synced to the DB or not.
2733
2706
if (camel_db_prepare_message_info_table (cdb, full_name, error) != 0)
2736
camel_folder_summary_lock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2709
camel_folder_summary_lock (summary);
2738
2711
/* Push MessageInfo-es */
2739
2712
camel_db_begin_transaction (cdb, NULL);
2740
g_hash_table_foreach (summary->priv->loaded_infos, save_to_db_cb, &args);
2713
g_hash_table_foreach (summary->priv->loaded_infos, save_to_db_cb, error);
2741
2714
camel_db_end_transaction (cdb, NULL);
2743
camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
2716
camel_folder_summary_unlock (summary);
2744
2717
cfs_schedule_info_release_timer (summary);
3064
3037
/* Summary always holds a ref for the loaded infos */
3065
3038
g_hash_table_insert (summary->priv->loaded_infos, (gchar *) camel_message_info_uid (info), info);
3067
camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
3071
* camel_folder_summary_add_from_header:
3072
* @summary: a #CamelFolderSummary object
3073
* @headers: rfc822 headers
3075
* Build a new info record based on a set of headers, and add it to
3078
* Note that this function should not be used if build_content_info
3079
* has been specified for this summary.
3081
* Returns: the newly added record
3084
camel_folder_summary_add_from_header (CamelFolderSummary *summary,
3085
struct _camel_header_raw *h)
3087
CamelMessageInfo *info;
3089
g_return_val_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary), NULL);
3091
info = camel_folder_summary_info_new_from_header (summary, h);
3093
camel_folder_summary_add (summary, info);
3099
* camel_folder_summary_add_from_parser:
3100
* @summary: a #CamelFolderSummary object
3101
* @parser: a #CamelMimeParser object
3103
* Build a new info record based on the current position of a #CamelMimeParser.
3105
* The parser should be positioned before the start of the message to summarise.
3106
* This function may be used if build_contnet_info or an index has been
3107
* specified for the summary.
3109
* Returns: the newly added record
3112
camel_folder_summary_add_from_parser (CamelFolderSummary *summary,
3113
CamelMimeParser *mp)
3115
CamelMessageInfo *info;
3117
g_return_val_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary), NULL);
3118
g_return_val_if_fail (CAMEL_IS_MIME_PARSER (mp), NULL);
3120
info = camel_folder_summary_info_new_from_parser (summary, mp);
3122
camel_folder_summary_add (summary, info);
3128
* camel_folder_summary_add_from_message:
3129
* @summary: a #CamelFolderSummary object
3130
* @message: a #CamelMimeMessage object
3132
* Add a summary item from an existing message.
3134
* Returns: the newly added record
3137
camel_folder_summary_add_from_message (CamelFolderSummary *summary,
3138
CamelMimeMessage *msg)
3140
CamelMessageInfo *info = camel_folder_summary_info_new_from_message (summary, msg, NULL);
3142
camel_folder_summary_add (summary, info);
3040
camel_folder_summary_unlock (summary);
4622
* camel_message_info_free:
4510
* camel_message_info_unref:
4623
4511
* @info: a #CamelMessageInfo
4625
4513
* Unref's and potentially frees a #CamelMessageInfo and its contents.
4628
camel_message_info_free (gpointer o)
4516
camel_message_info_unref (gpointer o)
4630
4518
CamelMessageInfo *mi = o;
4632
4520
g_return_if_fail (mi != NULL);
4635
camel_folder_summary_lock (mi->summary, CAMEL_FOLDER_SUMMARY_REF_LOCK);
4637
if (mi->refcount >= 1)
4639
if (mi->refcount > 0) {
4640
camel_folder_summary_unlock (mi->summary, CAMEL_FOLDER_SUMMARY_REF_LOCK);
4644
camel_folder_summary_unlock (mi->summary, CAMEL_FOLDER_SUMMARY_REF_LOCK);
4646
/* FIXME: this is kinda busted, should really be handled by message info free */
4647
if (mi->summary->priv->build_content
4648
&& ((CamelMessageInfoBase *) mi)->content) {
4649
camel_folder_summary_content_info_free (mi->summary, ((CamelMessageInfoBase *) mi)->content);
4650
((CamelMessageInfoBase *) mi)->content = NULL;
4653
CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->message_info_free (mi->summary, mi);
4655
GLOBAL_INFO_LOCK (info);
4657
if (mi->refcount > 0) {
4658
GLOBAL_INFO_UNLOCK (info);
4661
GLOBAL_INFO_UNLOCK (info);
4663
message_info_free (NULL, mi);
4521
g_return_if_fail (mi->refcount > 0);
4523
if (g_atomic_int_dec_and_test (&mi->refcount)) {
4524
if (mi->summary != NULL) {
4525
CamelFolderSummaryClass *class;
4527
/* FIXME This is kinda busted, should really
4528
* be handled by message_info_free(). */
4529
if (mi->summary->priv->build_content
4530
&& ((CamelMessageInfoBase *) mi)->content) {
4531
camel_folder_summary_content_info_free (
4533
((CamelMessageInfoBase *) mi)->content);
4534
((CamelMessageInfoBase *) mi)->content = NULL;
4537
class = CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary);
4538
g_return_if_fail (class->message_info_free != NULL);
4540
class->message_info_free (mi->summary, mi);
4542
message_info_free (NULL, mi);
4789
4669
* Returns: %TRUE if any of the flags changed or %FALSE otherwise
4792
camel_message_info_set_flags (CamelMessageInfo *mi,
4672
camel_message_info_set_flags (CamelMessageInfo *info,
4793
4673
CamelMessageFlags flags,
4797
return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_set_flags (mi, flags, set);
4677
return CAMEL_FOLDER_SUMMARY_GET_CLASS (info->summary)->info_set_flags (info, flags, set);
4799
return info_set_flags (mi, flags, set);
4679
return info_set_flags (info, flags, set);
4803
4683
* camel_message_info_set_user_flag:
4804
* @mi: a #CamelMessageInfo
4684
* @info: a #CamelMessageInfo
4805
4685
* @id: name of the user flag to set
4806
4686
* @state: state to set the flag to
4810
4690
* Returns: %TRUE if the state changed or %FALSE otherwise
4813
camel_message_info_set_user_flag (CamelMessageInfo *mi,
4693
camel_message_info_set_user_flag (CamelMessageInfo *info,
4814
4694
const gchar *id,
4815
4695
gboolean state)
4818
return CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->info_set_user_flag (mi, id, state);
4698
return CAMEL_FOLDER_SUMMARY_GET_CLASS (info->summary)->info_set_user_flag (info, id, state);
4820
return info_set_user_flag (mi, id, state);
4700
return info_set_user_flag (info, id, state);
4824
4704
* camel_message_info_set_user_tag:
4825
* @mi: a #CamelMessageInfo
4705
* @info: a #CamelMessageInfo
4826
4706
* @id: name of the user tag to set
4827
4707
* @val: value to set
4881
camel_message_info_dump (CamelMessageInfo *mi)
4761
camel_message_info_dump (CamelMessageInfo *info)
4884
4764
printf ("No message?\n");
4888
printf ("Subject: %s\n", camel_message_info_subject (mi));
4889
printf ("To: %s\n", camel_message_info_to (mi));
4890
printf ("Cc: %s\n", camel_message_info_cc (mi));
4891
printf ("mailing list: %s\n", camel_message_info_mlist (mi));
4892
printf ("From: %s\n", camel_message_info_from (mi));
4893
printf ("UID: %s\n", camel_message_info_uid (mi));
4894
printf ("Flags: %04x\n", camel_message_info_flags (mi));
4895
camel_content_info_dump (((CamelMessageInfoBase *) mi)->content, 0);
4899
compare_strings (const gchar *str1,
4902
if (str1 && str2 && !g_ascii_strcasecmp (str1, str2))
4904
else if (!str1 && !str2)
4911
match_content_type (CamelContentType *info_ctype,
4912
CamelContentType *ctype)
4914
const gchar *name1, *name2;
4916
if (!compare_strings (info_ctype->type, ctype->type))
4918
if (!compare_strings (info_ctype->subtype, ctype->subtype))
4921
name1 = camel_content_type_param (info_ctype, "name");
4922
name2 = camel_content_type_param (ctype, "name");
4923
if (!compare_strings (name1, name2))
4930
* camel_folder_summary_guess_content_info:
4931
* @mi: a #CamelMessageInfo
4932
* @ctype: a #CamelContentType
4934
* FIXME Document me!
4938
const CamelMessageContentInfo *
4939
camel_folder_summary_guess_content_info (CamelMessageInfo *mi,
4940
CamelContentType *ctype)
4942
const CamelMessageContentInfo *ci = camel_message_info_content (mi);
4945
const CamelMessageContentInfo *child = ci;
4948
if (child->type && match_content_type (child->type, ctype))
4951
child = child->next;
4952
} while (child != NULL);
4768
printf ("Subject: %s\n", camel_message_info_subject (info));
4769
printf ("To: %s\n", camel_message_info_to (info));
4770
printf ("Cc: %s\n", camel_message_info_cc (info));
4771
printf ("mailing list: %s\n", camel_message_info_mlist (info));
4772
printf ("From: %s\n", camel_message_info_from (info));
4773
printf ("UID: %s\n", camel_message_info_uid (info));
4774
printf ("Flags: %04x\n", camel_message_info_flags (info));
4775
camel_content_info_dump (((CamelMessageInfoBase *) info)->content, 0);
4961
4779
* camel_folder_summary_lock:
4962
4780
* @summary: a #CamelFolderSummary
4963
* @lock: lock type to lock
4965
* Locks @summary's @lock. Unlock it with camel_folder_summary_unlock().
4782
* Locks @summary. Unlock it with camel_folder_summary_unlock().
4970
camel_folder_summary_lock (CamelFolderSummary *summary,
4971
CamelFolderSummaryLock lock)
4787
camel_folder_summary_lock (CamelFolderSummary *summary)
4973
4789
g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary));
4976
case CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK:
4977
g_rec_mutex_lock (&summary->priv->summary_lock);
4979
case CAMEL_FOLDER_SUMMARY_IO_LOCK:
4980
g_rec_mutex_lock (&summary->priv->io_lock);
4982
case CAMEL_FOLDER_SUMMARY_FILTER_LOCK:
4983
g_rec_mutex_lock (&summary->priv->filter_lock);
4985
case CAMEL_FOLDER_SUMMARY_ALLOC_LOCK:
4986
g_rec_mutex_lock (&summary->priv->alloc_lock);
4988
case CAMEL_FOLDER_SUMMARY_REF_LOCK:
4989
g_rec_mutex_lock (&summary->priv->ref_lock);
4992
g_return_if_reached ();
4791
g_rec_mutex_lock (&summary->priv->summary_lock);
4997
4795
* camel_folder_summary_unlock:
4998
4796
* @summary: a #CamelFolderSummary
4999
* @lock: lock type to unlock
5001
* Unlocks @summary's @lock, previously locked with camel_folder_summary_lock().
4798
* Unlocks @summary, previously locked with camel_folder_summary_lock().
5006
camel_folder_summary_unlock (CamelFolderSummary *summary,
5007
CamelFolderSummaryLock lock)
4803
camel_folder_summary_unlock (CamelFolderSummary *summary)
5009
4805
g_return_if_fail (CAMEL_IS_FOLDER_SUMMARY (summary));
5012
case CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK:
5013
g_rec_mutex_unlock (&summary->priv->summary_lock);
5015
case CAMEL_FOLDER_SUMMARY_IO_LOCK:
5016
g_rec_mutex_unlock (&summary->priv->io_lock);
5018
case CAMEL_FOLDER_SUMMARY_FILTER_LOCK:
5019
g_rec_mutex_unlock (&summary->priv->filter_lock);
5021
case CAMEL_FOLDER_SUMMARY_ALLOC_LOCK:
5022
g_rec_mutex_unlock (&summary->priv->alloc_lock);
5024
case CAMEL_FOLDER_SUMMARY_REF_LOCK:
5025
g_rec_mutex_unlock (&summary->priv->ref_lock);
5028
g_return_if_reached ();
4807
g_rec_mutex_unlock (&summary->priv->summary_lock);