~ken-vandine/ubuntu/precise/folks/precise

« back to all changes in this revision

Viewing changes to folks/individual-aggregator.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-12-21 17:40:15 UTC
  • mfrom: (1.2.5 upstream) (4.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221174015-4o0mdnok2a83mcch
Tags: 0.3.3-1ubuntu1
* Merge with Debian experimental, remaining Ubuntu changes:
* debian/control:
  - Build-depend on dh-autoreconf
  - Bump build-depends on valac-0.12, libvala-0.12-dev
  - Add Vcs-Bzr link
* debian/rules:
  - Build with autoreconf

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* individual-aggregator.c generated by valac 0.11.2.11-bbde6, the Vala compiler
 
1
/* individual-aggregator.c generated by valac 0.11.2.25-30b2-dirty, the Vala compiler
2
2
 * generated from individual-aggregator.vala, do not modify */
3
3
 
4
4
/*
1596
1596
        }
1597
1597
        _tmp2_ = folks_persona_get_uid (persona);
1598
1598
        _tmp3_ = folks_persona_get_iid (persona);
1599
 
        g_debug ("individual-aggregator.vala:562:     %s (is user: %s, IID: %s)", _tmp2_, _tmp0_, _tmp3_);
 
1599
        g_debug ("individual-aggregator.vala:564:     %s (is user: %s, IID: %s)", _tmp2_, _tmp0_, _tmp3_);
1600
1600
        gee_abstract_collection_add ((GeeAbstractCollection*) _data15_->removed_personas, persona);
1601
1601
        _tmp4_ = folks_persona_get_iid (persona);
1602
1602
        _tmp5_ = g_hash_table_lookup (self->priv->link_map, _tmp4_);
1624
1624
        GeeHashMap* replaced_individuals;
1625
1625
        GList* relinked_personas;
1626
1626
        GeeHashSet* _tmp1_ = NULL;
1627
 
        FolksIndividual* _tmp2_;
 
1627
        GeeHashSet* relinked_personas_set;
 
1628
        GeeHashSet* _tmp2_ = NULL;
 
1629
        FolksIndividual* _tmp3_;
1628
1630
        FolksIndividual* user;
1629
 
        gboolean _tmp19_ = FALSE;
1630
 
        GeeMapIterator* _tmp20_ = NULL;
 
1631
        gboolean _tmp22_ = FALSE;
 
1632
        GeeMapIterator* _tmp23_ = NULL;
1631
1633
        GeeMapIterator* iter;
1632
1634
        g_return_if_fail (self != NULL);
1633
1635
        g_return_if_fail (store != NULL);
1640
1642
        replaced_individuals = _tmp0_;
1641
1643
        relinked_personas = NULL;
1642
1644
        _tmp1_ = gee_hash_set_new (FOLKS_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_hash, g_direct_equal);
1643
 
        _data15_->removed_personas = _tmp1_;
1644
 
        _tmp2_ = _g_object_ref0 (self->priv->_user);
1645
 
        user = _tmp2_;
 
1645
        relinked_personas_set = _tmp1_;
 
1646
        _tmp2_ = gee_hash_set_new (FOLKS_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, g_direct_hash, g_direct_equal);
 
1647
        _data15_->removed_personas = _tmp2_;
 
1648
        _tmp3_ = _g_object_ref0 (self->priv->_user);
 
1649
        user = _tmp3_;
1646
1650
        if (added != NULL) {
1647
1651
                folks_individual_aggregator_add_personas (self, added, &added_individuals, &replaced_individuals, &user);
1648
1652
        }
1649
 
        g_debug ("individual-aggregator.vala:556: Removing Personas:");
 
1653
        g_debug ("individual-aggregator.vala:558: Removing Personas:");
1650
1654
        g_list_foreach (removed, __lambda24__gfunc, _data15_);
1651
 
        g_debug ("individual-aggregator.vala:587: Removing Individuals due to removed li" \
 
1655
        g_debug ("individual-aggregator.vala:589: Removing Individuals due to removed li" \
1652
1656
"nks:");
1653
1657
        {
1654
1658
                GList* individual_collection;
1655
1659
                GList* individual_it;
1656
1660
                individual_collection = _data15_->removed_individuals;
1657
1661
                for (individual_it = individual_collection; individual_it != NULL; individual_it = individual_it->next) {
1658
 
                        FolksIndividual* _tmp3_;
 
1662
                        FolksIndividual* _tmp4_;
1659
1663
                        FolksIndividual* individual;
1660
 
                        _tmp3_ = _g_object_ref0 ((FolksIndividual*) individual_it->data);
1661
 
                        individual = _tmp3_;
 
1664
                        _tmp4_ = _g_object_ref0 ((FolksIndividual*) individual_it->data);
 
1665
                        individual = _tmp4_;
1662
1666
                        {
1663
 
                                const gchar* _tmp4_ = NULL;
1664
 
                                gconstpointer _tmp5_ = NULL;
1665
 
                                const gchar* _tmp6_ = NULL;
1666
 
                                GList* _tmp7_ = NULL;
1667
 
                                const gchar* _tmp11_ = NULL;
1668
 
                                _tmp4_ = folks_individual_get_id (individual);
1669
 
                                _tmp5_ = g_hash_table_lookup (self->priv->_individuals, _tmp4_);
1670
 
                                if (((FolksIndividual*) _tmp5_) == NULL) {
 
1667
                                const gchar* _tmp5_ = NULL;
 
1668
                                gconstpointer _tmp6_ = NULL;
 
1669
                                const gchar* _tmp7_ = NULL;
 
1670
                                GList* _tmp8_ = NULL;
 
1671
                                const gchar* _tmp14_ = NULL;
 
1672
                                _tmp5_ = folks_individual_get_id (individual);
 
1673
                                _tmp6_ = g_hash_table_lookup (self->priv->_individuals, _tmp5_);
 
1674
                                if (((FolksIndividual*) _tmp6_) == NULL) {
1671
1675
                                        _g_object_unref0 (individual);
1672
1676
                                        continue;
1673
1677
                                }
1674
 
                                _tmp6_ = folks_individual_get_id (individual);
1675
 
                                g_debug ("individual-aggregator.vala:594:     %s", _tmp6_);
1676
 
                                _tmp7_ = folks_individual_get_personas (individual);
 
1678
                                _tmp7_ = folks_individual_get_id (individual);
 
1679
                                g_debug ("individual-aggregator.vala:596:     %s", _tmp7_);
 
1680
                                _tmp8_ = folks_individual_get_personas (individual);
1677
1681
                                {
1678
1682
                                        GList* persona_collection;
1679
1683
                                        GList* persona_it;
1680
 
                                        persona_collection = _tmp7_;
 
1684
                                        persona_collection = _tmp8_;
1681
1685
                                        for (persona_it = persona_collection; persona_it != NULL; persona_it = persona_it->next) {
1682
1686
                                                FolksPersona* persona;
1683
1687
                                                persona = (FolksPersona*) persona_it->data;
1684
1688
                                                {
1685
 
                                                        gboolean _tmp8_;
1686
 
                                                        FolksPersona* _tmp9_;
1687
 
                                                        _tmp8_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _data15_->removed_personas, persona);
1688
 
                                                        if (_tmp8_ == TRUE) {
 
1689
                                                        gboolean _tmp9_ = FALSE;
 
1690
                                                        gboolean _tmp10_;
 
1691
                                                        FolksPersona* _tmp12_;
 
1692
                                                        _tmp10_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _data15_->removed_personas, persona);
 
1693
                                                        if (_tmp10_ == TRUE) {
 
1694
                                                                _tmp9_ = TRUE;
 
1695
                                                        } else {
 
1696
                                                                gboolean _tmp11_;
 
1697
                                                                _tmp11_ = gee_abstract_collection_contains ((GeeAbstractCollection*) relinked_personas_set, persona);
 
1698
                                                                _tmp9_ = _tmp11_ == TRUE;
 
1699
                                                        }
 
1700
                                                        if (_tmp9_) {
1689
1701
                                                                continue;
1690
1702
                                                        }
1691
 
                                                        _tmp9_ = _g_object_ref0 (persona);
1692
 
                                                        relinked_personas = g_list_prepend (relinked_personas, _tmp9_);
 
1703
                                                        _tmp12_ = _g_object_ref0 (persona);
 
1704
                                                        relinked_personas = g_list_prepend (relinked_personas, _tmp12_);
 
1705
                                                        gee_abstract_collection_add ((GeeAbstractCollection*) relinked_personas_set, persona);
1693
1706
                                                        folks_individual_aggregator_remove_persona_from_link_map (self, persona);
1694
1707
                                                }
1695
1708
                                        }
1696
1709
                                }
1697
1710
                                if (user == individual) {
1698
 
                                        FolksIndividual* _tmp10_;
1699
 
                                        _tmp10_ = NULL;
 
1711
                                        FolksIndividual* _tmp13_;
 
1712
                                        _tmp13_ = NULL;
1700
1713
                                        _g_object_unref0 (user);
1701
 
                                        user = _tmp10_;
 
1714
                                        user = _tmp13_;
1702
1715
                                }
1703
 
                                _tmp11_ = folks_individual_get_id (individual);
1704
 
                                g_hash_table_remove (self->priv->_individuals, _tmp11_);
 
1716
                                _tmp14_ = folks_individual_get_id (individual);
 
1717
                                g_hash_table_remove (self->priv->_individuals, _tmp14_);
1705
1718
                                folks_individual_set_personas (individual, NULL);
1706
1719
                                _g_object_unref0 (individual);
1707
1720
                        }
1708
1721
                }
1709
1722
        }
1710
 
        g_debug ("individual-aggregator.vala:616: Relinking Personas:");
 
1723
        g_debug ("individual-aggregator.vala:620: Relinking Personas:");
1711
1724
        {
1712
1725
                GList* persona_collection;
1713
1726
                GList* persona_it;
1716
1729
                        FolksPersona* persona;
1717
1730
                        persona = (FolksPersona*) persona_it->data;
1718
1731
                        {
1719
 
                                const gchar* _tmp12_;
1720
 
                                gboolean _tmp13_;
1721
 
                                const gchar* _tmp14_ = NULL;
1722
 
                                const gchar* _tmp15_ = NULL;
1723
 
                                _tmp12_ = NULL;
1724
 
                                _tmp13_ = folks_persona_get_is_user (persona);
1725
 
                                if (_tmp13_) {
1726
 
                                        _tmp12_ = "yes";
 
1732
                                const gchar* _tmp15_;
 
1733
                                gboolean _tmp16_;
 
1734
                                const gchar* _tmp17_ = NULL;
 
1735
                                const gchar* _tmp18_ = NULL;
 
1736
                                _tmp15_ = NULL;
 
1737
                                _tmp16_ = folks_persona_get_is_user (persona);
 
1738
                                if (_tmp16_) {
 
1739
                                        _tmp15_ = "yes";
1727
1740
                                } else {
1728
 
                                        _tmp12_ = "no";
 
1741
                                        _tmp15_ = "no";
1729
1742
                                }
1730
 
                                _tmp14_ = folks_persona_get_uid (persona);
1731
 
                                _tmp15_ = folks_persona_get_iid (persona);
1732
 
                                g_debug ("individual-aggregator.vala:619:     %s (is user: %s, IID: %s)", _tmp14_, _tmp12_, _tmp15_);
 
1743
                                _tmp17_ = folks_persona_get_uid (persona);
 
1744
                                _tmp18_ = folks_persona_get_iid (persona);
 
1745
                                g_debug ("individual-aggregator.vala:623:     %s (is user: %s, IID: %s)", _tmp17_, _tmp15_, _tmp18_);
1733
1746
                        }
1734
1747
                }
1735
1748
        }
1736
1749
        folks_individual_aggregator_add_personas (self, relinked_personas, &added_individuals, &replaced_individuals, &user);
1737
1750
        if (replaced_individuals != NULL) {
1738
 
                GeeMapIterator* _tmp16_ = NULL;
 
1751
                GeeMapIterator* _tmp19_ = NULL;
1739
1752
                GeeMapIterator* iter;
1740
 
                _tmp16_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) replaced_individuals);
1741
 
                iter = _tmp16_;
 
1753
                _tmp19_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) replaced_individuals);
 
1754
                iter = _tmp19_;
1742
1755
                while (TRUE) {
1743
 
                        gboolean _tmp17_;
1744
 
                        gpointer _tmp18_ = NULL;
1745
 
                        _tmp17_ = gee_map_iterator_next (iter);
1746
 
                        if (!(_tmp17_ == TRUE)) {
 
1756
                        gboolean _tmp20_;
 
1757
                        gpointer _tmp21_ = NULL;
 
1758
                        _tmp20_ = gee_map_iterator_next (iter);
 
1759
                        if (!(_tmp20_ == TRUE)) {
1747
1760
                                break;
1748
1761
                        }
1749
 
                        _tmp18_ = gee_map_iterator_get_key (iter);
1750
 
                        _data15_->removed_individuals = g_list_prepend (_data15_->removed_individuals, (FolksIndividual*) _tmp18_);
 
1762
                        _tmp21_ = gee_map_iterator_get_key (iter);
 
1763
                        _data15_->removed_individuals = g_list_prepend (_data15_->removed_individuals, (FolksIndividual*) _tmp21_);
1751
1764
                }
1752
1765
                _g_object_unref0 (iter);
1753
1766
        }
1754
1767
        folks_individual_aggregator_set_user (self, user);
1755
1768
        if (added_individuals != NULL) {
1756
 
                _tmp19_ = TRUE;
 
1769
                _tmp22_ = TRUE;
1757
1770
        } else {
1758
 
                _tmp19_ = _data15_->removed_individuals != NULL;
 
1771
                _tmp22_ = _data15_->removed_individuals != NULL;
1759
1772
        }
1760
 
        if (_tmp19_) {
 
1773
        if (_tmp22_) {
1761
1774
                g_signal_emit_by_name (self, "individuals-changed", added_individuals, _data15_->removed_individuals, NULL, NULL, 0);
1762
1775
        }
1763
 
        g_debug ("individual-aggregator.vala:651: Replacing Individuals due to linking:");
1764
 
        _tmp20_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) replaced_individuals);
1765
 
        iter = _tmp20_;
 
1776
        g_debug ("individual-aggregator.vala:655: Replacing Individuals due to linking:");
 
1777
        _tmp23_ = gee_abstract_map_map_iterator ((GeeAbstractMap*) replaced_individuals);
 
1778
        iter = _tmp23_;
1766
1779
        while (TRUE) {
1767
 
                gboolean _tmp21_;
1768
 
                gpointer _tmp22_ = NULL;
1769
 
                FolksIndividual* _tmp23_;
1770
 
                gpointer _tmp24_ = NULL;
1771
 
                FolksIndividual* _tmp25_;
1772
 
                _tmp21_ = gee_map_iterator_next (iter);
1773
 
                if (!(_tmp21_ == TRUE)) {
 
1780
                gboolean _tmp24_;
 
1781
                gpointer _tmp25_ = NULL;
 
1782
                FolksIndividual* _tmp26_;
 
1783
                gpointer _tmp27_ = NULL;
 
1784
                FolksIndividual* _tmp28_;
 
1785
                _tmp24_ = gee_map_iterator_next (iter);
 
1786
                if (!(_tmp24_ == TRUE)) {
1774
1787
                        break;
1775
1788
                }
1776
 
                _tmp22_ = gee_map_iterator_get_key (iter);
1777
 
                _tmp23_ = (FolksIndividual*) _tmp22_;
1778
 
                _tmp24_ = gee_map_iterator_get_value (iter);
1779
 
                _tmp25_ = (FolksIndividual*) _tmp24_;
1780
 
                folks_individual_replace (_tmp23_, _tmp25_);
1781
 
                _g_object_unref0 (_tmp25_);
1782
 
                _g_object_unref0 (_tmp23_);
 
1789
                _tmp25_ = gee_map_iterator_get_key (iter);
 
1790
                _tmp26_ = (FolksIndividual*) _tmp25_;
 
1791
                _tmp27_ = gee_map_iterator_get_value (iter);
 
1792
                _tmp28_ = (FolksIndividual*) _tmp27_;
 
1793
                folks_individual_replace (_tmp26_, _tmp28_);
 
1794
                _g_object_unref0 (_tmp28_);
 
1795
                _g_object_unref0 (_tmp26_);
1783
1796
        }
1784
1797
        _g_object_unref0 (iter);
1785
1798
        _g_object_unref0 (user);
 
1799
        _g_object_unref0 (relinked_personas_set);
1786
1800
        __g_list_free__g_object_unref0_0 (relinked_personas);
1787
1801
        _g_object_unref0 (replaced_individuals);
1788
1802
        __g_list_free__g_object_unref0_0 (added_individuals);
1866
1880
                const gchar* _tmp4_ = NULL;
1867
1881
                _tmp3_ = folks_individual_get_id (i);
1868
1882
                _tmp4_ = folks_individual_get_id (replacement);
1869
 
                g_debug ("individual-aggregator.vala:694: Individual '%s' removed (replaced by '" \
 
1883
                g_debug ("individual-aggregator.vala:698: Individual '%s' removed (replaced by '" \
1870
1884
"%s')", _tmp3_, _tmp4_);
1871
1885
        } else {
1872
1886
                const gchar* _tmp5_ = NULL;
1873
1887
                _tmp5_ = folks_individual_get_id (i);
1874
 
                g_debug ("individual-aggregator.vala:699: Individual '%s' removed (not replaced)", _tmp5_);
 
1888
                g_debug ("individual-aggregator.vala:703: Individual '%s' removed (not replaced)", _tmp5_);
1875
1889
        }
1876
1890
        g_signal_emit_by_name (self, "individuals-changed", NULL, i_list, NULL, NULL, 0);
1877
1891
        _tmp6_ = folks_individual_get_id (i);
2162
2176
static void _lambda28_ (const gchar* k, GValue* v, Block16Data* _data16_) {
2163
2177
        FolksIndividualAggregator * self;
2164
2178
        gchar* _tmp0_;
2165
 
        GValue* _tmp1_ = NULL;
2166
 
        GValue* _tmp2_;
 
2179
        GValue* _tmp1_;
2167
2180
        self = _data16_->self;
2168
2181
        g_return_if_fail (k != NULL);
2169
2182
        _tmp0_ = g_strdup ((const gchar*) k);
2170
 
        _tmp2_ = __g_value_dup0 ((G_VALUE_HOLDS (v, G_TYPE_VALUE) && g_value_get_boxed (v)) ? (*((GValue**) g_value_get_boxed (v))) : (g_warning ("Invalid GValue unboxing (wrong type or NULL)"), _tmp1_));
2171
 
        g_hash_table_insert (_data16_->retval, _tmp0_, _tmp2_);
 
2183
        _tmp1_ = __g_value_dup0 (v);
 
2184
        g_hash_table_insert (_data16_->retval, _tmp0_, _tmp1_);
2172
2185
}
2173
2186
 
2174
2187
 
2610
2623
                return FALSE;
2611
2624
        }
2612
2625
        if (data->self->priv->linking_enabled == FALSE) {
2613
 
                g_debug ("individual-aggregator.vala:862: Can't link Personas: linking disabled.");
 
2626
                g_debug ("individual-aggregator.vala:870: Can't link Personas: linking disabled.");
2614
2627
                block17_data_unref (data->_data17_);
2615
2628
                if (data->_state_ == 0) {
2616
2629
                        g_simple_async_result_complete_in_idle (data->_async_result);
2770
2783
        if (data->self->priv->linking_enabled == FALSE) {
2771
2784
                data->_tmp0_ = NULL;
2772
2785
                data->_tmp0_ = folks_individual_get_id (data->individual);
2773
 
                g_debug ("individual-aggregator.vala:953: Can't unlink Individual '%s': linking " \
 
2786
                g_debug ("individual-aggregator.vala:961: Can't unlink Individual '%s': linking " \
2774
2787
"disabled.", data->_tmp0_);
2775
2788
                if (data->_state_ == 0) {
2776
2789
                        g_simple_async_result_complete_in_idle (data->_async_result);
2782
2795
        }
2783
2796
        data->_tmp1_ = NULL;
2784
2797
        data->_tmp1_ = folks_individual_get_id (data->individual);
2785
 
        g_debug ("individual-aggregator.vala:961: Unlinking Individual '%s', deleting Pe" \
 
2798
        g_debug ("individual-aggregator.vala:969: Unlinking Individual '%s', deleting Pe" \
2786
2799
"rsonas:", data->_tmp1_);
2787
2800
        data->_tmp2_ = NULL;
2788
2801
        data->_tmp2_ = folks_individual_get_personas (data->individual);
2818
2831
                                        data->_tmp8_ = folks_persona_get_uid (data->persona);
2819
2832
                                        data->_tmp9_ = NULL;
2820
2833
                                        data->_tmp9_ = folks_persona_get_iid (data->persona);
2821
 
                                        g_debug ("individual-aggregator.vala:975:     %s (is user: %s, IID: %s)", data->_tmp8_, data->_tmp6_, data->_tmp9_);
 
2834
                                        g_debug ("individual-aggregator.vala:983:     %s (is user: %s, IID: %s)", data->_tmp8_, data->_tmp6_, data->_tmp9_);
2822
2835
                                        data->_state_ = 1;
2823
2836
                                        folks_persona_store_remove_persona (data->self->priv->writeable_store, data->persona, folks_individual_aggregator_unlink_individual_ready, data);
2824
2837
                                        return FALSE;
2945
2958
        /**
2946
2959
           * The {@link Individual} representing the user.
2947
2960
           *
2948
 
           * If it exists, this holds the {@link Individual} who is the user — the
 
2961
           * If it exists, this holds the {@link Individual} who is the user: the
2949
2962
           * {@link Individual} containing the {@link Persona}s who are the owners of
2950
2963
           * the accounts for their respective backends.
2951
2964
           *