~ubuntu-branches/ubuntu/saucy/zeitgeist/saucy

« back to all changes in this revision

Viewing changes to src/datamodel.c

  • Committer: Package Import Robot
  • Author(s): Siegfried-Angel Gevatter Pujals
  • Date: 2012-02-14 18:04:14 UTC
  • mfrom: (6.2.5 experimental)
  • Revision ID: package-import@ubuntu.com-20120214180414-bdi4682g3hfinnpz
Tags: 0.8.99~alpha3-1
* New upstream release. Some of the changes are:
   - The FTS module in Python has been replaced with a C/C++ implementation.
   - Events are pre-processed before they are checked against the blacklist.
   - Fixed reconnection in Python API to avoid duplicate notifications.
   - Support for guessing from more MIME-types and schemas.
* debian/control:
   - Add libxapian-dev and libdee-dev to Build-Depends.
   - Fix zeitgeist-core description.
* debian/zeitgeist-core.install, debian/python-zeitgeist.install:
   - Update for FTS.
* Drop debian/patches/pragma-exclusive.diff (included upstream).

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
GType zeitgeist_relevant_result_type_get_type (void) G_GNUC_CONST;
235
235
GType zeitgeist_storage_state_get_type (void) G_GNUC_CONST;
236
236
gboolean zeitgeist_check_field_match (const gchar* property, const gchar* template_property, gboolean is_symbol, gboolean can_wildcard);
237
 
gboolean zeitgeist_engine_parse_negation (gchar** val);
 
237
gboolean zeitgeist_utils_parse_negation (gchar** val);
238
238
GList* zeitgeist_symbol_get_all_parents (const gchar* symbol_uri);
239
 
gboolean zeitgeist_engine_parse_wildcard (gchar** val);
 
239
gboolean zeitgeist_utils_parse_wildcard (gchar** val);
240
240
GType zeitgeist_event_get_type (void) G_GNUC_CONST;
241
241
GType zeitgeist_subject_get_type (void) G_GNUC_CONST;
242
242
#define ZEITGEIST_EVENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ZEITGEIST_TYPE_EVENT, ZeitgeistEventPrivate))
765
765
        gboolean _tmp2_ = FALSE;
766
766
        gboolean is_negated;
767
767
        const gchar* _tmp3_;
768
 
        const gchar* _tmp22_;
769
 
        gboolean _tmp23_ = FALSE;
770
 
        gboolean _tmp24_;
771
 
        gboolean _tmp27_;
 
768
        gboolean _tmp22_ = FALSE;
 
769
        gboolean _tmp23_;
 
770
        gboolean _tmp26_;
772
771
        g_return_val_if_fail (property != NULL, FALSE);
773
772
        g_return_val_if_fail (template_property != NULL, FALSE);
774
773
        matches = FALSE;
775
774
        _tmp0_ = template_property;
776
775
        _tmp1_ = g_strdup (_tmp0_);
777
776
        parsed = _tmp1_;
778
 
        _tmp2_ = zeitgeist_engine_parse_negation (&parsed);
 
777
        _tmp2_ = zeitgeist_utils_parse_negation (&parsed);
779
778
        is_negated = _tmp2_;
780
779
        _tmp3_ = parsed;
781
780
        if (g_strcmp0 (_tmp3_, "") == 0) {
822
821
                                _tmp16_ = can_wildcard;
823
822
                                if (_tmp16_) {
824
823
                                        gboolean _tmp17_ = FALSE;
825
 
                                        _tmp17_ = zeitgeist_engine_parse_wildcard (&parsed);
 
824
                                        _tmp17_ = zeitgeist_utils_parse_wildcard (&parsed);
826
825
                                        _tmp15_ = _tmp17_;
827
826
                                } else {
828
827
                                        _tmp15_ = FALSE;
842
841
                        }
843
842
                }
844
843
        }
845
 
        _tmp22_ = parsed;
846
 
        g_debug ("datamodel.vala:291: Checking matches for %s", _tmp22_);
847
 
        _tmp24_ = is_negated;
