From 52b74f396416cc1b87d76a0541617512da22157a Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 12 May 2003 13:12:45 +0000 Subject: fix up OTodo::hasNotifiers add a const notifiers() function and fix OPimNotifyManager::isEmpty --- (limited to 'libopie2') 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& ) { } bool OPimNotifyManager::isEmpty()const { - return ( m_rem.isEmpty() && m_al.isEmpty() ); + qWarning("is Empty called on OPimNotifyManager %d %d", m_rem.count(), m_al.count() ); + if ( m_rem.isEmpty() && m_al.isEmpty() ) return true; + else return false; } 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 } bool OTodo::hasNotifiers()const { if (!data->notifiers) return false; - return data->notifiers->isEmpty(); + return !data->notifiers->isEmpty(); } OPimNotifyManager& OTodo::notifiers() { if (!data->notifiers ) data->notifiers = new OPimNotifyManager; return (*data->notifiers); } +const OPimNotifyManager& OTodo::notifiers()const{ + if (!data->notifiers ) + data->notifiers = new OPimNotifyManager; + + return (*data->notifiers); +} bool OTodo::operator<( const OTodo &toDoEvent )const{ 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: bool hasNotifiers()const; /* - * check if the sharing is still fine!! -zecke + * FIXME check if the sharing is still fine!! -zecke + * ### CHECK If API is fine */ /** * return a reference to our notifiers... @@ -183,6 +184,11 @@ public: OPimNotifyManager ¬ifiers(); /** + * + */ + const OPimNotifyManager ¬ifiers()const; + + /** * reimplementations */ QString type()const; -- cgit v0.9.0.2