-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | 1 | ||||
-rw-r--r-- | libopie2/opiepim/oevent.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.cpp | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp index 11e19d9..a0ae7b7 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | |||
@@ -239,24 +239,25 @@ QArray<int> ODateBookAccessBackend_XML::allRecords()const { | |||
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 | } |
247 | QArray<int> ODateBookAccessBackend_XML::queryByExample(const OEvent&, int, const QDateTime& ) { | 247 | QArray<int> ODateBookAccessBackend_XML::queryByExample(const OEvent&, int, const QDateTime& ) { |
248 | return QArray<int>(); | 248 | return QArray<int>(); |
249 | } | 249 | } |
250 | void ODateBookAccessBackend_XML::clear() { | 250 | void 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 | } |
254 | OEvent ODateBookAccessBackend_XML::find( int uid ) const{ | 255 | OEvent 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 | } |
260 | bool ODateBookAccessBackend_XML::add( const OEvent& ev ) { | 261 | bool ODateBookAccessBackend_XML::add( const OEvent& ev ) { |
261 | m_changed = true; | 262 | m_changed = true; |
262 | if (ev.hasRecurrence() ) | 263 | if (ev.hasRecurrence() ) |
diff --git a/libopie2/opiepim/oevent.cpp b/libopie2/opiepim/oevent.cpp index c3eeee2..56ea10d 100644 --- a/libopie2/opiepim/oevent.cpp +++ b/libopie2/opiepim/oevent.cpp | |||
@@ -73,25 +73,25 @@ OEvent::OEvent( int uid ) | |||
73 | OEvent::OEvent( const OEvent& ev) | 73 | OEvent::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 | } |
78 | OEvent::~OEvent() { | 78 | OEvent::~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 | } |
84 | OEvent& OEvent::operator=( const OEvent& ev) { | 84 | OEvent& 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 | } |
95 | QString OEvent::description()const { | 95 | QString OEvent::description()const { |
96 | return data->description; | 96 | return data->description; |
97 | } | 97 | } |
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index 049359e..ea66d39 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp | |||
@@ -331,25 +331,25 @@ bool OTodo::operator==(const OTodo &toDoEvent )const | |||
331 | } | 331 | } |
332 | void OTodo::deref() { | 332 | void 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 | } |
341 | OTodo &OTodo::operator=(const OTodo &item ) | 341 | OTodo &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 | ||
354 | QMap<int, QString> OTodo::toMap() const { | 354 | QMap<int, QString> OTodo::toMap() const { |
355 | QMap<int, QString> map; | 355 | QMap<int, QString> map; |