848
 
        if (_tmp24_) {
 
844
        _tmp23_ = is_negated;
 
845
        if (_tmp23_) {
 
846
                gboolean _tmp24_;
 
847
                _tmp24_ = matches;
 
848
                _tmp22_ = !_tmp24_;
 
849
        } else {
849
850
                gboolean _tmp25_;
850
851
                _tmp25_ = matches;
851
 
                _tmp23_ = !_tmp25_;
852
 
        } else {
853
 
                gboolean _tmp26_;
854
 
                _tmp26_ = matches;
855
 
                _tmp23_ = _tmp26_;
 
852
                _tmp22_ = _tmp25_;
856
853
        }
857
 
        _tmp27_ = _tmp23_;
858
 
        result = _tmp27_;
 
854
        _tmp26_ = _tmp22_;
 
855
        result = _tmp26_;
859
856
        _g_free0 (parsed);
860
857
        return result;
861
858
}
1216
1213
                guint8* _tmp77_;
1217
1214
                gint _tmp77__length1;
1218
1215
                _tmp68_ = payload_length;
1219
 
                g_debug ("datamodel.vala:383: there was payload with length: %u", _tmp68_);
 
1216
                g_debug ("datamodel.vala:382: there was payload with length: %u", _tmp68_);
1220
1217
                _tmp69_ = payload_length;
1221
1218
                _tmp70_ = g_byte_array_sized_new (_tmp69_);
1222
1219
                _tmp71_ = _tmp70_;
1690
1687
 
