author | zecke <zecke> | 2002-09-20 17:28:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-20 17:28:20 (UTC) |
commit | 55dd11ddae09bfc4907399c473f0387c135fdae6 (patch) (unidiff) | |
tree | 69d52e2f0e1030bbdcbf518f0a334ff4861500fa /libopie2/opiepim | |
parent | 40df2487c53a5ab484d33d619f5b6ed449c0b485 (diff) | |
download | opie-55dd11ddae09bfc4907399c473f0387c135fdae6.zip opie-55dd11ddae09bfc4907399c473f0387c135fdae6.tar.gz opie-55dd11ddae09bfc4907399c473f0387c135fdae6.tar.bz2 |
OTodo know is the first implementation of OPimRecord
-rw-r--r-- | libopie2/opiepim/core/opimrecord.cpp | 26 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.h | 4 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.cpp | 265 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.h | 26 |
4 files changed, 95 insertions, 226 deletions
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index 95de1df..d8f73c7 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp | |||
@@ -4,3 +4,5 @@ OPimRecord::OPimRecord( int uid ) | |||
4 | : Qtopia::Record() { | 4 | : Qtopia::Record() { |
5 | |||
5 | setUid( uid ); | 6 | setUid( uid ); |
7 | /* assign a new UID */ | ||
6 | if ( uid == 1 ) | 8 | if ( uid == 1 ) |
@@ -10,3 +12,3 @@ OPimRecord::~OPimRecord() { | |||
10 | } | 12 | } |
11 | OPimRecord::OPimRecord( OPimRecord& rec ) | 13 | OPimRecord::OPimRecord( const OPimRecord& rec ) |
12 | : Qtopia::Record( rec ) | 14 | : Qtopia::Record( rec ) |
@@ -17,5 +19,5 @@ OPimRecord::OPimRecord( OPimRecord& rec ) | |||
17 | OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { | 19 | OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { |
18 | /* how do I call the parent copy operator ? */ | 20 | Qtopia::Record::operator=( rec ); |
19 | setUid( rec.uid() ); | 21 | m_relations = rec.m_relations; |
20 | setCategories( rec.categories() ); | 22 | |
21 | return *this; | 23 | return *this; |
@@ -27,3 +29,3 @@ QStringList OPimRecord::categoryNames()const { | |||
27 | } | 29 | } |
28 | void OPimRecord::setCategoryName( const QStringList& ) { | 30 | void OPimRecord::setCategoryNames( const QStringList& ) { |
29 | 31 | ||
@@ -90 +92,15 @@ void OPimRecord::setRelations( const QString& app, QArray<int> ids ) { | |||
90 | } | 92 | } |
93 | QString OPimRecord::crossToString()const { | ||
94 | QString str; | ||
95 | QMap<QString, QArray<int> >::ConstIterator it; | ||
96 | for (it = m_relations.begin(); it != m_relations.end(); ++it ) { | ||
97 | QArray<int> id = it.data(); | ||
98 | for ( uint i = 0; i < id.size(); ++i ) { | ||
99 | str += it.key() + "," + QString::number( i ) + ";"; | ||
100 | } | ||
101 | } | ||
102 | str = str.remove( str.length()-1, 1); // strip the ; | ||
103 | //qWarning("IDS " + str ); | ||
104 | |||
105 | return str; | ||
106 | } | ||
diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index a0e0413..18112d4 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h | |||
@@ -21,3 +21,3 @@ public: | |||
21 | */ | 21 | */ |
22 | OPimRecord( OPimRecord& rec ); | 22 | OPimRecord( const OPimRecord& rec ); |
23 | 23 | ||
@@ -36,3 +36,3 @@ public: | |||
36 | */ | 36 | */ |
37 | void setCategoryName( const QStringList& ); | 37 | void setCategoryNames( const QStringList& ); |
38 | 38 | ||
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index d8e0447..3c93838 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp | |||
@@ -13,10 +13,9 @@ | |||
13 | 13 | ||
14 | #include "todoevent.h" | ||
15 | 14 | ||
16 | using namespace Opie; | ||
17 | 15 | ||
18 | Qtopia::UidGen ToDoEvent::m_gen; | 16 | #include "otodo.h" |
19 | 17 | ||
20 | struct ToDoEvent::ToDoEventData : public QShared { | 18 | |
21 | ToDoEventData() : QShared() { | 19 | struct OTodo::OTodoData : public QShared { |
20 | OTodoData() : QShared() { | ||
22 | }; | 21 | }; |
@@ -31,4 +30,2 @@ struct ToDoEvent::ToDoEventData : public QShared { | |||
31 | QMap<QString, QString> extra; | 30 | QMap<QString, QString> extra; |
32 | QMap<QString, QArray<int> > relations; | ||
33 | int uid; | ||
34 | ushort prog; | 31 | ushort prog; |
@@ -38,4 +35,4 @@ struct ToDoEvent::ToDoEventData : public QShared { | |||
38 | 35 | ||
39 | ToDoEvent::ToDoEvent(const ToDoEvent &event ) | 36 | OTodo::OTodo(const OTodo &event ) |
40 | : data( event.data ) | 37 | : OPimRecord( event ), data( event.data ) |
41 | { | 38 | { |
@@ -44,5 +41,5 @@ ToDoEvent::ToDoEvent(const ToDoEvent &event ) | |||
44 | } | 41 | } |
45 | ToDoEvent::~ToDoEvent() { | 42 | OTodo::~OTodo() { |
46 | if ( data->deref() ) { | 43 | if ( data->deref() ) { |
47 | //qWarning("ToDoEvent::dereffing"); | 44 | //qWarning("OTodo::dereffing"); |
48 | delete data; | 45 | delete data; |
@@ -52,3 +49,3 @@ ToDoEvent::~ToDoEvent() { | |||
52 | 49 | ||
53 | ToDoEvent::ToDoEvent(bool completed, int priority, | 50 | OTodo::OTodo(bool completed, int priority, |
54 | const QStringList &category, | 51 | const QStringList &category, |
@@ -58,5 +55,7 @@ ToDoEvent::ToDoEvent(bool completed, int priority, | |||
58 | bool hasDate, QDate date, int uid ) | 55 | bool hasDate, QDate date, int uid ) |
56 | : OPimRecord( uid ) | ||
59 | { | 57 | { |
60 | //qWarning("ToDoEventData"); | 58 | //qWarning("OTodoData"); |
61 | data = new ToDoEventData; | 59 | setCategories( idsFromString( category.join(";") ) ); |
60 | data = new OTodoData; | ||
62 | data->date = date; | 61 | data->date = date; |
@@ -65,3 +64,2 @@ ToDoEvent::ToDoEvent(bool completed, int priority, | |||
65 | data->priority = priority; | 64 | data->priority = priority; |
66 | data->category = category; | ||
67 | data->sum = summary; | 65 | data->sum = summary; |
@@ -69,9 +67,2 @@ ToDoEvent::ToDoEvent(bool completed, int priority, | |||
69 | data->desc = Qtopia::simplifyMultiLineSpace(description ); | 67 | data->desc = Qtopia::simplifyMultiLineSpace(description ); |
70 | if (uid == -1 ) { | ||
71 | uid = m_gen.generate(); | ||
72 | |||
73 | }// generated the ids | ||
74 | m_gen.store( uid ); | ||
75 | |||
76 | data->uid = uid; | ||
77 | data->hasAlarmDateTime = false; | 68 | data->hasAlarmDateTime = false; |
@@ -79,10 +70,3 @@ ToDoEvent::ToDoEvent(bool completed, int priority, | |||
79 | } | 70 | } |
80 | QArray<int> ToDoEvent::categories()const | 71 | bool OTodo::match( const QRegExp ®Exp )const |
81 | { | ||
82 | qWarning( "ToDoEvent:cats" + data->category.join(";") ); | ||
83 | QArray<int> array(data->category.count() ); // currently the datebook can be only in one category | ||
84 | array = Qtopia::Record::idsFromString( data->category.join(";") ); | ||
85 | return array; | ||
86 | } | ||
87 | bool ToDoEvent::match( const QRegExp ®Exp )const | ||
88 | { | 72 | { |
@@ -94,2 +78,4 @@ bool ToDoEvent::match( const QRegExp ®Exp )const | |||
94 | return true; | 78 | return true; |
79 | }else if(data->sum.find( regExp ) != -1 ) { | ||
80 | return true; | ||
95 | } | 81 | } |
@@ -97,3 +83,3 @@ bool ToDoEvent::match( const QRegExp ®Exp )const | |||
97 | } | 83 | } |
98 | bool ToDoEvent::isCompleted() const | 84 | bool OTodo::isCompleted() const |
99 | { | 85 | { |
@@ -101,3 +87,3 @@ bool ToDoEvent::isCompleted() const | |||
101 | } | 87 | } |
102 | bool ToDoEvent::hasDueDate() const | 88 | bool OTodo::hasDueDate() const |
103 | { | 89 | { |
@@ -105,3 +91,3 @@ bool ToDoEvent::hasDueDate() const | |||
105 | } | 91 | } |
106 | bool ToDoEvent::hasAlarmDateTime() const | 92 | bool OTodo::hasAlarmDateTime() const |
107 | { | 93 | { |
@@ -109,3 +95,3 @@ bool ToDoEvent::hasAlarmDateTime() const | |||
109 | } | 95 | } |
110 | int ToDoEvent::priority()const | 96 | int OTodo::priority()const |
111 | { | 97 | { |
@@ -113,11 +99,3 @@ int ToDoEvent::priority()const | |||
113 | } | 99 | } |
114 | QStringList ToDoEvent::allCategories()const | 100 | QString OTodo::summary() const |
115 | { | ||
116 | return data->category; | ||
117 | } | ||
118 | QString ToDoEvent::extra(const QString& )const | ||
119 | { | ||
120 | return QString::null; | ||
121 | } | ||
122 | QString ToDoEvent::summary() const | ||
123 | { | 101 | { |
@@ -125,3 +103,3 @@ QString ToDoEvent::summary() const | |||
125 | } | 103 | } |
126 | ushort ToDoEvent::progress() const | 104 | ushort OTodo::progress() const |
127 | { | 105 | { |
@@ -129,38 +107,3 @@ ushort ToDoEvent::progress() const | |||
129 | } | 107 | } |
130 | QStringList ToDoEvent::relatedApps() const | 108 | QDate OTodo::dueDate()const |
131 | { | ||
132 | QStringList list; | ||
133 | QMap<QString, QArray<int> >::ConstIterator it; | ||
134 | for ( it = data->relations.begin(); it != data->relations.end(); ++it ) { | ||
135 | list << it.key(); | ||
136 | } | ||
137 | return list; | ||
138 | } | ||
139 | QArray<int> ToDoEvent::relations( const QString& app)const | ||
140 | { | ||
141 | QArray<int> tmp; | ||
142 | QMap<QString, QArray<int> >::ConstIterator it; | ||
143 | it = data->relations.find( app); | ||
144 | if ( it != data->relations.end() ) | ||
145 | tmp = it.data(); | ||
146 | return tmp; | ||
147 | } | ||
148 | void ToDoEvent::insertCategory(const QString &str ) | ||
149 | { | ||
150 | changeOrModify(); | ||
151 | qWarning("insert category;" + str ); | ||
152 | data->category.append( str ); | ||
153 | } | ||
154 | void ToDoEvent::clearCategories() | ||
155 | { | ||
156 | changeOrModify(); | ||
157 | data->category.clear(); | ||
158 | } | ||
159 | void ToDoEvent::setCategories(const QStringList &list ) | ||
160 | { | ||
161 | changeOrModify(); | ||
162 | qWarning("set categories" + list.join(";") ); | ||
163 | data->category = list; | ||
164 | } | ||
165 | QDate ToDoEvent::dueDate()const | ||
166 | { | 109 | { |
@@ -169,3 +112,3 @@ QDate ToDoEvent::dueDate()const | |||
169 | 112 | ||
170 | QDateTime ToDoEvent::alarmDateTime() const | 113 | QDateTime OTodo::alarmDateTime() const |
171 | { | 114 | { |
@@ -174,3 +117,3 @@ QDateTime ToDoEvent::alarmDateTime() const | |||
174 | 117 | ||
175 | QString ToDoEvent::description()const | 118 | QString OTodo::description()const |
176 | { | 119 | { |
@@ -178,3 +121,3 @@ QString ToDoEvent::description()const | |||
178 | } | 121 | } |
179 | void ToDoEvent::setCompleted( bool completed ) | 122 | void OTodo::setCompleted( bool completed ) |
180 | { | 123 | { |
@@ -183,3 +126,3 @@ void ToDoEvent::setCompleted( bool completed ) | |||
183 | } | 126 | } |
184 | void ToDoEvent::setHasDueDate( bool hasDate ) | 127 | void OTodo::setHasDueDate( bool hasDate ) |
185 | { | 128 | { |
@@ -188,3 +131,3 @@ void ToDoEvent::setHasDueDate( bool hasDate ) | |||
188 | } | 131 | } |
189 | void ToDoEvent::setHasAlarmDateTime( bool hasAlarmDateTime ) | 132 | void OTodo::setHasAlarmDateTime( bool hasAlarmDateTime ) |
190 | { | 133 | { |
@@ -193,3 +136,3 @@ void ToDoEvent::setHasAlarmDateTime( bool hasAlarmDateTime ) | |||
193 | } | 136 | } |
194 | void ToDoEvent::setDescription(const QString &desc ) | 137 | void OTodo::setDescription(const QString &desc ) |
195 | { | 138 | { |
@@ -198,7 +141,3 @@ void ToDoEvent::setDescription(const QString &desc ) | |||
198 | } | 141 | } |
199 | void ToDoEvent::setExtra( const QString&, const QString& ) | 142 | void OTodo::setSummary( const QString& sum ) |
200 | { | ||
201 | |||
202 | } | ||
203 | void ToDoEvent::setSummary( const QString& sum ) | ||
204 | { | 143 | { |
@@ -207,10 +146,3 @@ void ToDoEvent::setSummary( const QString& sum ) | |||
207 | } | 146 | } |
208 | void ToDoEvent::setCategory( const QString &cat ) | 147 | void OTodo::setPriority(int prio ) |
209 | { | ||
210 | changeOrModify(); | ||
211 | //qWarning("setCategory %s", cat.latin1() ); | ||
212 | data->category.clear(); | ||
213 | data->category << cat; | ||
214 | } | ||
215 | void ToDoEvent::setPriority(int prio ) | ||
216 | { | 148 | { |
@@ -219,3 +151,3 @@ void ToDoEvent::setPriority(int prio ) | |||
219 | } | 151 | } |
220 | void ToDoEvent::setDueDate( QDate date ) | 152 | void OTodo::setDueDate( QDate date ) |
221 | { | 153 | { |
@@ -224,3 +156,3 @@ void ToDoEvent::setDueDate( QDate date ) | |||
224 | } | 156 | } |
225 | void ToDoEvent::setAlarmDateTime( const QDateTime& alarm ) | 157 | void OTodo::setAlarmDateTime( const QDateTime& alarm ) |
226 | { | 158 | { |
@@ -229,47 +161,3 @@ void ToDoEvent::setAlarmDateTime( const QDateTime& alarm ) | |||
229 | } | 161 | } |
230 | void ToDoEvent::addRelated( const QString &app, int id ) | 162 | bool OTodo::isOverdue( ) |
231 | { | ||
232 | changeOrModify(); | ||
233 | |||
234 | QMap<QString, QArray<int> >::Iterator it; | ||
235 | QArray<int> tmp; | ||
236 | it = data->relations.find( app ); | ||
237 | if ( it == data->relations.end() ) { | ||
238 | tmp.resize(1 ); | ||
239 | tmp[0] = id; | ||
240 | }else{ | ||
241 | tmp = it.data(); | ||
242 | tmp.resize( tmp.size() + 1 ); | ||
243 | tmp[tmp.size() - 1] = id; | ||
244 | } | ||
245 | data->relations.replace( app, tmp ); | ||
246 | } | ||
247 | void ToDoEvent::addRelated(const QString& app, QArray<int> ids ) | ||
248 | { | ||
249 | changeOrModify(); | ||
250 | |||
251 | QMap<QString, QArray<int> >::Iterator it; | ||
252 | QArray<int> tmp; | ||
253 | it = data->relations.find( app); | ||
254 | if ( it == data->relations.end() ) { // not there | ||
255 | /** tmp.resize( ids.size() ); stupid?? | ||
256 | */ | ||
257 | tmp = ids; | ||
258 | }else{ | ||
259 | tmp = it.data(); | ||
260 | int offset = tmp.size()-1; | ||
261 | tmp.resize( tmp.size() + ids.size() ); | ||
262 | for (uint i = 0; i < ids.size(); i++ ) { | ||
263 | tmp[offset+i] = ids[i]; | ||
264 | } | ||
265 | |||
266 | } | ||
267 | data->relations.replace( app, tmp ); | ||
268 | } | ||
269 | void ToDoEvent::clearRelated( const QString& app ) | ||
270 | { | ||
271 | changeOrModify(); | ||
272 | data->relations.remove( app ); | ||
273 | } | ||
274 | bool ToDoEvent::isOverdue( ) | ||
275 | { | 163 | { |
@@ -279,3 +167,3 @@ bool ToDoEvent::isOverdue( ) | |||
279 | } | 167 | } |
280 | void ToDoEvent::setProgress(ushort progress ) | 168 | void OTodo::setProgress(ushort progress ) |
281 | { | 169 | { |
@@ -284,2 +172,5 @@ void ToDoEvent::setProgress(ushort progress ) | |||
284 | } | 172 | } |
173 | QString OTodo::toShortText() const { | ||
174 | return summary(); | ||
175 | } | ||
285 | /*! | 176 | /*! |
@@ -287,3 +178,3 @@ void ToDoEvent::setProgress(ushort progress ) | |||
287 | */ | 178 | */ |
288 | QString ToDoEvent::richText() const | 179 | QString OTodo::toRichText() const |
289 | { | 180 | { |
@@ -318,20 +209,6 @@ QString ToDoEvent::richText() const | |||
318 | 209 | ||
319 | // Open database of all categories and get the list of | ||
320 | // the categories this todoevent belongs to. | ||
321 | // Then print them... | ||
322 | // I am not sure whether there is no better way doing this !? | ||
323 | Categories catdb; | ||
324 | bool firstloop = true; | ||
325 | catdb.load( categoryFileName() ); | ||
326 | catlist = allCategories(); | ||
327 | |||
328 | text += "<b>" + QObject::tr( "Category:") + "</b> "; | 210 | text += "<b>" + QObject::tr( "Category:") + "</b> "; |
329 | for ( QStringList::Iterator it = catlist.begin(); it != catlist.end(); ++it ) { | 211 | text += categoryNames().join(", "); |
330 | if (!firstloop){ | ||
331 | text += ", "; | ||
332 | } | ||
333 | firstloop = false; | ||
334 | text += catdb.label ("todo", (*it).toInt()); | ||
335 | } | ||
336 | text += "<br>"; | 212 | text += "<br>"; |
213 | |||
337 | return text; | 214 | return text; |
@@ -339,3 +216,3 @@ QString ToDoEvent::richText() const | |||
339 | 216 | ||
340 | bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{ | 217 | bool OTodo::operator<( const OTodo &toDoEvent )const{ |
341 | if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; | 218 | if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; |
@@ -351,3 +228,3 @@ bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{ | |||
351 | } | 228 | } |
352 | bool ToDoEvent::operator<=(const ToDoEvent &toDoEvent )const | 229 | bool OTodo::operator<=(const OTodo &toDoEvent )const |
353 | { | 230 | { |
@@ -364,3 +241,3 @@ bool ToDoEvent::operator<=(const ToDoEvent &toDoEvent )const | |||
364 | } | 241 | } |
365 | bool ToDoEvent::operator>(const ToDoEvent &toDoEvent )const | 242 | bool OTodo::operator>(const OTodo &toDoEvent )const |
366 | { | 243 | { |
@@ -377,3 +254,3 @@ bool ToDoEvent::operator>(const ToDoEvent &toDoEvent )const | |||
377 | } | 254 | } |
378 | bool ToDoEvent::operator>=(const ToDoEvent &toDoEvent )const | 255 | bool OTodo::operator>=(const OTodo &toDoEvent )const |
379 | { | 256 | { |
@@ -390,3 +267,3 @@ bool ToDoEvent::operator>=(const ToDoEvent &toDoEvent )const | |||
390 | } | 267 | } |
391 | bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const | 268 | bool OTodo::operator==(const OTodo &toDoEvent )const |
392 | { | 269 | { |
@@ -406,3 +283,3 @@ bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const | |||
406 | } | 283 | } |
407 | void ToDoEvent::deref() { | 284 | void OTodo::deref() { |
408 | 285 | ||
@@ -415,4 +292,5 @@ void ToDoEvent::deref() { | |||
415 | } | 292 | } |
416 | ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item ) | 293 | OTodo &OTodo::operator=(const OTodo &item ) |
417 | { | 294 | { |
295 | OPimRecord::operator=( item ); | ||
418 | //qWarning("operator= ref "); | 296 | //qWarning("operator= ref "); |
@@ -421,5 +299,2 @@ ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item ) | |||
421 | 299 | ||
422 | data = item.data; | ||
423 | |||
424 | |||
425 | return *this; | 300 | return *this; |
@@ -427,7 +302,7 @@ ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item ) | |||
427 | 302 | ||
428 | QMap<int, QString> ToDoEvent::toMap() const { | 303 | QMap<int, QString> OTodo::toMap() const { |
429 | QMap<int, QString> map; | 304 | QMap<int, QString> map; |
430 | 305 | ||
431 | map.insert( Uid, QString::number( data->uid ) ); | 306 | map.insert( Uid, QString::number( uid() ) ); |
432 | map.insert( Category, data->category.join(";") ); | 307 | map.insert( Category, idsToString( categories() ) ); |
433 | map.insert( HasDate, QString::number( data->hasDate ) ); | 308 | map.insert( HasDate, QString::number( data->hasDate ) ); |
@@ -448,28 +323,3 @@ QMap<int, QString> ToDoEvent::toMap() const { | |||
448 | 323 | ||
449 | 324 | QMap<QString, QString> OTodo::toExtraMap()const { | |
450 | QString ToDoEvent::crossToString()const { | ||
451 | QString str; | ||
452 | QMap<QString, QArray<int> >::ConstIterator it; | ||
453 | for (it = data->relations.begin(); it != data->relations.end(); ++it ) { | ||
454 | QArray<int> id = it.data(); | ||
455 | for ( uint i = 0; i < id.size(); ++i ) { | ||
456 | str += it.key() + "," + QString::number( i ) + ";"; | ||
457 | } | ||
458 | } | ||
459 | str = str.remove( str.length()-1, 1); // strip the ; | ||
460 | //qWarning("IDS " + str ); | ||
461 | |||
462 | return str; | ||
463 | } | ||
464 | int ToDoEvent::uid()const { | ||
465 | return data->uid; | ||
466 | } | ||
467 | void ToDoEvent::setUid( int id ) { | ||
468 | if ( id == -1 ) | ||
469 | id = m_gen.generate(); | ||
470 | m_gen.store(id ); | ||
471 | changeOrModify(); | ||
472 | data->uid = id; | ||
473 | } | ||
474 | QMap<QString, QString> ToDoEvent::extras()const { | ||
475 | return data->extra; | 325 | return data->extra; |
@@ -481,3 +331,3 @@ QMap<QString, QString> ToDoEvent::extras()const { | |||
481 | */ | 331 | */ |
482 | void ToDoEvent::changeOrModify() { | 332 | void OTodo::changeOrModify() { |
483 | if ( data->count != 1 ) { | 333 | if ( data->count != 1 ) { |
@@ -485,3 +335,3 @@ void ToDoEvent::changeOrModify() { | |||
485 | data->deref(); | 335 | data->deref(); |
486 | ToDoEventData* d2 = new ToDoEventData(); | 336 | OTodoData* d2 = new OTodoData(); |
487 | copy(data, d2 ); | 337 | copy(data, d2 ); |
@@ -490,3 +340,3 @@ void ToDoEvent::changeOrModify() { | |||
490 | } | 340 | } |
491 | void ToDoEvent::copy( ToDoEventData* src, ToDoEventData* dest ) { | 341 | void OTodo::copy( OTodoData* src, OTodoData* dest ) { |
492 | dest->date = src->date; | 342 | dest->date = src->date; |
@@ -495,3 +345,2 @@ void ToDoEvent::copy( ToDoEventData* src, ToDoEventData* dest ) { | |||
495 | dest->priority = src->priority; | 345 | dest->priority = src->priority; |
496 | dest->category = src->category; | ||
497 | dest->desc = src->desc; | 346 | dest->desc = src->desc; |
@@ -499,4 +348,2 @@ void ToDoEvent::copy( ToDoEventData* src, ToDoEventData* dest ) { | |||
499 | dest->extra = src->extra; | 348 | dest->extra = src->extra; |
500 | dest->relations = src->relations; | ||
501 | dest->uid = src->uid; | ||
502 | dest->prog = src->prog; | 349 | dest->prog = src->prog; |
diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h index 429108a..e1729db 100644 --- a/libopie2/opiepim/otodo.h +++ b/libopie2/opiepim/otodo.h | |||
@@ -20,3 +20,3 @@ class OTodo : public OPimRecord { | |||
20 | public: | 20 | public: |
21 | typedef QValueList<ToDoEvent> ValueList; | 21 | typedef QValueList<OTodo> ValueList; |
22 | enum RecordFields { | 22 | enum RecordFields { |
@@ -120,2 +120,9 @@ public: | |||
120 | 120 | ||
121 | /** | ||
122 | * reimplementation | ||
123 | */ | ||
124 | QString type()const; | ||
125 | QString toShortText()const; | ||
126 | QMap<QString, QString> toExtraMap()const; | ||
127 | QString recordField(int id )const; | ||
121 | 128 | ||
@@ -185,3 +192,3 @@ public: | |||
185 | bool operator==(const OTodo &toDoEvent )const; | 192 | bool operator==(const OTodo &toDoEvent )const; |
186 | ToDoEvent &operator=(const OTodo &toDoEvent ); | 193 | OTodo &operator=(const OTodo &toDoEvent ); |
187 | 194 | ||
@@ -189,3 +196,3 @@ public: | |||
189 | class OTodoPrivate; | 196 | class OTodoPrivate; |
190 | struct OTodoEventData; | 197 | struct OTodoData; |
191 | 198 | ||
@@ -194,11 +201,10 @@ public: | |||
194 | void copy( OTodoData* src, OTodoData* dest ); | 201 | void copy( OTodoData* src, OTodoData* dest ); |
195 | ToDoEventPrivate *d; | 202 | OTodoPrivate *d; |
196 | ToDoEventData *data; | 203 | OTodoData *data; |
197 | 204 | ||
198 | static Qtopia::UidGen m_gen; | ||
199 | }; | ||
200 | inline bool ToDoEvent::operator!=(const ToDoEvent &toDoEvent )const { | ||
201 | return !(*this == toDoEvent); | ||
202 | } | ||
203 | }; | 205 | }; |
206 | inline bool OTodo::operator!=(const OTodo &toDoEvent )const { | ||
207 | return !(*this == toDoEvent); | ||
208 | } | ||
209 | |||
204 | 210 | ||