-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.cpp | 13 | ||||
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.h | 6 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimaccesstemplate.h | 12 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.h | 6 |
4 files changed, 28 insertions, 9 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp index 9c9338e..2e3ec1f 100644 --- a/libopie2/opiepim/core/ocontactaccess.cpp +++ b/libopie2/opiepim/core/ocontactaccess.cpp | |||
@@ -21,6 +21,10 @@ | |||
21 | * ===================================================================== | 21 | * ===================================================================== |
22 | * History: | 22 | * History: |
23 | * $Log$ | 23 | * $Log$ |
24 | * Revision 1.8 2003/05/08 13:55:09 tille | ||
25 | * search stuff | ||
26 | * and match, toRichText & toShortText in oevent | ||
27 | * | ||
24 | * Revision 1.7 2002/11/13 14:14:51 eilers | 28 | * Revision 1.7 2002/11/13 14:14:51 eilers |
25 | * Added sorted for Contacts.. | 29 | * Added sorted for Contacts.. |
26 | * | 30 | * |
@@ -73,7 +77,7 @@ OContactAccess::OContactAccess ( const QString appname, const QString , | |||
73 | OContactAccessBackend* end, bool autosync ): | 77 | OContactAccessBackend* end, bool autosync ): |
74 | OPimAccessTemplate<OContact>( end ) | 78 | OPimAccessTemplate<OContact>( end ) |
75 | { | 79 | { |
76 | /* take care of the backend. If there is no one defined, we | 80 | /* take care of the backend. If there is no one defined, we |
77 | * will use the XML-Backend as default (until we have a cute SQL-Backend..). | 81 | * will use the XML-Backend as default (until we have a cute SQL-Backend..). |
78 | */ | 82 | */ |
79 | if( end == 0 ) { | 83 | if( end == 0 ) { |
@@ -83,7 +87,7 @@ OContactAccess::OContactAccess ( const QString appname, const QString , | |||
83 | // Set backend locally and in template | 87 | // Set backend locally and in template |
84 | m_backEnd = end; | 88 | m_backEnd = end; |
85 | OPimAccessTemplate<OContact>::setBackEnd (end); | 89 | OPimAccessTemplate<OContact>::setBackEnd (end); |
86 | 90 | ||
87 | 91 | ||
88 | /* Connect signal of external db change to function */ | 92 | /* Connect signal of external db change to function */ |
89 | QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); | 93 | QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); |
@@ -126,11 +130,6 @@ bool OContactAccess::save () | |||
126 | return true; | 130 | return true; |
127 | } | 131 | } |
128 | 132 | ||
129 | ORecordList<OContact> OContactAccess::matchRegexp( const QRegExp &r ) const{ | ||
130 | QArray<int> matchingContacts = m_backEnd -> matchRegexp( r ); | ||
131 | return ( ORecordList<OContact>(matchingContacts, this) ); | ||
132 | } | ||
133 | |||
134 | const uint OContactAccess::querySettings() | 133 | const uint OContactAccess::querySettings() |
135 | { | 134 | { |
136 | return ( m_backEnd->querySettings() ); | 135 | return ( m_backEnd->querySettings() ); |
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h index d7ceaf2..e90db32 100644 --- a/libopie2/opiepim/core/ocontactaccess.h +++ b/libopie2/opiepim/core/ocontactaccess.h | |||
@@ -17,6 +17,10 @@ | |||
17 | * ===================================================================== | 17 | * ===================================================================== |
18 | * History: | 18 | * History: |
19 | * $Log$ | 19 | * $Log$ |
20 | * Revision 1.8 2003/05/08 13:55:09 tille | ||
21 | * search stuff | ||
22 | * and match, toRichText & toShortText in oevent | ||
23 | * | ||
20 | * Revision 1.7 2003/04/13 18:07:10 zecke | 24 | * Revision 1.7 2003/04/13 18:07:10 zecke |
21 | * More API doc | 25 | * More API doc |
22 | * QString -> const QString& | 26 | * QString -> const QString& |
@@ -110,8 +114,6 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact> | |||
110 | }; | 114 | }; |
111 | 115 | ||
112 | 116 | ||
113 | ORecordList<OContact> matchRegexp( const QRegExp &r )const; | ||
114 | |||
115 | /** Return all Contacts in a sorted manner. | 117 | /** Return all Contacts in a sorted manner. |
116 | * @param ascending true: Sorted in acending order. | 118 | * @param ascending true: Sorted in acending order. |
117 | * @param sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess | 119 | * @param sortOrder Currently not implemented. Just defined to stay compatible to otodoaccess |
diff --git a/libopie2/opiepim/core/opimaccesstemplate.h b/libopie2/opiepim/core/opimaccesstemplate.h index 6a3a0db..8ff205c 100644 --- a/libopie2/opiepim/core/opimaccesstemplate.h +++ b/libopie2/opiepim/core/opimaccesstemplate.h | |||
@@ -69,6 +69,12 @@ public: | |||
69 | * you can iterate over them | 69 | * you can iterate over them |
70 | */ | 70 | */ |
71 | virtual List allRecords()const; | 71 | virtual List allRecords()const; |
72 | |||
73 | /** | ||
74 | * return a List of records | ||
75 | * that match the regex | ||
76 | */ | ||
77 | virtual List matchRegexp( const QRegExp &r ) const; | ||
72 | 78 | ||
73 | /** | 79 | /** |
74 | * queryByExample. | 80 | * queryByExample. |
@@ -181,6 +187,12 @@ typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { | |||
181 | return lis; | 187 | return lis; |
182 | } | 188 | } |
183 | template <class T> | 189 | template <class T> |
190 | typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::matchRegexp( const QRegExp &r )const { | ||
191 | QArray<int> ints = m_backEnd->matchRegexp( r ); | ||
192 | List lis(ints, this ); | ||
193 | return lis; | ||
194 | } | ||
195 | template <class T> | ||
184 | QArray<int> OPimAccessTemplate<T>::records()const { | 196 | QArray<int> OPimAccessTemplate<T>::records()const { |
185 | return m_backEnd->allRecords(); | 197 | return m_backEnd->allRecords(); |
186 | } | 198 | } |
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index c7f9460..de2d9f4 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h | |||
@@ -73,6 +73,12 @@ public: | |||
73 | virtual QString type()const = 0; | 73 | virtual QString type()const = 0; |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * matches the Records the regular expression? | ||
77 | */ | ||
78 | virtual bool match( const QString ®exp ) const {return match(QRegExp(regexp));}; | ||
79 | virtual bool match( const QRegExp ®exp ) const = 0; | ||
80 | |||
81 | /** | ||
76 | * converts the internal structure to a map | 82 | * converts the internal structure to a map |
77 | */ | 83 | */ |
78 | virtual QMap<int, QString> toMap()const = 0; | 84 | virtual QMap<int, QString> toMap()const = 0; |