author | zecke <zecke> | 2003-05-07 17:49:07 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-05-07 17:49:07 (UTC) |
commit | c13ada0f5e418b25b177e132ff2e1dfe7821577f (patch) (side-by-side diff) | |
tree | 40e8d6cc67a1de638ef3c278fd827ba0cbea5b76 /libopie2/opiepim/core | |
parent | ac895871f93dce9734189daf9cb95dbbda605096 (diff) | |
download | opie-c13ada0f5e418b25b177e132ff2e1dfe7821577f.zip opie-c13ada0f5e418b25b177e132ff2e1dfe7821577f.tar.gz opie-c13ada0f5e418b25b177e132ff2e1dfe7821577f.tar.bz2 |
implement loading of Recurrence
-rw-r--r-- | libopie2/opiepim/core/opimnotifymanager.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimnotifymanager.h | 3 | ||||
-rw-r--r-- | libopie2/opiepim/core/orecur.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/libopie2/opiepim/core/opimnotifymanager.cpp b/libopie2/opiepim/core/opimnotifymanager.cpp index be4a1c2..49af757 100644 --- a/libopie2/opiepim/core/opimnotifymanager.cpp +++ b/libopie2/opiepim/core/opimnotifymanager.cpp @@ -22,48 +22,51 @@ void OPimNotifyManager::remove( const OPimNotify& noti) { }else if ( noti.type() == QString::fromLatin1("OPimAlarm") ) { const OPimAlarm& al = static_cast<const OPimAlarm&>(noti); m_al.remove( al ); } } void OPimNotifyManager::replace( const OPimNotify& noti) { if ( noti.type() == QString::fromLatin1("OPimReminder") ) { const OPimReminder& rem = static_cast<const OPimReminder&>(noti); m_rem.remove( rem ); m_rem.append( rem ); }else if ( noti.type() == QString::fromLatin1("OPimAlarm") ) { const OPimAlarm& al = static_cast<const OPimAlarm&>(noti); m_al.remove( al ); m_al.append( al ); } } OPimNotifyManager::Reminders OPimNotifyManager::reminders()const { return m_rem; } OPimNotifyManager::Alarms OPimNotifyManager::alarms()const { return m_al; } void OPimNotifyManager::setAlarms( const Alarms& al) { m_al = al; } void OPimNotifyManager::setReminders( const Reminders& rem) { m_rem = rem; } /* FIXME!!! */ /** * The idea is to check if the provider for our service * is online * if it is we will use QCOP * if not the Factory to get the backend... * Qtopia1.6 services would be kewl to have here.... */ void OPimNotifyManager::registerNotify( const OPimNotify& ) { } /* FIXME!!! */ /** * same as above... * Also implement Url model * have a MainWindow.... */ void OPimNotifyManager::deregister( const OPimNotify& ) { } +bool OPimNotifyManager::isEmpty()const { + return ( m_rem.isEmpty() && m_al.isEmpty() ); +} diff --git a/libopie2/opiepim/core/opimnotifymanager.h b/libopie2/opiepim/core/opimnotifymanager.h index 0eebc9b..0ac30a1 100644 --- a/libopie2/opiepim/core/opimnotifymanager.h +++ b/libopie2/opiepim/core/opimnotifymanager.h @@ -1,51 +1,54 @@ #ifndef OPIE_PIM_NOTIFY_MANAGER_H #define OPIE_PIM_NOTIFY_MANAGER_H #include <qvaluelist.h> #include <opie/opimnotify.h> /** * The notify manager keeps track of the Notifiers.... */ class OPimNotifyManager { public: typedef QValueList<OPimReminder> Reminders; typedef QValueList<OPimAlarm> Alarms; OPimNotifyManager( const Reminders& rems = Reminders(), const Alarms& alarms = Alarms() ); ~OPimNotifyManager(); /* we will cast it for you ;) */ void add( const OPimNotify& ); void remove( const OPimNotify& ); /* replaces all with this one! */ void replace( const OPimNotify& ); Reminders reminders()const; Alarms alarms()const; void setAlarms( const Alarms& ); void setReminders( const Reminders& ); /* register is a Ansi C keyword... */ /** * This function will register the Notify to the Alarm Server * or datebook depending on the type of the notify */ void registerNotify( const OPimNotify& ); /** * this will do the opposite.. */ void deregister( const OPimNotify& ); + + bool isEmpty()const; + private: Reminders m_rem; Alarms m_al; class Private; Private *d; }; #endif diff --git a/libopie2/opiepim/core/orecur.cpp b/libopie2/opiepim/core/orecur.cpp index e3b45b4..eae1fdc 100644 --- a/libopie2/opiepim/core/orecur.cpp +++ b/libopie2/opiepim/core/orecur.cpp @@ -459,52 +459,52 @@ QString ORecur::toString()const { buf += " rtype=\""; switch ( data->type ) { case ORecur::Daily: buf += "Daily"; break; case ORecur::Weekly: buf += "Weekly"; break; case ORecur::MonthlyDay: buf += "MonthlyDay"; break; case ORecur::MonthlyDate: buf += "MonthlyDate"; break; case ORecur::Yearly: buf += "Yearly"; break; default: buf += "NoRepeat"; break; } buf += "\""; if (data->days > 0 ) buf += " rweekdays=\"" + QString::number( static_cast<int>( data->days ) ) + "\""; if ( data->pos != 0 ) buf += " rposition=\"" + QString::number(data->pos ) + "\""; buf += " rfreq=\"" + QString::number( data->freq ) + "\""; buf += " rhasenddate=\"" + QString::number( static_cast<int>( data->hasEnd ) ) + "\""; if ( data->hasEnd ) buf += " enddt=\"" + QString::number( OTimeZone::utc().fromUTCDateTime( QDateTime( data->end, QTime(12,0,0) ) ) ) + "\""; buf += " created=\"" + QString::number( OTimeZone::utc().fromUTCDateTime( data->create ) ) + "\""; if ( data->list.isEmpty() ) return buf; // save exceptions list here!! ExceptionList::ConstIterator it; ExceptionList list = data->list; buf += " exceptions=\""; QDate date; for ( it = list.begin(); it != list.end(); ++it ) { date = (*it); if ( it != list.begin() ) buf += " "; buf += QCString().sprintf("%04d%02d%02d", date.year(), date.month(), date.day() ); } - buf += "\""; + buf += "\" "; return buf; } |