author | tille <tille> | 2003-05-08 13:55:09 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-08 13:55:09 (UTC) |
commit | 0cb4111d34d9fe96731f48983e1ff2e67262db02 (patch) (unidiff) | |
tree | ce6ec869ae7753ab0261e7ad075a10ad8b0a404b /libopie2/opiepim/backend | |
parent | 78c60031b506b85dc20bd555d83486aeb831bf38 (diff) | |
download | opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.zip opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.tar.gz opie-0cb4111d34d9fe96731f48983e1ff2e67262db02.tar.bz2 |
search stuff
and match, toRichText & toShortText in oevent
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | 18 | ||||
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_xml.h | 1 | ||||
-rw-r--r-- | libopie2/opiepim/backend/opimaccessbackend.h | 6 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessvcal.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessvcal.h | 1 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 16 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.h | 1 |
7 files changed, 47 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp index a0ae7b7..ab2eea4 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | |||
@@ -588 +588,19 @@ void ODateBookAccessBackend_XML::setField( OEvent& e, int id, const QString& val | |||
588 | } | 588 | } |
589 | QArray<int> ODateBookAccessBackend_XML::matchRegexp( const QRegExp &r ) const | ||
590 | { | ||
591 | QArray<int> m_currentQuery( m_raw.count()+ m_rep.count() ); | ||
592 | uint arraycounter = 0; | ||
593 | QMap<int, OEvent>::ConstIterator it; | ||
594 | |||
595 | for ( it = m_raw.begin(); it != m_raw.end(); ++it ) | ||
596 | if ( it.data().match( r ) ) | ||
597 | m_currentQuery[arraycounter++] = it.data().uid(); | ||
598 | for ( it = m_rep.begin(); it != m_rep.end(); ++it ) | ||
599 | if ( it.data().match( r ) ) | ||
600 | m_currentQuery[arraycounter++] = it.data().uid(); | ||
601 | |||
602 | // Shrink to fit.. | ||
603 | m_currentQuery.resize(arraycounter); | ||
604 | |||
605 | return m_currentQuery; | ||
606 | } | ||
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h index 7848f7c..a5cc0fc 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.h +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.h | |||
@@ -24,2 +24,3 @@ public: | |||
24 | QArray<int> allRecords()const; | 24 | QArray<int> allRecords()const; |
25 | QArray<int> matchRegexp(const QRegExp &r) const; | ||
25 | QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); | 26 | QArray<int> queryByExample( const OEvent&, int, const QDateTime& d = QDateTime() ); |
diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h index 01a0c86..f4bbe35 100644 --- a/libopie2/opiepim/backend/opimaccessbackend.h +++ b/libopie2/opiepim/backend/opimaccessbackend.h | |||
@@ -48,2 +48,8 @@ public: | |||
48 | 48 | ||
49 | /** | ||
50 | * return a List of records | ||
51 | * that match the regex | ||
52 | */ | ||
53 | virtual QArray<int> matchRegexp(const QRegExp &r) const = 0; | ||
54 | |||
49 | /** | 55 | /** |
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.cpp b/libopie2/opiepim/backend/otodoaccessvcal.cpp index 9bc16c6..3577e14 100644 --- a/libopie2/opiepim/backend/otodoaccessvcal.cpp +++ b/libopie2/opiepim/backend/otodoaccessvcal.cpp | |||
@@ -187,2 +187,6 @@ QArray<int> OTodoAccessVCal::allRecords()const { | |||
187 | } | 187 | } |
188 | QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp &r)const { | ||
189 | QArray<int> ar(0); | ||
190 | return ar; | ||
191 | } | ||
188 | QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& ) { | 192 | QArray<int> OTodoAccessVCal::queryByExample( const OTodo&, int, const QDateTime& ) { |
diff --git a/libopie2/opiepim/backend/otodoaccessvcal.h b/libopie2/opiepim/backend/otodoaccessvcal.h index 489416b..2b17147 100644 --- a/libopie2/opiepim/backend/otodoaccessvcal.h +++ b/libopie2/opiepim/backend/otodoaccessvcal.h | |||
@@ -15,2 +15,3 @@ public: | |||
15 | QArray<int> allRecords()const; | 15 | QArray<int> allRecords()const; |
16 | QArray<int> matchRegexp(const QRegExp &r) const; | ||
16 | QArray<int> queryByExample( const OTodo& t, int sort, const QDateTime& d = QDateTime() ); | 17 | QArray<int> queryByExample( const OTodo& t, int sort, const QDateTime& d = QDateTime() ); |
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index 285d2b8..69b7ab4 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp | |||
@@ -776 +776,17 @@ QBitArray OTodoAccessXML::sup() { | |||
776 | } | 776 | } |
777 | QArray<int> OTodoAccessXML::matchRegexp( const QRegExp &r ) const | ||
778 | { | ||
779 | QArray<int> m_currentQuery( m_events.count() ); | ||
780 | uint arraycounter = 0; | ||
781 | |||
782 | QMap<int, OTodo>::ConstIterator it; | ||
783 | for (it = m_events.begin(); it != m_events.end(); ++it ) { | ||
784 | if ( it.data().match( r ) ) | ||
785 | m_currentQuery[arraycounter++] = it.data().uid(); | ||
786 | |||
787 | } | ||
788 | // Shrink to fit.. | ||
789 | m_currentQuery.resize(arraycounter); | ||
790 | |||
791 | return m_currentQuery; | ||
792 | } | ||
diff --git a/libopie2/opiepim/backend/otodoaccessxml.h b/libopie2/opiepim/backend/otodoaccessxml.h index cc4a16f..e4850a1 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.h +++ b/libopie2/opiepim/backend/otodoaccessxml.h | |||
@@ -26,2 +26,3 @@ public: | |||
26 | QArray<int> allRecords()const; | 26 | QArray<int> allRecords()const; |
27 | QArray<int> matchRegexp(const QRegExp &r) const; | ||
27 | QArray<int> queryByExample( const OTodo&, int querysettings, const QDateTime& d = QDateTime() ); | 28 | QArray<int> queryByExample( const OTodo&, int querysettings, const QDateTime& d = QDateTime() ); |