-rw-r--r-- | libopie/pim/opimrecord.h | 15 |
1 files changed, 13 insertions, 2 deletions
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 | |||
@@ -75,8 +75,16 @@ public: | |||
75 | /** | 75 | /** |
76 | * matches the Records the regular expression? | 76 | * matches the Records the regular expression? |
77 | */ | 77 | */ |
78 | virtual bool match( const QString ®exp ) const | 78 | virtual bool match( const QString ®exp ) 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 | /** |
82 | * converts the internal structure to a map | 90 | * converts the internal structure to a map |
@@ -121,6 +129,9 @@ public: | |||
121 | virtual bool saveToStream( QDataStream& stream )const; | 129 | virtual bool saveToStream( QDataStream& stream )const; |
122 | 130 | ||
123 | protected: | 131 | protected: |
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; |
126 | 137 | ||