summaryrefslogtreecommitdiff
path: root/libopie
authorzecke <zecke>2002-09-22 23:32:49 (UTC)
committer zecke <zecke>2002-09-22 23:32:49 (UTC)
commitd7098ef25f7f4ebe5678061aa3a3c0bd1f077f7f (patch) (unidiff)
tree5ff52b48fd514c6f24da6d3204bc98b66c48a652 /libopie
parent4f142e98ee63e88fa0df61161b93228ee719d551 (diff)
downloadopie-d7098ef25f7f4ebe5678061aa3a3c0bd1f077f7f.zip
opie-d7098ef25f7f4ebe5678061aa3a3c0bd1f077f7f.tar.gz
opie-d7098ef25f7f4ebe5678061aa3a3c0bd1f077f7f.tar.bz2
Two brown paper bags later OTodo is ok again... pointers can be so fscking awesome
I had problems with QShared because I forgot to copy it in &operator= And the other one was d = 0
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/orecordlist.h12
-rw-r--r--libopie/pim/otodo.cpp25
-rw-r--r--libopie/pim/otodoaccessxml.cpp2
3 files changed, 21 insertions, 18 deletions
diff --git a/libopie/pim/orecordlist.h b/libopie/pim/orecordlist.h
index 75bb33c..36728b8 100644
--- a/libopie/pim/orecordlist.h
+++ b/libopie/pim/orecordlist.h
@@ -42,3 +42,3 @@ public:
42 */ 42 */
43 T &operator*(); 43 T operator*();
44 ORecordListIterator &operator++(); 44 ORecordListIterator &operator++();
@@ -101,2 +101,3 @@ ORecordListIterator<T>::ORecordListIterator() {
101 m_end = true; 101 m_end = true;
102 m_record = T();
102} 103}
@@ -109,3 +110,3 @@ template <class T>
109ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) { 110ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) {
110 qWarning("ORecordListIterator"); 111// qWarning("ORecordListIterator copy c'tor");
111 m_uids = it.m_uids; 112 m_uids = it.m_uids;
@@ -123,3 +124,3 @@ ORecordListIterator<T> &ORecordListIterator<T>::operator=( const ORecordListIter
123 m_end = it.m_end; 124 m_end = it.m_end;
124 m_record = it.m_record; 125// m_record = it.m_record;
125 126
@@ -129,4 +130,4 @@ ORecordListIterator<T> &ORecordListIterator<T>::operator=( const ORecordListIter
129template <class T> 130template <class T>
130T &ORecordListIterator<T>::operator*() { 131T ORecordListIterator<T>::operator*() {
131 qWarning("operator* %d %d", m_current, m_uids[m_current] ); 132// qWarning("operator* %d %d", m_current, m_uids[m_current] );
132 if (!m_end ) 133 if (!m_end )
@@ -195,3 +196,2 @@ template <class T>
195ORecordList<T>::Iterator ORecordList<T>::begin() { 196ORecordList<T>::Iterator ORecordList<T>::begin() {
196 qWarning("ORecordList::begin");
197 Iterator it( m_ids, m_acc ); 197 Iterator it( m_ids, m_acc );
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp
index b3c14e6..cc46b21 100644
--- a/libopie/pim/otodo.cpp
+++ b/libopie/pim/otodo.cpp
@@ -38,8 +38,9 @@ OTodo::OTodo(const OTodo &event )
38 data->ref(); 38 data->ref();
39 qWarning("ref up"); 39// qWarning("ref up");
40} 40}
41OTodo::~OTodo() { 41OTodo::~OTodo() {
42 qWarning("~OTodo " + data->sum ); 42
43// qWarning("~OTodo " );
43 if ( data->deref() ) { 44 if ( data->deref() ) {
44 qWarning("OTodo::dereffing"); 45// qWarning("OTodo::dereffing");
45 delete data; 46 delete data;
@@ -56,3 +57,3 @@ OTodo::OTodo(bool completed, int priority,
56{ 57{
57 qWarning("OTodoData " + summary); 58// qWarning("OTodoData " + summary);
58 setCategories( category ); 59 setCategories( category );
@@ -79,3 +80,3 @@ OTodo::OTodo(bool completed, int priority,
79{ 80{
80 qWarning("OTodoData" + summary); 81// qWarning("OTodoData" + summary);
81 setCategories( idsFromString( category.join(";") ) ); 82 setCategories( idsFromString( category.join(";") ) );
@@ -83,4 +84,4 @@ OTodo::OTodo(bool completed, int priority,
83 data = new OTodoData; 84 data = new OTodoData;
84 data->date = date;
85 85
86 data->date = date;
86 data->isCompleted = completed; 87 data->isCompleted = completed;
@@ -162,2 +163,3 @@ void OTodo::setDescription(const QString &desc )
162{ 163{
164 qWarning( "desc " + desc );
163 changeOrModify(); 165 changeOrModify();
@@ -309,7 +311,7 @@ void OTodo::deref() {
309 311
310 //qWarning("deref in ToDoEvent"); 312// qWarning("deref in ToDoEvent");
311 if ( data->deref() ) { 313 if ( data->deref() ) {
312 //qWarning("deleting"); 314// qWarning("deleting");
313 delete data; 315 delete data;
314 d= 0; 316 data= 0;
315 } 317 }
@@ -318,3 +320,3 @@ OTodo &OTodo::operator=(const OTodo &item )
318{ 320{
319 OPimRecord::operator=( item ); 321// OPimRecord::operator=( item );
320 //qWarning("operator= ref "); 322 //qWarning("operator= ref ");
@@ -322,2 +324,3 @@ OTodo &OTodo::operator=(const OTodo &item )
322 deref(); 324 deref();
325 data = item.data;
323 326
@@ -357,3 +360,3 @@ void OTodo::changeOrModify() {
357 if ( data->count != 1 ) { 360 if ( data->count != 1 ) {
358 qWarning("changeOrModify"); 361// qWarning("changeOrModify");
359 data->deref(); 362 data->deref();
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp
index 21756c9..3a72881 100644
--- a/libopie/pim/otodoaccessxml.cpp
+++ b/libopie/pim/otodoaccessxml.cpp
@@ -70,3 +70,2 @@ bool OTodoAccessXML::load() {
70 } 70 }
71 return true;
72 }else { 71 }else {
@@ -78,2 +77,3 @@ bool OTodoAccessXML::load() {
78 m_opened = true; 77 m_opened = true;
78 qWarning("Access %d" + m_events.count() );
79 return true; 79 return true;