author | zautrix <zautrix> | 2004-10-15 14:26:07 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-15 14:26:07 (UTC) |
commit | 4f276d80bd977401d656851515474cc00c661e5b (patch) (unidiff) | |
tree | 0d3a747bef0431ef791b69876f5bda554f9ca83f /libkcal/event.cpp | |
parent | c2fb960297c4b08980921c818a4d347057732390 (diff) | |
download | kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.zip kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.tar.gz kdepimpi-4f276d80bd977401d656851515474cc00c661e5b.tar.bz2 |
many phone and sync fixes
-rw-r--r-- | libkcal/event.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index dfa265b..7256f05 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -51,16 +51,62 @@ bool KCal::operator==( const Event& e1, const Event& e2 ) | |||
51 | { | 51 | { |
52 | return operator==( (const Incidence&)e1, (const Incidence&)e2 ) && | 52 | return operator==( (const Incidence&)e1, (const Incidence&)e2 ) && |
53 | e1.dtEnd() == e2.dtEnd() && | 53 | e1.dtEnd() == e2.dtEnd() && |
54 | e1.hasEndDate() == e2.hasEndDate() && | 54 | e1.hasEndDate() == e2.hasEndDate() && |
55 | e1.transparency() == e2.transparency(); | 55 | e1.transparency() == e2.transparency(); |
56 | } | 56 | } |
57 | 57 | ||
58 | 58 | ||
59 | bool Event::contains ( Event* from ) | ||
60 | { | ||
61 | |||
62 | if ( !from->summary().isEmpty() ) | ||
63 | if ( !summary().startsWith( from->summary() )) | ||
64 | return false; | ||
65 | if ( from->dtStart().isValid() ) | ||
66 | if (dtStart() != from->dtStart() ) | ||
67 | return false; | ||
68 | if ( from->dtEnd().isValid() ) | ||
69 | if ( dtEnd() != from->dtEnd() ) | ||
70 | return false; | ||
71 | if ( !from->location().isEmpty() ) | ||
72 | if ( !location().startsWith( from->location() ) ) | ||
73 | return false; | ||
74 | if ( !from->description().isEmpty() ) | ||
75 | if ( !description().startsWith( from->description() )) | ||
76 | return false; | ||
77 | if ( from->alarms().count() ) { | ||
78 | Alarm *a = from->alarms().first(); | ||
79 | if ( a->enabled() ){ | ||
80 | if ( !alarms().count() ) | ||
81 | return false; | ||
82 | Alarm *b = alarms().first(); | ||
83 | if( ! b->enabled() ) | ||
84 | return false; | ||
85 | if ( ! (a->offset() == b->offset() )) | ||
86 | return false; | ||
87 | } | ||
88 | } | ||
89 | QStringList cat = categories(); | ||
90 | QStringList catFrom = from->categories(); | ||
91 | QString nCat; | ||
92 | int iii; | ||
93 | for ( iii = 0; iii < catFrom.count();++iii ) { | ||
94 | nCat = catFrom[iii]; | ||
95 | if ( !nCat.isEmpty() ) | ||
96 | if ( !cat.contains( nCat )) { | ||
97 | return false; | ||
98 | } | ||
99 | } | ||
100 | if ( from->doesRecur() ) | ||
101 | if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) | ||
102 | return false; | ||
103 | return true; | ||
104 | } | ||
59 | 105 | ||
60 | void Event::setDtEnd(const QDateTime &dtEnd) | 106 | void Event::setDtEnd(const QDateTime &dtEnd) |
61 | { | 107 | { |
62 | if (mReadOnly) return; | 108 | if (mReadOnly) return; |
63 | 109 | ||
64 | mDtEnd = getEvenTime( dtEnd ); | 110 | mDtEnd = getEvenTime( dtEnd ); |
65 | 111 | ||
66 | setHasEndDate(true); | 112 | setHasEndDate(true); |