summaryrefslogtreecommitdiff
authorzecke <zecke>2003-05-12 13:12:45 (UTC)
committer zecke <zecke>2003-05-12 13:12:45 (UTC)
commit52b74f396416cc1b87d76a0541617512da22157a (patch) (unidiff)
treedbec31fb8b79cdb6fbe50f588aac280a8fdc2bfa
parent64f9f964ef690806378d639118f79539a8934d40 (diff)
downloadopie-52b74f396416cc1b87d76a0541617512da22157a.zip
opie-52b74f396416cc1b87d76a0541617512da22157a.tar.gz
opie-52b74f396416cc1b87d76a0541617512da22157a.tar.bz2
fix up OTodo::hasNotifiers
add a const notifiers() function and fix OPimNotifyManager::isEmpty
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimnotifymanager.cpp4
-rw-r--r--libopie/pim/otodo.cpp8
-rw-r--r--libopie/pim/otodo.h8
-rw-r--r--libopie2/opiepim/core/opimnotifymanager.cpp4
-rw-r--r--libopie2/opiepim/otodo.cpp8
-rw-r--r--libopie2/opiepim/otodo.h8
6 files changed, 34 insertions, 6 deletions
diff --git a/libopie/pim/opimnotifymanager.cpp b/libopie/pim/opimnotifymanager.cpp
index 49af757..06b5987 100644
--- a/libopie/pim/opimnotifymanager.cpp
+++ b/libopie/pim/opimnotifymanager.cpp
@@ -68,5 +68,7 @@ void OPimNotifyManager::deregister( const OPimNotify& ) {
68 68
69} 69}
70bool OPimNotifyManager::isEmpty()const { 70bool OPimNotifyManager::isEmpty()const {
71 return ( m_rem.isEmpty() && m_al.isEmpty() ); 71 qWarning("is Empty called on OPimNotifyManager %d %d", m_rem.count(), m_al.count() );
72 if ( m_rem.isEmpty() && m_al.isEmpty() ) return true;
73 else return false;
72} 74}
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp
index f3df119..a29d88e 100644
--- a/libopie/pim/otodo.cpp
+++ b/libopie/pim/otodo.cpp
@@ -298,13 +298,19 @@ QString OTodo::toRichText() const
298} 298}
299bool OTodo::hasNotifiers()const { 299bool OTodo::hasNotifiers()const {
300 if (!data->notifiers) return false; 300 if (!data->notifiers) return false;
301 return data->notifiers->isEmpty(); 301 return !data->notifiers->isEmpty();
302} 302}
303OPimNotifyManager& OTodo::notifiers() { 303OPimNotifyManager& OTodo::notifiers() {
304 if (!data->notifiers ) 304 if (!data->notifiers )
305 data->notifiers = new OPimNotifyManager; 305 data->notifiers = new OPimNotifyManager;
306 return (*data->notifiers); 306 return (*data->notifiers);
307} 307}
308const OPimNotifyManager& OTodo::notifiers()const{
309 if (!data->notifiers )
310 data->notifiers = new OPimNotifyManager;
311
312 return (*data->notifiers);
313}
308 314
309bool OTodo::operator<( const OTodo &toDoEvent )const{ 315bool OTodo::operator<( const OTodo &toDoEvent )const{
310 if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; 316 if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true;
diff --git a/libopie/pim/otodo.h b/libopie/pim/otodo.h
index 0e7c73f..4d5ee36 100644
--- a/libopie/pim/otodo.h
+++ b/libopie/pim/otodo.h
@@ -175,7 +175,8 @@ public:
175 175
176 bool hasNotifiers()const; 176 bool hasNotifiers()const;
177 /* 177 /*
178 * check if the sharing is still fine!! -zecke 178 * FIXME check if the sharing is still fine!! -zecke
179 * ### CHECK If API is fine
179 */ 180 */
180 /** 181 /**
181 * return a reference to our notifiers... 182 * return a reference to our notifiers...
@@ -183,6 +184,11 @@ public:
183 OPimNotifyManager &notifiers(); 184 OPimNotifyManager &notifiers();
184 185
185 /** 186 /**
187 *
188 */
189 const OPimNotifyManager &notifiers()const;
190
191 /**
186 * reimplementations 192 * reimplementations
187 */ 193 */
188 QString type()const; 194 QString type()const;
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp
index 49af757..06b5987 100644
--- a/libopie2/opiepim/core/opimnotifymanager.cpp
+++ b/libopie2/opiepim/core/opimnotifymanager.cpp
@@ -68,5 +68,7 @@ void OPimNotifyManager::deregister( const OPimNotify& ) {
68 68
69} 69}
70bool OPimNotifyManager::isEmpty()const { 70bool OPimNotifyManager::isEmpty()const {
71 return ( m_rem.isEmpty() && m_al.isEmpty() ); 71 qWarning("is Empty called on OPimNotifyManager %d %d", m_rem.count(), m_al.count() );
72 if ( m_rem.isEmpty() && m_al.isEmpty() ) return true;
73 else return false;
72} 74}
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp
index f3df119..a29d88e 100644
--- a/libopie2/opiepim/otodo.cpp
+++ b/libopie2/opiepim/otodo.cpp
@@ -298,13 +298,19 @@ QString OTodo::toRichText() const
298} 298}
299bool OTodo::hasNotifiers()const { 299bool OTodo::hasNotifiers()const {
300 if (!data->notifiers) return false; 300 if (!data->notifiers) return false;
301 return data->notifiers->isEmpty(); 301 return !data->notifiers->isEmpty();
302} 302}
303OPimNotifyManager& OTodo::notifiers() { 303OPimNotifyManager& OTodo::notifiers() {
304 if (!data->notifiers ) 304 if (!data->notifiers )
305 data->notifiers = new OPimNotifyManager; 305 data->notifiers = new OPimNotifyManager;
306 return (*data->notifiers); 306 return (*data->notifiers);
307} 307}
308const OPimNotifyManager& OTodo::notifiers()const{
309 if (!data->notifiers )
310 data->notifiers = new OPimNotifyManager;
311
312 return (*data->notifiers);
313}
308 314
309bool OTodo::operator<( const OTodo &toDoEvent )const{ 315bool OTodo::operator<( const OTodo &toDoEvent )const{
310 if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true; 316 if( !hasDueDate() && !toDoEvent.hasDueDate() ) return true;
diff --git a/libopie2/opiepim/otodo.h b/libopie2/opiepim/otodo.h
index 0e7c73f..4d5ee36 100644
--- a/libopie2/opiepim/otodo.h
+++ b/libopie2/opiepim/otodo.h
@@ -175,7 +175,8 @@ public:
175 175
176 bool hasNotifiers()const; 176 bool hasNotifiers()const;
177 /* 177 /*
178 * check if the sharing is still fine!! -zecke 178 * FIXME check if the sharing is still fine!! -zecke
179 * ### CHECK If API is fine
179 */ 180 */
180 /** 181 /**
181 * return a reference to our notifiers... 182 * return a reference to our notifiers...
@@ -183,6 +184,11 @@ public:
183 OPimNotifyManager &notifiers(); 184 OPimNotifyManager &notifiers();
184 185
185 /** 186 /**
187 *
188 */
189 const OPimNotifyManager &notifiers()const;
190
191 /**
186 * reimplementations 192 * reimplementations
187 */ 193 */
188 QString type()const; 194 QString type()const;