~ubuntu-branches/ubuntu/saucy/evolution-data-server/saucy

« back to all changes in this revision

Viewing changes to camel/camel-vee-store.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-10-08 12:58:16 UTC
  • mfrom: (181.1.7 quantal)
  • Revision ID: package-import@ubuntu.com-20121008125816-i3n76e8c0m64e7xp
Tags: 3.6.0-0ubuntu2
* Fix LP: #1038047 part 1 - Don't abort in e_source_registry_new* when a
  problem occurs connecting to the Dbus service
  - add debian/patches/dont-abort-in-e_source_registry_new.patch
  - update debian/patches/series
* Fix LP: #1038047 part 2 - libedataserver depends on
  evolution-data-server-common to ensure that the GSettings schemas are
  present
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
        GHashTable *infos_hash;
267
267
        gint i;
268
268
 
269
 
        d (printf ("Get folder info '%s'\n", top?top:"<null>"));
 
269
        d (printf ("Get folder info '%s'\n", top ? top:"<null>"));
270
270
 
271
271
        infos_hash = g_hash_table_new (g_str_hash, g_str_equal);
272
272
        folders = camel_object_bag_list (store->folders);
560
560
        return g_object_new (CAMEL_TYPE_VEE_STORE, NULL);
561
561
}
562
562
 
 
563
/**
 
564
 * camel_vee_store_get_vee_data_cache:
 
565
 *
 
566
 * FIXME Document me!
 
567
 *
 
568
 * Since: 3.6
 
569
 **/
563
570
CamelVeeDataCache *
564
571
camel_vee_store_get_vee_data_cache (CamelVeeStore *vstore)
565
572
{
568
575
        return vstore->priv->vee_data_cache;
569
576
}
570
577
 
 
578
/**
 
579
 * camel_vee_store_get_unmatched_folder:
 
580
 *
 
581
 * FIXME Document me!
 
582
 *
 
583
 * Since: 3.6
 
584
 **/
571
585
CamelVeeFolder *
572
586
camel_vee_store_get_unmatched_folder (CamelVeeStore *vstore)
573
587
{
579
593
        return vstore->priv->unmatched_folder;
580
594
}
581
595
 
 
596
/**
 
597
 * camel_vee_store_get_unmatched_enabled:
 
598
 *
 
599
 * FIXME Document me!
 
600
 *
 
601
 * Since: 3.6
 
602
 **/
582
603
gboolean
583
604
camel_vee_store_get_unmatched_enabled (CamelVeeStore *vstore)
584
605
{
587
608
        return vstore->priv->unmatched_enabled;
588
609
}
589
610
 
 
611
/**
 
612
 * camel_vee_store_set_unmatched_enabled:
 
613
 *
 
614
 * FIXME Document me!
 
615
 *
 
616
 * Since: 3.6
 
617
 **/
590
618
void
591
619
camel_vee_store_set_unmatched_enabled (CamelVeeStore *vstore,
592
620
                                       gboolean is_enabled)
595
623
 
596
624
        g_return_if_fail (CAMEL_IS_VEE_STORE (vstore));
597
625
 
598
 
        if ((vstore->priv->unmatched_enabled ? 1 : 0) == (is_enabled ? 1 : 0))
 
626
        if (vstore->priv->unmatched_enabled == is_enabled)
599
627
                return;
600
628
 
601
629
        vstore->priv->unmatched_enabled = is_enabled;
613
641
        camel_folder_info_free (fi_unmatched);
614
642
}
615
643
 
616
 
struct AddToUnmatchedData
617
 
