author | zecke <zecke> | 2003-04-13 16:55:34 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-04-13 16:55:34 (UTC) |
commit | 1537ccb435ca725c793db6e94e0b9e83484b57e7 (patch) (side-by-side diff) | |
tree | f1aa77e10de202c058259ece02216957d8d520e3 | |
parent | 3bd592876c43c11ed44b2f3725d4c7425ebceb09 (diff) | |
download | opie-1537ccb435ca725c793db6e94e0b9e83484b57e7.zip opie-1537ccb435ca725c793db6e94e0b9e83484b57e7.tar.gz opie-1537ccb435ca725c793db6e94e0b9e83484b57e7.tar.bz2 |
OEvent/OTodo compare by address and not by value..
ODatebookAccess: clear does change it too
-rw-r--r-- | libopie/pim/odatebookaccessbackend_xml.cpp | 1 | ||||
-rw-r--r-- | libopie/pim/oevent.cpp | 2 | ||||
-rw-r--r-- | libopie/pim/otodo.cpp | 2 | ||||
-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 |
6 files changed, 6 insertions, 4 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 @@ -239,24 +239,25 @@ QArray<int> ODateBookAccessBackend_XML::allRecords()const { } for ( it = m_rep.begin(); it != m_rep.end(); ++it ) { ints[i] = it.key(); i++; } return ints; } QArray<int> ODateBookAccessBackend_XML::queryByExample(const OEvent&, int, const QDateTime& ) { return QArray<int>(); } void ODateBookAccessBackend_XML::clear() { + m_changed = true; m_raw.clear(); m_rep.clear(); } OEvent ODateBookAccessBackend_XML::find( int uid ) const{ if ( m_raw.contains( uid ) ) return m_raw[uid]; else return m_rep[uid]; } bool ODateBookAccessBackend_XML::add( const OEvent& ev ) { m_changed = true; if (ev.hasRecurrence() ) 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 @@ -73,25 +73,25 @@ OEvent::OEvent( int uid ) OEvent::OEvent( const OEvent& ev) : OPimRecord( ev ), data( ev.data ) { data->ref(); } OEvent::~OEvent() { if ( data->deref() ) { delete data; data = 0; } } OEvent& OEvent::operator=( const OEvent& ev) { - if ( *this == ev ) return *this; + if ( this == &ev ) return *this; OPimRecord::operator=( ev ); ev.data->ref(); deref(); data = ev.data; return *this; } QString OEvent::description()const { return data->description; } 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 @@ -331,25 +331,25 @@ bool OTodo::operator==(const OTodo &toDoEvent )const } void OTodo::deref() { // qWarning("deref in ToDoEvent"); if ( data->deref() ) { // qWarning("deleting"); delete data; data= 0; } } OTodo &OTodo::operator=(const OTodo &item ) { - if ( *this == item ) return *this; + if ( this == &item ) return *this; OPimRecord::operator=( item ); //qWarning("operator= ref "); item.data->ref(); deref(); data = item.data; return *this; } QMap<int, QString> OTodo::toMap() const { QMap<int, QString> map; 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 { } for ( it = m_rep.begin(); it != m_rep.end(); ++it ) { ints[i] = it.key(); i++; } return ints; } QArray<int> ODateBookAccessBackend_XML::queryByExample(const OEvent&, int, const QDateTime& ) { return QArray<int>(); } void ODateBookAccessBackend_XML::clear() { + m_changed = true; m_raw.clear(); m_rep.clear(); } OEvent ODateBookAccessBackend_XML::find( int uid ) const{ if ( m_raw.contains( uid ) ) return m_raw[uid]; else return m_rep[uid]; } bool ODateBookAccessBackend_XML::add( const OEvent& ev ) { m_changed = true; 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 ) OEvent::OEvent( const OEvent& ev) : OPimRecord( ev ), data( ev.data ) { data->ref(); } OEvent::~OEvent() { if ( data->deref() ) { delete data; data = 0; } } OEvent& OEvent::operator=( const OEvent& ev) { - if ( *this == ev ) return *this; + if ( this == &ev ) return *this; OPimRecord::operator=( ev ); ev.data->ref(); deref(); data = ev.data; return *this; } QString OEvent::description()const { return data->description; } 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 } void OTodo::deref() { // qWarning("deref in ToDoEvent"); if ( data->deref() ) { // qWarning("deleting"); delete data; data= 0; } } OTodo &OTodo::operator=(const OTodo &item ) { - if ( *this == item ) return *this; + if ( this == &item ) return *this; OPimRecord::operator=( item ); //qWarning("operator= ref "); item.data->ref(); deref(); data = item.data; return *this; } QMap<int, QString> OTodo::toMap() const { QMap<int, QString> map; |