1691
1688
gboolean zeitgeist_event_matches_template (ZeitgeistEvent* self, ZeitgeistEvent* template_event) {
1692
1689
        gboolean result = FALSE;
1693
 
        guint32 _tmp0_;
1694
 
        ZeitgeistEvent* _tmp1_;
1695
 
        guint32 _tmp2_;
 
1690
        const gchar* _tmp0_;
 
1691
        const gchar* _tmp1_;
 
1692
        ZeitgeistEvent* _tmp2_;
1696
1693
        const gchar* _tmp3_;
1697
1694
        const gchar* _tmp4_;
1698
 
        ZeitgeistEvent* _tmp5_;
 
1695
        gboolean _tmp5_ = FALSE;
1699
1696
        const gchar* _tmp6_;
1700
1697
        const gchar* _tmp7_;
1701
 
        gboolean _tmp8_ = FALSE;
 
1698
        ZeitgeistEvent* _tmp8_;
1702
1699
        const gchar* _tmp9_;
1703
1700
        const gchar* _tmp10_;
1704
 
        ZeitgeistEvent* _tmp11_;
 
1701
        gboolean _tmp11_ = FALSE;
1705
1702
        const gchar* _tmp12_;
1706
1703
        const gchar* _tmp13_;
1707
 
        gboolean _tmp14_ = FALSE;
 
1704
        ZeitgeistEvent* _tmp14_;
1708
1705
        const gchar* _tmp15_;
1709
1706
        const gchar* _tmp16_;
1710
 
        ZeitgeistEvent* _tmp17_;
 
1707
        gboolean _tmp17_ = FALSE;
1711
1708
        const gchar* _tmp18_;
1712
 
        const gchar* _tmp19_;
1713
 
        gboolean _tmp20_ = FALSE;
1714
 
        const gchar* _tmp21_;
 
1709
        ZeitgeistEvent* _tmp19_;
 
1710
        const gchar* _tmp20_;
 
1711
        gboolean _tmp21_ = FALSE;
1715
1712
        ZeitgeistEvent* _tmp22_;
1716
 
        const gchar* _tmp23_;
1717
 
        gboolean _tmp24_ = FALSE;
1718
 
        ZeitgeistEvent* _tmp25_;
1719
 
        GPtrArray* _tmp26_;
1720
 
        gint _tmp27_;
1721
 
        gint _tmp28_;
 
1713
        GPtrArray* _tmp23_;
 
1714
        gint _tmp24_;
 
1715
        gint _tmp25_;
1722
1716
        g_return_val_if_fail (self != NULL, FALSE);
1723
1717
        g_return_val_if_fail (template_event != NULL, FALSE);
1724
 
        _tmp0_ = self->priv->_id;
1725
 
        _tmp1_ = template_event;
1726
 
        _tmp2_ = _tmp1_->priv->_id;
1727
 
        g_debug ("datamodel.vala:484: Checking if event %u matches template_event %u\n", (guint) _tmp0_, (guint) _tmp2_);
1728
 
        _tmp3_ = zeitgeist_event_get_interpretation (self);
 
1718
        _tmp0_ = zeitgeist_event_get_interpretation (self);
 
1719
        _tmp1_ = _tmp0_;
 
1720
        _tmp2_ = template_event;
 
1721
        _tmp3_ = zeitgeist_event_get_interpretation (_tmp2_);
1729
1722
        _tmp4_ = _tmp3_;
1730
 
        _tmp5_ = template_event;
1731
 
        _tmp6_ = zeitgeist_event_get_interpretation (_tmp5_);
 
1723
        _tmp5_ = zeitgeist_check_field_match (_tmp1_, _tmp4_, TRUE, FALSE);
 
1724
        if (!_tmp5_) {
 
1725
                result = FALSE;
 
1726
                return result;
 
1727
        }
 
1728
        _tmp6_ = zeitgeist_event_get_manifestation (self);
1732
1729
        _tmp7_ = _tmp6_;
1733
 
        _tmp8_ = zeitgeist_check_field_match (_tmp4_, _tmp7_, TRUE, FALSE);
1734
 
        if (!_tmp8_) {
1735
 
                result = FALSE;
1736
 
                return result;
1737
 
        }
1738
 
        _tmp9_ = zeitgeist_event_get_manifestation (self);
 
1730
        _tmp8_ = template_event;
 
1731
        _tmp9_ = zeitgeist_event_get_manifestation (_tmp8_);
1739
1732
        _tmp10_ = _tmp9_;
1740
 
        _tmp11_ = template_event;
1741
 
        _tmp12_ = zeitgeist_event_get_manifestation (_tmp11_);
 
1733
        _tmp11_ = zeitgeist_check_field_match (_tmp7_, _tmp10_, TRUE, FALSE);
 
1734
        if (!_tmp11_) {
 
1735
                result = FALSE;
 
1736
                return result;
 
1737
        }
 
1738
        _tmp12_ = zeitgeist_event_get_actor (self);
1742
1739
        _tmp13_ = _tmp12_;
1743
 
        _tmp14_ = zeitgeist_check_field_match (_tmp10_, _tmp13_, TRUE, FALSE);
1744
 
        if (!_tmp14_) {
1745
 
                result = FALSE;
1746
 
                return result;
1747
 
        }
1748
 
        _tmp15_ = zeitgeist_event_get_actor (self);
 
1740
        _tmp14_ = template_event;
 
1741
        _tmp15_ = zeitgeist_event_get_actor (_tmp14_);
1749
1742
        _tmp16_ = _tmp15_;
1750
 
        _tmp17_ = template_event;
1751
 
        _tmp18_ = zeitgeist_event_get_actor (_tmp17_);
1752
 
        _tmp19_ = _tmp18_;
1753
 
        _tmp20_ = zeitgeist_check_field_match (_tmp16_, _tmp19_, FALSE, TRUE);
1754
 
        if (!_tmp20_) {
1755
 
                result = FALSE;
1756
 
                return result;
1757
 
        }
1758
 
        _tmp21_ = self->priv->_origin;
 
1743
        _tmp17_ = zeitgeist_check_field_match (_tmp13_, _tmp16_, FALSE, TRUE);
 
1744
        if (!_tmp17_) {
 
1745
                result = FALSE;
 
1746
                return result;
 
1747
        }
 
1748
        _tmp18_ = self->priv->_origin;
 
1749
        _tmp19_ = template_event;
 
1750
        _tmp20_ = _tmp19_->priv->_origin;
 
1751
        _tmp21_ = zeitgeist_check_field_match (_tmp18_, _tmp20_, FALSE, TRUE);
 
1752
        if (!_tmp21_) {
 
1753
                result = FALSE;
 
1754
                return result;
 
1755
        }
1759
1756
        _tmp22_ = template_event;
1760
 
        _tmp23_ = _tmp22_->priv->_origin;
1761
 
        _tmp24_ = zeitgeist_check_field_match (_tmp21_, _tmp23_, FALSE, TRUE);
1762
 
        if (!_tmp24_) {
1763
 
                result = FALSE;
1764
 
                return result;
1765
 
        }
1766
 
        _tmp25_ = template_event;
1767
 
        _tmp26_ = _tmp25_->priv->_subjects;
1768
 
        _tmp27_ = g_ptr_array_get_length (_tmp26_);
1769
 
        _tmp28_ = _tmp27_;
1770
 
        if (_tmp28_ == 0) {
 
1757
        _tmp23_ = _tmp22_->priv->_subjects;
 
1758
        _tmp24_ = g_ptr_array_get_length (_tmp23_);
 
1759
        _tmp25_ = _tmp24_;
 
1760
        if (_tmp25_ == 0) {
1771
1761
                result = TRUE;
1772
1762
                return result;
1773
1763
        }
1775
1765
                gint i;
1776
1766
                i = 0;
1777
1767
                {
1778
 
                        gboolean _tmp29_;
1779
 
                        _tmp29_ = TRUE;
 
1768
                        gboolean _tmp26_;
 
1769
                        _tmp26_ = TRUE;
1780
1770
                        while (TRUE) {
1781
 
                                gboolean _tmp30_;
 
1771
                                gboolean _tmp27_;
 
1772
                                gint _tmp29_;
 
1773
                                GPtrArray* _tmp30_;
 
1774
                                gint _tmp31_;
1782
1775
                                gint _tmp32_;
1783
 
                                GPtrArray* _tmp33_;
1784
 
                                gint _tmp34_;
1785
 
                                gint _tmp35_;
1786
 
                                _tmp30_ = _tmp29_;
1787
 
                                if (!_tmp30_) {
1788
 
                                        gint _tmp31_;
1789
 
                                        _tmp31_ = i;
1790
 
                                        i = _tmp31_ + 1;
 
1776
                                _tmp27_ = _tmp26_;
 
1777
                                if (!_tmp27_) {
 
1778
                                        gint _tmp28_;
 
1779
                                        _tmp28_ = i;
 
1780
                                        i = _tmp28_ + 1;
1791
1781
                                }
1792
 
                                _tmp29_ = FALSE;
1793
 
                                _tmp32_ = i;
1794
 
                                _tmp33_ = self->priv->_subjects;
1795
 
                                _tmp34_ = g_ptr_array_get_length (_tmp33_);
1796
 
                                _tmp35_ = _tmp34_;
1797
 
                                if (!(_tmp32_ < _tmp35_)) {
 
1782
                                _tmp26_ = FALSE;
 
1783
                                _tmp29_ = i;
 
1784
                                _tmp30_ = self->priv->_subjects;
 
1785
                                _tmp31_ = g_ptr_array_get_length (_tmp30_);
 
1786
                                _tmp32_ = _tmp31_;
 
1787
                                if (!(_tmp29_ < _tmp32_)) {
1798
1788
                                        break;
1799
1789
                                }
1800
1790
                                {
1801
1791
                                        gint j;
1802
1792
                                        j = 0;
1803
1793
                                        {
1804
 
                                                gboolean _tmp36_;
1805
 
                                                _tmp36_ = TRUE;
 
1794
                                                gboolean _tmp33_;
 
1795
                                                _tmp33_ = TRUE;
1806
1796
                                                while (TRUE) {
1807
 
                                                        gboolean _tmp37_;
 
1797
                                                        gboolean _tmp34_;
 
1798
                                                        gint _tmp36_;
 
1799
                                                        ZeitgeistEvent* _tmp37_;
 
1800
                                                        GPtrArray* _tmp38_;
1808
1801
                                                        gint _tmp39_;
1809
 
                                                        ZeitgeistEvent* _tmp40_;
 
1802
                                                        gint _tmp40_;
1810
1803
                                                        GPtrArray* _tmp41_;
1811
1804
                                                        gint _tmp42_;
1812
 
                                                        gint _tmp43_;
1813
 
                                                        GPtrArray* _tmp44_;
1814
 
                                                        gint _tmp45_;
1815
 
                                                        gconstpointer _tmp46_ = NULL;
1816
 
                                                        ZeitgeistEvent* _tmp47_;
1817
 
                                                        GPtrArray* _tmp48_;
1818
 
                                                        gint _tmp49_;
1819
 
                                                        gconstpointer _tmp50_ = NULL;
1820
 
                                                        gboolean _tmp51_ = FALSE;
1821
 
                                                        _tmp37_ = _tmp36_;
1822
 
                                                        if (!_tmp37_) {
1823
 
                                                                gint _tmp38_;
1824
 
                                                                _tmp38_ = j;
1825
 
                                                                j = _tmp38_ + 1;
 
1805
                                                        gconstpointer _tmp43_ = NULL;
 
1806
                                                        ZeitgeistEvent* _tmp44_;
 
1807
                                                        GPtrArray* _tmp45_;
 
1808
                                                        gint _tmp46_;
 
1809
                                                        gconstpointer _tmp47_ = NULL;
 
1810
                                                        gboolean _tmp48_ = FALSE;
 
1811
                                                        _tmp34_ = _tmp33_;
 
1812
                                                        if (!_tmp34_) {
 
1813
                                                                gint _tmp35_;
 
1814
                                                                _tmp35_ = j;
 
1815
                                                                j = _tmp35_ + 1;
1826
1816
                                                        }
1827
 
                                                        _tmp36_ = FALSE;
1828
 
                                                        _tmp39_ = j;
1829
 
                                                        _tmp40_ = template_event;
1830
 
                                                        _tmp41_ = _tmp40_->priv->_subjects;
1831
 
                                                        _tmp42_ = g_ptr_array_get_length (_tmp41_);
1832
 
                                                        _tmp43_ = _tmp42_;
1833
 
                                                        if (!(_tmp39_ < _tmp43_)) {
 
1817
                                                        _tmp33_ = FALSE;
 
1818
                                                        _tmp36_ = j;
 
1819
                                                        _tmp37_ = template_event;
 
1820
                                                        _tmp38_ = _tmp37_->priv->_subjects;
 
1821
                                                        _tmp39_ = g_ptr_array_get_length (_tmp38_);
 
1822
                                                        _tmp40_ = _tmp39_;
 
1823
                                                        if (!(_tmp36_ < _tmp40_)) {
1834
1824
                                                                break;
1835
1825
                                                        }
1836
 
                                                        _tmp44_ = self->priv->_subjects;
1837
 
                                                        _tmp45_ = i;
1838
 
                                                        _tmp46_ = g_ptr_array_index (_tmp44_, (guint) _tmp45_);
1839
 
                                                        _tmp47_ = template_event;
1840
 
                                                        _tmp48_ = _tmp47_->priv->_subjects;
1841
 
                                                        _tmp49_ = j;
1842
 
                                                        _tmp50_ = g_ptr_array_index (_tmp48_, (guint) _tmp49_);
1843
 
                                                        _tmp51_ = zeitgeist_subject_matches_template ((ZeitgeistSubject*) _tmp46_, (ZeitgeistSubject*) _tmp50_);
1844
 
                                                        if (_tmp51_) {
 
1826
                                                        _tmp41_ = self->priv->_subjects;
 
1827
                                                        _tmp42_ = i;
 
1828
                                                        _tmp43_ = g_ptr_array_index (_tmp41_, (guint) _tmp42_);
 
1829
                                                        _tmp44_ = template_event;
 
1830
                                                        _tmp45_ = _tmp44_->priv->_subjects;
 
1831
                                                        _tmp46_ = j;
 
1832
                                                        _tmp47_ = g_ptr_array_index (_tmp45_, (guint) _tmp46_);
 
1833
                                                        _tmp48_ = zeitgeist_subject_matches_template ((ZeitgeistSubject*) _tmp43_, (ZeitgeistSubject*) _tmp47_);
 
1834
                                                        if (_tmp48_) {
1845
1835
                                                                result = TRUE;
1846
1836
                                                                return result;
1847
1837
                                                        }