author | tille <tille> | 2003-05-14 15:24:00 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-14 15:24:00 (UTC) |
commit | dbda71abdc7c13ac0acde21320ee00726d95dec4 (patch) (side-by-side diff) | |
tree | 4049f593592b6d7e8a32d9837819c96c6592ae38 | |
parent | 20509790738fae5e63a081183c8c3be3891a5bdb (diff) | |
download | opie-dbda71abdc7c13ac0acde21320ee00726d95dec4.zip opie-dbda71abdc7c13ac0acde21320ee00726d95dec4.tar.gz opie-dbda71abdc7c13ac0acde21320ee00726d95dec4.tar.bz2 |
lastHitField impl
-rw-r--r-- | libopie/pim/oevent.cpp | 20 | ||||
-rw-r--r-- | libopie/pim/otodo.cpp | 12 | ||||
-rw-r--r-- | libopie2/opiepim/oevent.cpp | 20 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.cpp | 12 |
4 files changed, 46 insertions, 18 deletions
diff --git a/libopie/pim/oevent.cpp b/libopie/pim/oevent.cpp index cda12f9..2b138c0 100644 --- a/libopie/pim/oevent.cpp +++ b/libopie/pim/oevent.cpp @@ -213,14 +213,24 @@ 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/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index a29d88e..e087a00 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp @@ -106,11 +106,15 @@ bool OTodo::match( const QRegExp ®Exp )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; } return false; 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 @@ -213,14 +213,24 @@ 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 @@ -106,11 +106,15 @@ bool OTodo::match( const QRegExp ®Exp )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; } return false; |