summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/oevent.cpp20
-rw-r--r--libopie2/opiepim/otodo.cpp12
2 files changed, 23 insertions, 9 deletions
diff --git a/libopie2/opiepim/oevent.cpp b/libopie2/opiepim/oevent.cpp
index cda12f9..2b138c0 100644
--- a/libopie2/opiepim/oevent.cpp
+++ b/libopie2/opiepim/oevent.cpp
@@ -214,12 +214,22 @@ QString OEvent::timeZone()const {
bool OEvent::match( const QRegExp& re )const {
- if ( re.match( data->description ) != -1 )
+ if ( re.match( data->description ) != -1 ){
+ setLastHitField( DatebookDescription );
return true;
- if ( re.match( data->note ) != -1 )
+ }
+ if ( re.match( data->note ) != -1 ){
+ setLastHitField( Note );
return true;
- if ( re.match( data->location ) != -1 )
+ }
+ if ( re.match( data->location ) != -1 ){
+ setLastHitField( Location );
return true;
- if ( re.match( data->start.toString() ) != -1 )
+ }
+ if ( re.match( data->start.toString() ) != -1 ){
+ setLastHitField( StartDateTime );
return true;
- if ( re.match( data->end.toString() ) != -1 )
+ }
+ if ( re.match( data->end.toString() ) != -1 ){
+ setLastHitField( EndDateTime );
return true;
+ }
return false;
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp
index a29d88e..e087a00 100644
--- a/libopie2/opiepim/otodo.cpp
+++ b/libopie2/opiepim/otodo.cpp
@@ -107,9 +107,13 @@ bool OTodo::match( const QRegExp &regExp )const
if( QString::number( data->priority ).find( regExp ) != -1 ){
- return true;
+ setLastHitField( Priority );
+ return true;
}else if( data->hasDate && data->date.toString().find( regExp) != -1 ){
- return true;
+ setLastHitField( HasDate );
+ return true;
}else if(data->desc.find( regExp ) != -1 ){
- return true;
+ setLastHitField( Description );
+ return true;
}else if(data->sum.find( regExp ) != -1 ) {
- return true;
+ setLastHitField( Summary );
+ return true;
}