summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontact.cpp1
-rw-r--r--libopie/pim/ocontact.h4
-rw-r--r--libopie/pim/opimrecord.cpp8
-rw-r--r--libopie/pim/opimrecord.h15
-rw-r--r--libopie2/opiepim/core/opimrecord.cpp8
-rw-r--r--libopie2/opiepim/core/opimrecord.h15
-rw-r--r--libopie2/opiepim/ocontact.cpp1
-rw-r--r--libopie2/opiepim/ocontact.h4
8 files changed, 44 insertions, 12 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp
index aeb69ee..a7ca975 100644
--- a/libopie/pim/ocontact.cpp
+++ b/libopie/pim/ocontact.cpp
@@ -954,4 +954,5 @@ void OContact::setChildren( const QString &str )
954bool OContact::match( const QRegExp &r ) const 954bool OContact::match( const QRegExp &r ) const
955{ 955{
956 setLastHitField( -1 );
956 bool match; 957 bool match;
957 match = false; 958 match = false;
diff --git a/libopie/pim/ocontact.h b/libopie/pim/ocontact.h
index f79f0f3..dd2de17 100644
--- a/libopie/pim/ocontact.h
+++ b/libopie/pim/ocontact.h
@@ -215,8 +215,4 @@ public:
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 int lastHitField() const {return m_lastHitField;};
218protected:
219 mutable int m_lastHitField;
220 void setLastHitField(int i) const { m_lastHitField = i; };
221 217
222private: 218private:
diff --git a/libopie/pim/opimrecord.cpp b/libopie/pim/opimrecord.cpp
index d45417a..9510357 100644
--- a/libopie/pim/opimrecord.cpp
+++ b/libopie/pim/opimrecord.cpp
@@ -12,4 +12,5 @@ OPimRecord::OPimRecord( int uid )
12 : Qtopia::Record() { 12 : Qtopia::Record() {
13 13
14 m_lastHit = -1;
14 setUid( uid ); 15 setUid( uid );
15} 16}
@@ -25,4 +26,5 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
25 Qtopia::Record::operator=( rec ); 26 Qtopia::Record::operator=( rec );
26 m_xrefman = rec.m_xrefman; 27 m_xrefman = rec.m_xrefman;
28 m_lastHit = rec.m_lastHit;
27 29
28 return *this; 30 return *this;
@@ -165,2 +167,8 @@ OPimXRefPartner OPimRecord::partner( QDataStream& stream ) {
165 return par; 167 return par;
166} 168}
169void OPimRecord::setLastHitField( int lastHit )const {
170 m_lastHit = lastHit;
171}
172int OPimRecord::lastHitField()const{
173 return m_lastHit;
174}
diff --git a/libopie/pim/opimrecord.h b/libopie/pim/opimrecord.h
index 6e7c0da..494c78e 100644
--- a/libopie/pim/opimrecord.h
+++ b/libopie/pim/opimrecord.h
@@ -76,6 +76,14 @@ public:
76 * matches the Records the regular expression? 76 * matches the Records the regular expression?
77 */ 77 */
78 virtual bool match( const QString &regexp ) const 78 virtual bool match( const QString &regexp ) const
79 {return Qtopia::Record::match(QRegExp(regexp));}; 79 {setLastHitField( -1 );
80 return Qtopia::Record::match(QRegExp(regexp));};
81
82 /**
83 * if implemented this function returns which item has been
84 * last hit by the match() function.
85 * or -1 if not implemented or no hit has occured
86 */
87 int lastHitField()const;
80 88
81 /** 89 /**
@@ -122,4 +130,7 @@ public:
122 130
123protected: 131protected:
132 // need to be const cause it is called from const methods
133 mutable int m_lastHit;
134 void setLastHitField( int lastHit )const;
124 Qtopia::UidGen &uidGen(); 135 Qtopia::UidGen &uidGen();
125// QString crossToString()const; 136// QString crossToString()const;
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp
index d45417a..9510357 100644
--- a/libopie2/opiepim/core/opimrecord.cpp
+++ b/libopie2/opiepim/core/opimrecord.cpp
@@ -12,4 +12,5 @@ OPimRecord::OPimRecord( int uid )
12 : Qtopia::Record() { 12 : Qtopia::Record() {
13 13
14 m_lastHit = -1;
14 setUid( uid ); 15 setUid( uid );
15} 16}
@@ -25,4 +26,5 @@ OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
25 Qtopia::Record::operator=( rec ); 26 Qtopia::Record::operator=( rec );
26 m_xrefman = rec.m_xrefman; 27 m_xrefman = rec.m_xrefman;
28 m_lastHit = rec.m_lastHit;
27 29
28 return *this; 30 return *this;
@@ -165,2 +167,8 @@ OPimXRefPartner OPimRecord::partner( QDataStream& stream ) {
165 return par; 167 return par;
166} 168}
169void OPimRecord::setLastHitField( int lastHit )const {
170 m_lastHit = lastHit;
171}
172int OPimRecord::lastHitField()const{
173 return m_lastHit;
174}
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h
index 6e7c0da..494c78e 100644
--- a/libopie2/opiepim/core/opimrecord.h
+++ b/libopie2/opiepim/core/opimrecord.h
@@ -76,6 +76,14 @@ public:
76 * matches the Records the regular expression? 76 * matches the Records the regular expression?
77 */ 77 */
78 virtual bool match( const QString &regexp ) const 78 virtual bool match( const QString &regexp ) const
79 {return Qtopia::Record::match(QRegExp(regexp));}; 79 {setLastHitField( -1 );
80 return Qtopia::Record::match(QRegExp(regexp));};
81
82 /**
83 * if implemented this function returns which item has been
84 * last hit by the match() function.
85 * or -1 if not implemented or no hit has occured
86 */
87 int lastHitField()const;
80 88
81 /** 89 /**
@@ -122,4 +130,7 @@ public:
122 130
123protected: 131protected:
132 // need to be const cause it is called from const methods
133 mutable int m_lastHit;
134 void setLastHitField( int lastHit )const;
124 Qtopia::UidGen &uidGen(); 135 Qtopia::UidGen &uidGen();
125// QString crossToString()const; 136// QString crossToString()const;
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp
index aeb69ee..a7ca975 100644
--- a/libopie2/opiepim/ocontact.cpp
+++ b/libopie2/opiepim/ocontact.cpp
@@ -954,4 +954,5 @@ void OContact::setChildren( const QString &str )
954bool OContact::match( const QRegExp &r ) const 954bool OContact::match( const QRegExp &r ) const
955{ 955{
956 setLastHitField( -1 );
956 bool match; 957 bool match;
957 match = false; 958 match = false;
diff --git a/libopie2/opiepim/ocontact.h b/libopie2/opiepim/ocontact.h
index f79f0f3..dd2de17 100644
--- a/libopie2/opiepim/ocontact.h
+++ b/libopie2/opiepim/ocontact.h
@@ -215,8 +215,4 @@ public:
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 int lastHitField() const {return m_lastHitField;};
218protected:
219 mutable int m_lastHitField;
220 void setLastHitField(int i) const { m_lastHitField = i; };
221 217
222private: 218private: