-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 | |||
@@ -586,3 +586,21 @@ void ODateBookAccessBackend_XML::setField( OEvent& e, int id, const QString& val | |||
586 | break; | 586 | break; |
587 | } | 587 | } |
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 | |||
@@ -22,6 +22,7 @@ public: | |||
22 | bool save(); | 22 | bool save(); |
23 | 23 | ||
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() ); |
26 | OEvent find( int uid )const; | 27 | OEvent find( int uid )const; |
27 | void clear(); | 28 | void clear(); |
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 | |||
@@ -46,6 +46,12 @@ public: | |||
46 | */ | 46 | */ |
47 | virtual QArray<int> allRecords()const = 0; | 47 | virtual QArray<int> allRecords()const = 0; |
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 | /** |
50 | * queryByExample for T with the given Settings | 56 | * queryByExample for T with the given Settings |
51 | * | 57 | * |
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 | |||
@@ -185,6 +185,10 @@ QArray<int> OTodoAccessVCal::allRecords()const { | |||
185 | } | 185 | } |
186 | return ar; | 186 | return ar; |
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& ) { |
189 | QArray<int> ar(0); | 193 | QArray<int> ar(0); |
190 | return ar; | 194 | return ar; |
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 | |||
@@ -13,6 +13,7 @@ public: | |||
13 | bool save(); | 13 | bool save(); |
14 | 14 | ||
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() ); |
17 | QArray<int> effectiveToDos( const QDate& start, | 18 | QArray<int> effectiveToDos( const QDate& start, |
18 | const QDate& end, | 19 | const QDate& end, |
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 | |||
@@ -774,3 +774,19 @@ QBitArray OTodoAccessXML::sup() { | |||
774 | 774 | ||
775 | return ar; | 775 | return ar; |
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 | |||
@@ -24,6 +24,7 @@ public: | |||
24 | bool save(); | 24 | bool save(); |
25 | 25 | ||
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() ); |
28 | OTodo find( int uid )const; | 29 | OTodo find( int uid )const; |
29 | void clear(); | 30 | void clear(); |