From 0bb9d0f9e7da80f0ae3b91d4ebbb7aab4d2b9df7 Mon Sep 17 00:00:00 2001 From: zecke Date: Fri, 21 Feb 2003 16:52:49 +0000 Subject: -Remove old Todo classes they're deprecated and today I already using the new API -Guard against self assignment in OTodo -Add test apps for OPIM -Opiefied Event classes -Added TimeZone handling and pinning of TimeZones to OEvent -Adjust ORecur and the widget to better timezone behaviour --- (limited to 'libopie/pim/orecur.cpp') diff --git a/libopie/pim/orecur.cpp b/libopie/pim/orecur.cpp index daf3506..e6a4787 100644 --- a/libopie/pim/orecur.cpp +++ b/libopie/pim/orecur.cpp @@ -10,17 +10,17 @@ struct ORecur::Data : public QShared { freq = -1; days = 0; pos = 0; - create = -1; + create = QDateTime::currentDateTime(); hasEnd = FALSE; - end = 0; + end = QDate::currentDate(); } char days; // Q_UINT8 for 8 seven days;) ORecur::RepeatType type; int freq; int pos; bool hasEnd : 1; - time_t end; - time_t create; + QDate end; + QDateTime create; int rep; QString app; ExceptionList list; @@ -52,6 +52,8 @@ bool ORecur::operator==( const ORecur& )const { return false; } ORecur &ORecur::operator=( const ORecur& re) { + if ( *this == re ) return *this; + re.data->ref(); deref(); data = re.data; @@ -366,15 +368,12 @@ bool ORecur::hasEndDate()const { return data->hasEnd; } QDate ORecur::endDate()const { - return TimeConversion::fromUTC( data->end ).date(); + return data->end; } QDate ORecur::start()const{ return data->start; } -time_t ORecur::endDateUTC()const { - return data->end; -} -time_t ORecur::createTime()const { +QDateTime ORecur::createdDateTime()const { return data->create; } int ORecur::repetition()const { @@ -404,13 +403,9 @@ void ORecur::setDays( char c ) { } void ORecur::setEndDate( const QDate& dt) { checkOrModify(); - data->end = TimeConversion::toUTC( dt ); -} -void ORecur::setEndDateUTC( time_t t) { - checkOrModify(); - data->end = t; + data->end = dt; } -void ORecur::setCreateTime( time_t t) { +void ORecur::setCreatedDateTime( const QDateTime& t) { checkOrModify(); data->create = t; } -- cgit v0.9.0.2