summaryrefslogtreecommitdiff
path: root/libopie
Unidiff
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/odatebookaccessbackend_xml.cpp1
-rw-r--r--libopie/pim/oevent.cpp2
-rw-r--r--libopie/pim/otodo.cpp2
3 files changed, 3 insertions, 2 deletions
diff --git a/libopie/pim/odatebookaccessbackend_xml.cpp b/libopie/pim/odatebookaccessbackend_xml.cpp
index 11e19d9..a0ae7b7 100644
--- a/libopie/pim/odatebookaccessbackend_xml.cpp
+++ b/libopie/pim/odatebookaccessbackend_xml.cpp
@@ -227,48 +227,49 @@ bool ODateBookAccessBackend_XML::save() {
227 227
228 m_changed = false; 228 m_changed = false;
229 return true; 229 return true;
230} 230}
231QArray<int> ODateBookAccessBackend_XML::allRecords()const { 231QArray<int> ODateBookAccessBackend_XML::allRecords()const {
232 QArray<int> ints( m_raw.count()+ m_rep.count() ); 232 QArray<int> ints( m_raw.count()+ m_rep.count() );
233 uint i = 0; 233 uint i = 0;
234 QMap<int, OEvent>::ConstIterator it; 234 QMap<int, OEvent>::ConstIterator it;
235 235
236 for ( it = m_raw.begin(); it != m_raw.end(); ++it ) { 236 for ( it = m_raw.begin(); it != m_raw.end(); ++it ) {
237 ints[i] = it.key(); 237 ints[i] = it.key();
238 i++; 238 i++;
239 } 239 }
240 for ( it = m_rep.begin(); it != m_rep.end(); ++it ) { 240 for ( it = m_rep.begin(); it != m_rep.end(); ++it ) {
241 ints[i] = it.key(); 241 ints[i] = it.key();
242 i++; 242 i++;
243 } 243 }
244 244
245 return ints; 245 return ints;
246} 246}
247QArray<int> ODateBookAccessBackend_XML::queryByExample(const OEvent&, int, const QDateTime& ) { 247QArray<int> ODateBookAccessBackend_XML::queryByExample(const OEvent&, int, const QDateTime& ) {
248 return QArray<int>(); 248 return QArray<int>();
249} 249}
250void ODateBookAccessBackend_XML::clear() { 250void ODateBookAccessBackend_XML::clear() {
251 m_changed = true;
251 m_raw.clear(); 252 m_raw.clear();
252 m_rep.clear(); 253 m_rep.clear();
253} 254}
254OEvent ODateBookAccessBackend_XML::find( int uid ) const{ 255OEvent ODateBookAccessBackend_XML::find( int uid ) const{
255 if ( m_raw.contains( uid ) ) 256 if ( m_raw.contains( uid ) )
256 return m_raw[uid]; 257 return m_raw[uid];
257 else 258 else
258 return m_rep[uid]; 259 return m_rep[uid];
259} 260}
260bool ODateBookAccessBackend_XML::add( const OEvent& ev ) { 261bool ODateBookAccessBackend_XML::add( const OEvent& ev ) {
261 m_changed = true; 262 m_changed = true;
262 if (ev.hasRecurrence() ) 263 if (ev.hasRecurrence() )
263 m_rep.insert( ev.uid(), ev ); 264 m_rep.insert( ev.uid(), ev );
264 else 265 else
265 m_raw.insert( ev.uid(), ev ); 266 m_raw.insert( ev.uid(), ev );
266 267
267 return true; 268 return true;
268} 269}
269bool ODateBookAccessBackend_XML::remove( int uid ) { 270bool ODateBookAccessBackend_XML::remove( int uid ) {
270 m_changed = true; 271 m_changed = true;
271 m_rep.remove( uid ); 272 m_rep.remove( uid );
272 m_rep.remove( uid ); 273 m_rep.remove( uid );
273 274
274 return true; 275 return true;
diff --git a/libopie/pim/oevent.cpp b/libopie/pim/oevent.cpp
index c3eeee2..56ea10d 100644
--- a/libopie/pim/oevent.cpp
+++ b/libopie/pim/oevent.cpp
@@ -61,49 +61,49 @@ struct OEvent::Data : public QShared {
61 QDateTime start; 61 QDateTime start;
62 QDateTime end; 62 QDateTime end;
63 bool isAllDay : 1; 63 bool isAllDay : 1;
64 QString timezone; 64 QString timezone;
65 QArray<int>* child; 65 QArray<int>* child;
66 int parent; 66 int parent;
67}; 67};
68 68
69OEvent::OEvent( int uid ) 69OEvent::OEvent( int uid )
70 : OPimRecord( uid ) { 70 : OPimRecord( uid ) {
71 data = new Data; 71 data = new Data;
72} 72}
73OEvent::OEvent( const OEvent& ev) 73OEvent::OEvent( const OEvent& ev)
74 : OPimRecord( ev ), data( ev.data ) 74 : OPimRecord( ev ), data( ev.data )
75{ 75{
76 data->ref(); 76 data->ref();
77} 77}
78OEvent::~OEvent() { 78OEvent::~OEvent() {
79 if ( data->deref() ) { 79 if ( data->deref() ) {
80 delete data; 80 delete data;
81 data = 0; 81 data = 0;
82 } 82 }
83} 83}
84OEvent& OEvent::operator=( const OEvent& ev) { 84OEvent& OEvent::operator=( const OEvent& ev) {
85 if ( *this == ev ) return *this; 85 if ( this == &ev ) return *this;
86 86
87 OPimRecord::operator=( ev ); 87 OPimRecord::operator=( ev );
88 ev.data->ref(); 88 ev.data->ref();
89 deref(); 89 deref();
90 data = ev.data; 90 data = ev.data;
91 91
92 92
93 return *this; 93 return *this;
94} 94}
95QString OEvent::description()const { 95QString OEvent::description()const {
96 return data->description; 96 return data->description;
97} 97}
98void OEvent::setDescription( const QString& description ) { 98void OEvent::setDescription( const QString& description ) {
99 changeOrModify(); 99 changeOrModify();
100 data->description = description; 100 data->description = description;
101} 101}
102void OEvent::setLocation( const QString& loc ) { 102void OEvent::setLocation( const QString& loc ) {
103 changeOrModify(); 103 changeOrModify();
104 data->location = loc; 104 data->location = loc;
105} 105}
106QString OEvent::location()const { 106QString OEvent::location()const {
107 return data->location; 107 return data->location;
108} 108}
109OPimNotifyManager &OEvent::notifiers()const { 109OPimNotifyManager &OEvent::notifiers()const {
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp
index 049359e..ea66d39 100644
--- a/libopie/pim/otodo.cpp
+++ b/libopie/pim/otodo.cpp
@@ -319,49 +319,49 @@ bool OTodo::operator==(const OTodo &toDoEvent )const
319{ 319{
320 if ( data->priority != toDoEvent.data->priority ) return false; 320 if ( data->priority != toDoEvent.data->priority ) return false;
321 if ( data->priority != toDoEvent.data->prog ) return false; 321 if ( data->priority != toDoEvent.data->prog ) return false;
322 if ( data->isCompleted != toDoEvent.data->isCompleted ) return false; 322 if ( data->isCompleted != toDoEvent.data->isCompleted ) return false;
323 if ( data->hasDate != toDoEvent.data->hasDate ) return false; 323 if ( data->hasDate != toDoEvent.data->hasDate ) return false;
324 if ( data->date != toDoEvent.data->date ) return false; 324 if ( data->date != toDoEvent.data->date ) return false;
325 if ( data->sum != toDoEvent.data->sum ) return false; 325 if ( data->sum != toDoEvent.data->sum ) return false;
326 if ( data->desc != toDoEvent.data->desc ) return false; 326 if ( data->desc != toDoEvent.data->desc ) return false;
327 if ( data->maintainer != toDoEvent.data->maintainer ) 327 if ( data->maintainer != toDoEvent.data->maintainer )
328 return false; 328 return false;
329 329
330 return OPimRecord::operator==( toDoEvent ); 330 return OPimRecord::operator==( toDoEvent );
331} 331}
332void OTodo::deref() { 332void OTodo::deref() {
333 333
334// qWarning("deref in ToDoEvent"); 334// qWarning("deref in ToDoEvent");
335 if ( data->deref() ) { 335 if ( data->deref() ) {
336// qWarning("deleting"); 336// qWarning("deleting");
337 delete data; 337 delete data;
338 data= 0; 338 data= 0;
339 } 339 }
340} 340}
341OTodo &OTodo::operator=(const OTodo &item ) 341OTodo &OTodo::operator=(const OTodo &item )
342{ 342{
343 if ( *this == item ) return *this; 343 if ( this == &item ) return *this;
344 344
345 OPimRecord::operator=( item ); 345 OPimRecord::operator=( item );
346 //qWarning("operator= ref "); 346 //qWarning("operator= ref ");
347 item.data->ref(); 347 item.data->ref();
348 deref(); 348 deref();
349 data = item.data; 349 data = item.data;
350 350
351 return *this; 351 return *this;
352} 352}
353 353
354QMap<int, QString> OTodo::toMap() const { 354QMap<int, QString> OTodo::toMap() const {
355 QMap<int, QString> map; 355 QMap<int, QString> map;
356 356
357 map.insert( Uid, QString::number( uid() ) ); 357 map.insert( Uid, QString::number( uid() ) );
358 map.insert( Category, idsToString( categories() ) ); 358 map.insert( Category, idsToString( categories() ) );
359 map.insert( HasDate, QString::number( data->hasDate ) ); 359 map.insert( HasDate, QString::number( data->hasDate ) );
360 map.insert( Completed, QString::number( data->isCompleted ) ); 360 map.insert( Completed, QString::number( data->isCompleted ) );
361 map.insert( Description, data->desc ); 361 map.insert( Description, data->desc );
362 map.insert( Summary, data->sum ); 362 map.insert( Summary, data->sum );
363 map.insert( Priority, QString::number( data->priority ) ); 363 map.insert( Priority, QString::number( data->priority ) );
364 map.insert( DateDay, QString::number( data->date.day() ) ); 364 map.insert( DateDay, QString::number( data->date.day() ) );
365 map.insert( DateMonth, QString::number( data->date.month() ) ); 365 map.insert( DateMonth, QString::number( data->date.month() ) );
366 map.insert( DateYear, QString::number( data->date.year() ) ); 366 map.insert( DateYear, QString::number( data->date.year() ) );
367 map.insert( Progress, QString::number( data->prog ) ); 367 map.insert( Progress, QString::number( data->prog ) );