{
 
644
struct AddToUnmatchedData {
618
645
        CamelVeeFolder *unmatched_folder;
619
646
        CamelFolderChangeInfo *changes;
620
647
        gboolean unmatched_enabled;
632
659
        g_return_if_fail (atud != NULL);
633
660
 
634
661
        vuid = camel_vee_message_info_data_get_vee_message_uid (mi_data);
635
 
        g_hash_table_insert (atud->vuid_usage_counts,
636
 
                (gpointer) camel_pstring_strdup (vuid), GINT_TO_POINTER (0));
 
662
        g_hash_table_insert (
 
663
                atud->vuid_usage_counts,
 
664
                (gpointer) camel_pstring_strdup (vuid),
 
665
                GINT_TO_POINTER (0));
637
666
 
638
667
        if (atud->unmatched_enabled)
639
668
                camel_vee_folder_add_vuid (atud->unmatched_folder, mi_data, atud->changes);
640
669
}
641
670
 
 
671
/**
 
672
 * camel_vee_store_note_subfolder_used:
 
673
 *
 
674
 * FIXME Document me!
 
675
 *
 
676
 * Since: 3.6
 
677
 **/
642
678
void
643
679
camel_vee_store_note_subfolder_used (CamelVeeStore *vstore,
644
680
                                     CamelFolder *subfolder,
659
695
 
660
696
        counts = GPOINTER_TO_INT (g_hash_table_lookup (vstore->priv->subfolder_usage_counts, subfolder));
661
697
        counts++;
662
 
        g_hash_table_insert (vstore->priv->subfolder_usage_counts, subfolder, GINT_TO_POINTER (counts));
 
698
        g_hash_table_insert (
 
699
                vstore->priv->subfolder_usage_counts,
 
700
                subfolder, GINT_TO_POINTER (counts));
663
701
 
664
702
        if (counts == 1) {
665
703
                struct AddToUnmatchedData atud;
709
747
        g_hash_table_remove (vuid_usage_counts, camel_vee_message_info_data_get_vee_message_uid (mi_data));
710
748
}
711
749
 
 
750
/**
 
751
 * camel_vee_store_note_subfolder_unused:
 
752
 *
 
753
 * FIXME Document me!
 
754
 *
 
755
 * Since: 3.6
 
756
 **/
712
757
void
713
758
camel_vee_store_note_subfolder_unused (CamelVeeStore *vstore,
714
759
                                       CamelFolder *subfolder,
743
788
 
744
789
                camel_vee_data_cache_remove_subfolder (vstore->priv->vee_data_cache, subfolder);
745
790
        } else {
746
 
                g_hash_table_insert (vstore->priv->subfolder_usage_counts, subfolder, GINT_TO_POINTER (counts));
 
791
                g_hash_table_insert (
 
792
                        vstore->priv->subfolder_usage_counts,
 
793
                        subfolder, GINT_TO_POINTER (counts));
747
794
        }
748
795
 
749
796
        g_mutex_unlock (vstore->priv->sf_counts_mutex);
750
797
}
751
798
 
 
799
/**
 
800
 * camel_vee_store_note_vuid_used:
 
801
 *
 
802
 * FIXME Document me!
 
803
 *
 
804
 * Since: 3.6
 
805
 **/
752
806
void
753
807
camel_vee_store_note_vuid_used (CamelVeeStore *vstore,
754
808
                                CamelVeeMessageInfoData *mi_data,
779
833
 
780
834
        counts = GPOINTER_TO_INT (g_hash_table_lookup (vstore->priv->vuid_usage_counts, vuid));
781
835
        counts++;
782
 
        g_hash_table_insert (vstore->priv->vuid_usage_counts,
783
 
                (gpointer) camel_pstring_strdup (vuid), GINT_TO_POINTER (counts));
 
836
        g_hash_table_insert (
 
837
                vstore->priv->vuid_usage_counts,
 
838
                (gpointer) camel_pstring_strdup (vuid),
 
839
                GINT_TO_POINTER (counts));
784
840
 
785
841
        if (counts == 1 && camel_vee_store_get_unmatched_enabled (vstore)) {
786
842
                CamelFolderChangeInfo *changes;
797
853
        g_mutex_unlock (vstore->priv->vu_counts_mutex);
798
854
}
799
855
 
 
856
/**
 
857
 * camel_vee_store_note_vuid_unused:
 
858
 *
 
859
 * FIXME Document me!
 
860
 *
 
861
 * Since: 3.6
 
862
 **/
800
863
void
801
864
camel_vee_store_note_vuid_unused (CamelVeeStore *vstore,
802
865
                                  CamelVeeMessageInfoData *mi_data,
833
896
                return;
834
897
        }
835
898
 
836
 
        g_hash_table_insert (vstore->priv->vuid_usage_counts,
837
 
                (gpointer) camel_pstring_strdup (vuid), GINT_TO_POINTER (counts));
 
899
        g_hash_table_insert (
 
900
                vstore->priv->vuid_usage_counts,
 
901
                (gpointer) camel_pstring_strdup (vuid),
 
902
                GINT_TO_POINTER (counts));
838
903
 
839
904
        if (counts == 0 && camel_vee_store_get_unmatched_enabled (vstore)) {
840
905
                CamelFolderChangeInfo *changes;
851
916
        g_mutex_unlock (vstore->priv->vu_counts_mutex);
852
917
}
853
918
 
854
 
struct RebuildUnmatchedData
855
 
{
 
919
struct RebuildUnmatchedData {
856
920
        CamelVeeDataCache *data_cache;
857
921
        CamelVeeFolder *unmatched_folder;
858
922
        CamelFolderChangeInfo *changes;
932
996
        g_cancellable_set_error_if_cancelled (cancellable, error);
933
997
}
934
998
 
 
999
/**
 
1000
 * camel_vee_store_rebuild_unmatched_folder:
 
1001
 *
 
1002
 * FIXME Document me!
 
1003
 *
 
1004
 * Since: 3.6
 
1005
 **/
935
1006
void
936
1007
camel_vee_store_rebuild_unmatched_folder (CamelVeeStore *vstore,
937
1008
                                          GCancellable *cancellable,