-rw-r--r-- | libopie/pim/ocontact.h | 4 | ||||
-rw-r--r-- | libopie/pim/ocontactaccess.cpp | 8 | ||||
-rw-r--r-- | libopie/pim/ocontactaccess.h | 8 | ||||
-rw-r--r-- | libopie/pim/ocontactaccessbackend.h | 7 | ||||
-rw-r--r-- | libopie/pim/ocontactaccessbackend_xml.h | 20 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend.h | 7 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_xml.h | 20 | ||||
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.h | 8 | ||||
-rw-r--r-- | libopie2/opiepim/ocontact.h | 4 |
10 files changed, 86 insertions, 8 deletions
diff --git a/libopie/pim/ocontact.h b/libopie/pim/ocontact.h index 382ab94..038a59f 100644 --- a/libopie/pim/ocontact.h +++ b/libopie/pim/ocontact.h | |||
@@ -109,7 +109,3 @@ public: | |||
109 | bool match( const QString ®exp ) const; | 109 | bool match( const QString ®exp ) const; |
110 | |||
111 | // DON'T ATTEMPT TO USE THIS | ||
112 | #ifdef QTOPIA_INTERNAL_CONTACT_MRE | ||
113 | bool match( const QRegExp ®exp ) const; | 110 | bool match( const QRegExp ®exp ) const; |
114 | #endif | ||
115 | 111 | ||
diff --git a/libopie/pim/ocontactaccess.cpp b/libopie/pim/ocontactaccess.cpp index 2ca0283..f868b53 100644 --- a/libopie/pim/ocontactaccess.cpp +++ b/libopie/pim/ocontactaccess.cpp | |||
@@ -23,2 +23,5 @@ | |||
23 | * $Log$ | 23 | * $Log$ |
24 | * Revision 1.6 2002/11/01 15:10:42 eilers | ||
25 | * Added regExp-search in database for all fields in a contact. | ||
26 | * | ||
24 | * Revision 1.5 2002/10/16 10:52:40 eilers | 27 | * Revision 1.5 2002/10/16 10:52:40 eilers |
@@ -122,2 +125,7 @@ bool OContactAccess::save () | |||
122 | 125 | ||
126 | ORecordList<OContact> OContactAccess::matchRegexp( const QRegExp &r ) const{ | ||
127 | QArray<int> matchingContacts = m_backEnd -> matchRegexp( r ); | ||
128 | return ( ORecordList<OContact>(matchingContacts, this) ); | ||
129 | } | ||
130 | |||
123 | const uint OContactAccess::querySettings() | 131 | const uint OContactAccess::querySettings() |
diff --git a/libopie/pim/ocontactaccess.h b/libopie/pim/ocontactaccess.h index da9c942..b4921d5 100644 --- a/libopie/pim/ocontactaccess.h +++ b/libopie/pim/ocontactaccess.h | |||
@@ -19,2 +19,5 @@ | |||
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.4 2002/11/01 15:10:42 eilers | ||
21 | * Added regExp-search in database for all fields in a contact. | ||
22 | * | ||
20 | * Revision 1.3 2002/10/16 10:52:40 eilers | 23 | * Revision 1.3 2002/10/16 10:52:40 eilers |
@@ -50,2 +53,3 @@ | |||
50 | * done by the backend. | 53 | * done by the backend. |
54 | * @see OPimAccessTemplate | ||
51 | */ | 55 | */ |
@@ -83,4 +87,8 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact> | |||
83 | ExactMatch = 0x0008, | 87 | ExactMatch = 0x0008, |
88 | MatchOne = 0x0010 // Only one Entry must match | ||
84 | }; | 89 | }; |
85 | 90 | ||
91 | |||
92 | ORecordList<OContact> matchRegexp( const QRegExp &r )const; | ||
93 | |||
86 | /** Return all possible settings. | 94 | /** Return all possible settings. |
diff --git a/libopie/pim/ocontactaccessbackend.h b/libopie/pim/ocontactaccessbackend.h index a651477..c898f61 100644 --- a/libopie/pim/ocontactaccessbackend.h +++ b/libopie/pim/ocontactaccessbackend.h | |||
@@ -21,2 +21,5 @@ | |||
21 | * $Log$ | 21 | * $Log$ |
22 | * Revision 1.3 2002/11/01 15:10:42 eilers | ||
23 | * Added regExp-search in database for all fields in a contact. | ||
24 | * | ||
22 | * Revision 1.2 2002/10/07 17:34:24 eilers | 25 | * Revision 1.2 2002/10/07 17:34:24 eilers |
@@ -40,2 +43,4 @@ | |||
40 | 43 | ||
44 | #include "qregexp.h" | ||
45 | |||
41 | class OContactAccessBackend: public OPimAccessBackend<OContact> { | 46 | class OContactAccessBackend: public OPimAccessBackend<OContact> { |
@@ -60,2 +65,4 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> { | |||
60 | 65 | ||
66 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; | ||
67 | |||
61 | /** Return all possible settings. | 68 | /** Return all possible settings. |
diff --git a/libopie/pim/ocontactaccessbackend_xml.h b/libopie/pim/ocontactaccessbackend_xml.h index 12a75ba..f7e8207 100644 --- a/libopie/pim/ocontactaccessbackend_xml.h +++ b/libopie/pim/ocontactaccessbackend_xml.h | |||
@@ -19,2 +19,5 @@ | |||
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.5 2002/11/01 15:10:42 eilers | ||
21 | * Added regExp-search in database for all fields in a contact. | ||
22 | * | ||
20 | * Revision 1.4 2002/10/16 10:52:40 eilers | 23 | * Revision 1.4 2002/10/16 10:52:40 eilers |
@@ -256,2 +259,19 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
256 | } | 259 | } |
260 | |||
261 | QArray<int> matchRegexp( const QRegExp &r ) const{ | ||
262 | QArray<int> m_currentQuery( m_contactList.count() ); | ||
263 | QValueListConstIterator<OContact> it; | ||
264 | uint arraycounter = 0; | ||
265 | |||
266 | for( it = m_contactList.begin(); it != m_contactList.end(); ++it ){ | ||
267 | if ( (*it).match( r ) ){ | ||
268 | m_currentQuery[arraycounter++] = (*it).uid(); | ||
269 | } | ||
270 | |||
271 | } | ||
272 | // Shrink to fit.. | ||
273 | m_currentQuery.resize(arraycounter); | ||
274 | |||
275 | return m_currentQuery; | ||
276 | } | ||
257 | 277 | ||
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend.h b/libopie2/opiepim/backend/ocontactaccessbackend.h index a651477..c898f61 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend.h | |||
@@ -21,2 +21,5 @@ | |||
21 | * $Log$ | 21 | * $Log$ |
22 | * Revision 1.3 2002/11/01 15:10:42 eilers | ||
23 | * Added regExp-search in database for all fields in a contact. | ||
24 | * | ||
22 | * Revision 1.2 2002/10/07 17:34:24 eilers | 25 | * Revision 1.2 2002/10/07 17:34:24 eilers |
@@ -40,2 +43,4 @@ | |||
40 | 43 | ||
44 | #include "qregexp.h" | ||
45 | |||
41 | class OContactAccessBackend: public OPimAccessBackend<OContact> { | 46 | class OContactAccessBackend: public OPimAccessBackend<OContact> { |
@@ -60,2 +65,4 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> { | |||
60 | 65 | ||
66 | virtual QArray<int> matchRegexp( const QRegExp &r ) const = 0; | ||
67 | |||
61 | /** Return all possible settings. | 68 | /** Return all possible settings. |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h index 12a75ba..f7e8207 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.h +++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.h | |||
@@ -19,2 +19,5 @@ | |||
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.5 2002/11/01 15:10:42 eilers | ||
21 | * Added regExp-search in database for all fields in a contact. | ||
22 | * | ||
20 | * Revision 1.4 2002/10/16 10:52:40 eilers | 23 | * Revision 1.4 2002/10/16 10:52:40 eilers |
@@ -256,2 +259,19 @@ class OContactAccessBackend_XML : public OContactAccessBackend { | |||
256 | } | 259 | } |
260 | |||
261 | QArray<int> matchRegexp( const QRegExp &r ) const{ | ||
262 | QArray<int> m_currentQuery( m_contactList.count() ); | ||
263 | QValueListConstIterator<OContact> it; | ||
264 | uint arraycounter = 0; | ||
265 | |||
266 | for( it = m_contactList.begin(); it != m_contactList.end(); ++it ){ | ||
267 | if ( (*it).match( r ) ){ | ||
268 | m_currentQuery[arraycounter++] = (*it).uid(); | ||
269 | } | ||
270 | |||
271 | } | ||
272 | // Shrink to fit.. | ||
273 | m_currentQuery.resize(arraycounter); | ||
274 | |||
275 | return m_currentQuery; | ||
276 | } | ||
257 | 277 | ||
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp index 2ca0283..f868b53 100644 --- a/libopie2/opiepim/core/ocontactaccess.cpp +++ b/libopie2/opiepim/core/ocontactaccess.cpp | |||
@@ -23,2 +23,5 @@ | |||
23 | * $Log$ | 23 | * $Log$ |
24 | * Revision 1.6 2002/11/01 15:10:42 eilers | ||
25 | * Added regExp-search in database for all fields in a contact. | ||
26 | * | ||
24 | * Revision 1.5 2002/10/16 10:52:40 eilers | 27 | * Revision 1.5 2002/10/16 10:52:40 eilers |
@@ -122,2 +125,7 @@ bool OContactAccess::save () | |||
122 | 125 | ||
126 | ORecordList<OContact> OContactAccess::matchRegexp( const QRegExp &r ) const{ | ||
127 | QArray<int> matchingContacts = m_backEnd -> matchRegexp( r ); | ||
128 | return ( ORecordList<OContact>(matchingContacts, this) ); | ||
129 | } | ||
130 | |||
123 | const uint OContactAccess::querySettings() | 131 | const uint OContactAccess::querySettings() |
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h index da9c942..b4921d5 100644 --- a/libopie2/opiepim/core/ocontactaccess.h +++ b/libopie2/opiepim/core/ocontactaccess.h | |||
@@ -19,2 +19,5 @@ | |||
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.4 2002/11/01 15:10:42 eilers | ||
21 | * Added regExp-search in database for all fields in a contact. | ||
22 | * | ||
20 | * Revision 1.3 2002/10/16 10:52:40 eilers | 23 | * Revision 1.3 2002/10/16 10:52:40 eilers |
@@ -50,2 +53,3 @@ | |||
50 | * done by the backend. | 53 | * done by the backend. |
54 | * @see OPimAccessTemplate | ||
51 | */ | 55 | */ |
@@ -83,4 +87,8 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact> | |||
83 | ExactMatch = 0x0008, | 87 | ExactMatch = 0x0008, |
88 | MatchOne = 0x0010 // Only one Entry must match | ||
84 | }; | 89 | }; |
85 | 90 | ||
91 | |||
92 | ORecordList<OContact> matchRegexp( const QRegExp &r )const; | ||
93 | |||
86 | /** Return all possible settings. | 94 | /** Return all possible settings. |
diff --git a/libopie2/opiepim/ocontact.h b/libopie2/opiepim/ocontact.h index 382ab94..038a59f 100644 --- a/libopie2/opiepim/ocontact.h +++ b/libopie2/opiepim/ocontact.h | |||
@@ -109,7 +109,3 @@ public: | |||
109 | bool match( const QString ®exp ) const; | 109 | bool match( const QString ®exp ) const; |
110 | |||
111 | // DON'T ATTEMPT TO USE THIS | ||
112 | #ifdef QTOPIA_INTERNAL_CONTACT_MRE | ||
113 | bool match( const QRegExp ®exp ) const; | 110 | bool match( const QRegExp ®exp ) const; |
114 | #endif | ||
115 | 111 | ||