summaryrefslogtreecommitdiffabout
path: root/libkcal/todo.cpp
authorzautrix <zautrix>2004-10-15 14:26:07 (UTC)
committer zautrix <zautrix>2004-10-15 14:26:07 (UTC)
commit4f276d80bd977401d656851515474cc00c661e5b (patch) (side-by-side diff)
tree0d3a747bef0431ef791b69876f5bda554f9ca83f /libkcal/todo.cpp
parentc2fb960297c4b08980921c818a4d347057732390 (diff)
downloadkdepimpi-4f276d80bd977401d656851515474cc00c661e5b.zip
kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.tar.gz
kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.tar.bz2
many phone and sync fixes
Diffstat (limited to 'libkcal/todo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 0c1e3e4..3d2de61 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -56,7 +56,65 @@ Incidence *Todo::clone()
return new Todo(*this);
}
+bool Todo::contains ( Todo* from )
+{
+ if ( !from->summary().isEmpty() )
+ if ( !summary().startsWith( from->summary() ))
+ return false;
+ if ( from->hasStartDate() ) {
+ if ( !hasStartDate() )
+ return false;
+ if ( from->dtStart() != dtStart())
+ return false;
+ }
+ if ( from->hasDueDate() ){
+ if ( !hasDueDate() )
+ return false;
+ if ( from->dtDue() != dtDue())
+ return false;
+ }
+ if ( !from->location().isEmpty() )
+ if ( !location().startsWith( from->location() ) )
+ return false;
+ if ( !from->description().isEmpty() )
+ if ( !description().startsWith( from->description() ))
+ return false;
+ if ( from->alarms().count() ) {
+ Alarm *a = from->alarms().first();
+ if ( a->enabled() ){
+ if ( !alarms().count() )
+ return false;
+ Alarm *b = alarms().first();
+ if( ! b->enabled() )
+ return false;
+ if ( ! (a->offset() == b->offset() ))
+ return false;
+ }
+ }
+
+ QStringList cat = categories();
+ QStringList catFrom = from->categories();
+ QString nCat;
+ int iii;
+ for ( iii = 0; iii < catFrom.count();++iii ) {
+ nCat = catFrom[iii];
+ if ( !nCat.isEmpty() )
+ if ( !cat.contains( nCat )) {
+ return false;
+ }
+ }
+ if ( from->isCompleted() ) {
+ if ( !isCompleted() )
+ return false;
+ }
+ if( priority() != from->priority() )
+ return false;
+
+
+ return true;
+
+}
bool KCal::operator==( const Todo& t1, const Todo& t2 )
{