summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
Unidiff
Diffstat (limited to 'libopie2/opiepim') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/ocontact.cpp1
-rw-r--r--libopie2/opiepim/ocontact.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp
index a38b62b..aeb69ee 100644
--- a/libopie2/opiepim/ocontact.cpp
+++ b/libopie2/opiepim/ocontact.cpp
@@ -949,24 +949,25 @@ void OContact::setChildren( const QString &str )
949/*! 949/*!
950 \overload 950 \overload
951 Returns TRUE if the contact matches the regular expression \a regexp. 951 Returns TRUE if the contact matches the regular expression \a regexp.
952 Otherwise returns FALSE. 952 Otherwise returns FALSE.
953*/ 953*/
954bool OContact::match( const QRegExp &r ) const 954bool OContact::match( const QRegExp &r ) const
955{ 955{
956 bool match; 956 bool match;
957 match = false; 957 match = false;
958 QMap<int, QString>::ConstIterator it; 958 QMap<int, QString>::ConstIterator it;
959 for ( it = mMap.begin(); it != mMap.end(); ++it ) { 959 for ( it = mMap.begin(); it != mMap.end(); ++it ) {
960 if ( (*it).find( r ) > -1 ) { 960 if ( (*it).find( r ) > -1 ) {
961 setLastHitField( it.key() );
961 match = true; 962 match = true;
962 break; 963 break;
963 } 964 }
964 } 965 }
965 return match; 966 return match;
966} 967}
967 968
968 969
969QString OContact::toShortText() const 970QString OContact::toShortText() const
970{ 971{
971 return ( fullName() ); 972 return ( fullName() );
972} 973}
diff --git a/libopie2/opiepim/ocontact.h b/libopie2/opiepim/ocontact.h
index 0e6cbd2..f79f0f3 100644
--- a/libopie2/opiepim/ocontact.h
+++ b/libopie2/opiepim/ocontact.h
@@ -205,25 +205,28 @@ public:
205 205
206 QString toShortText()const; 206 QString toShortText()const;
207 QString OContact::type()const; 207 QString OContact::type()const;
208 QMap<QString,QString> OContact::toExtraMap() const; 208 QMap<QString,QString> OContact::toExtraMap() const;
209 class QString OContact::recordField(int) const; 209 class QString OContact::recordField(int) const;
210 210
211 // Why private ? (eilers,se) 211 // Why private ? (eilers,se)
212 QString emailSeparator() const { return " "; } 212 QString emailSeparator() const { return " "; }
213 // the emails should be seperated by a comma 213 // the emails should be seperated by a comma
214 void setEmails( const QString &v ); 214 void setEmails( const QString &v );
215 QString emails() const { return find( Qtopia::Emails ); } 215 QString emails() const { return find( Qtopia::Emails ); }
216 static int rtti(); 216 static int rtti();
217 217 int lastHitField() const {return m_lastHitField;};
218protected:
219 mutable int m_lastHitField;
220 void setLastHitField(int i) const { m_lastHitField = i; };
218 221
219private: 222private:
220 // The XML-Backend needs some access to the private functions 223 // The XML-Backend needs some access to the private functions
221 friend class OContactAccessBackend_XML; 224 friend class OContactAccessBackend_XML;
222 225
223 void insert( int key, const QString &value ); 226 void insert( int key, const QString &value );
224 void replace( int key, const QString &value ); 227 void replace( int key, const QString &value );
225 QString find( int key ) const; 228 QString find( int key ) const;
226 static QStringList fields(); 229 static QStringList fields();
227 230
228 void save( QString &buf ) const; 231 void save( QString &buf ) const;
229 232