summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/oevent.cpp20
-rw-r--r--libopie/pim/otodo.cpp12
-rw-r--r--libopie2/opiepim/oevent.cpp20
-rw-r--r--libopie2/opiepim/otodo.cpp12
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
@@ -203,34 +203,44 @@ void OEvent::setAllDay( bool allDay ) {
data->isAllDay = allDay;
if (allDay ) data->timezone = "UTC";
}
void OEvent::setTimeZone( const QString& tz ) {
changeOrModify();
data->timezone = tz;
}
QString OEvent::timeZone()const {
if (data->isAllDay ) return QString::fromLatin1("UTC");
return data->timezone;
}
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;
}
QString OEvent::toRichText()const {
QString text;
if ( !description().isEmpty() ) {
text += "<b>" + QObject::tr( "Description:") + "</b><br>";
text += Qtopia::escapeString(description() ).
replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
}
if ( startDateTime().isValid() ) {
text += "<b>" + QObject::tr( "Start:") + "</b> ";
text += Qtopia::escapeString(startDateTime().toString() ).
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
@@ -96,31 +96,35 @@ OTodo::OTodo(bool completed, int priority,
data->date = date;
data->isCompleted = completed;
data->hasDate = hasDate;
data->priority = priority;
data->sum = summary;
data->prog = progress;
data->desc = Qtopia::simplifyMultiLineSpace(description );
}
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;
}
return false;
}
bool OTodo::isCompleted() const
{
return data->isCompleted;
}
bool OTodo::hasDueDate() const
{
return data->hasDate;
}
bool OTodo::hasStartDate()const {
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
@@ -203,34 +203,44 @@ void OEvent::setAllDay( bool allDay ) {
data->isAllDay = allDay;
if (allDay ) data->timezone = "UTC";
}
void OEvent::setTimeZone( const QString& tz ) {
changeOrModify();
data->timezone = tz;
}
QString OEvent::timeZone()const {
if (data->isAllDay ) return QString::fromLatin1("UTC");
return data->timezone;
}
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;
}
QString OEvent::toRichText()const {
QString text;
if ( !description().isEmpty() ) {
text += "<b>" + QObject::tr( "Description:") + "</b><br>";
text += Qtopia::escapeString(description() ).
replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
}
if ( startDateTime().isValid() ) {
text += "<b>" + QObject::tr( "Start:") + "</b> ";
text += Qtopia::escapeString(startDateTime().toString() ).
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
@@ -96,31 +96,35 @@ OTodo::OTodo(bool completed, int priority,
data->date = date;
data->isCompleted = completed;
data->hasDate = hasDate;
data->priority = priority;
data->sum = summary;
data->prog = progress;
data->desc = Qtopia::simplifyMultiLineSpace(description );
}
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;
}
return false;
}
bool OTodo::isCompleted() const
{
return data->isCompleted;
}
bool OTodo::hasDueDate() const
{
return data->hasDate;
}
bool OTodo::hasStartDate()const {