author | zecke <zecke> | 2002-09-10 13:11:25 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-10 13:11:25 (UTC) |
commit | a73774e8ab1d14c76f17c854c6b6cdf801abfe82 (patch) (side-by-side diff) | |
tree | 27b0ddb41a40133bfaad34781ce69890615e4acc /library | |
parent | 8064c0e86eed8a48c2c7745195bf991b1d83f504 (diff) | |
download | opie-a73774e8ab1d14c76f17c854c6b6cdf801abfe82.zip opie-a73774e8ab1d14c76f17c854c6b6cdf801abfe82.tar.gz opie-a73774e8ab1d14c76f17c854c6b6cdf801abfe82.tar.bz2 |
Fix inline for Event::start
-rw-r--r-- | library/backend/event.cpp | 9 | ||||
-rw-r--r-- | library/backend/event.h | 8 |
2 files changed, 11 insertions, 6 deletions
diff --git a/library/backend/event.cpp b/library/backend/event.cpp index 7110717..8f3f780 100644 --- a/library/backend/event.cpp +++ b/library/backend/event.cpp @@ -411,33 +411,33 @@ int Event::dayOfWeek( char day ) */ int Event::monthDiff( const QDate& first, const QDate& second ) { return ( second.year() - first.year() ) * 12 + second.month() - first.month(); } /*! \internal */ QMap<int, QString> Event::toMap() const { QMap<int, QString> m; if ( !description().isEmpty() ) m.insert( DatebookDescription, description() ); - if ( !location().isEmpty() ) + if ( !location().isEmpty() ) m.insert ( Location, location() ); if ( categories().count() ) m.insert ( DatebookCategory, idsToString( categories() ) ); if ( !timeZone().isEmpty() ) m.insert ( TimeZone, timeZone() ); if ( !notes().isEmpty() ) m.insert ( Note, notes() ); m.insert ( StartDateTime, QString::number( TimeConversion::toUTC( start() ) ) ); m.insert ( EndDateTime, QString::number( TimeConversion::toUTC( end() ) ) ); m.insert ( DatebookType, QString::number( (int)type() ) ); m.insert ( HasAlarm, ( hasAlarm() ? "1" : "0" ) ); m.insert ( SoundType, QString::number( (int)alarmSound() ) ); m.insert ( AlarmTime, QString::number( alarmTime() ) ); m.insert ( RepeatPatternType, QString::number( static_cast<int>( repeatPattern().type ) ) ); m.insert ( RepeatPatternFrequency, QString::number( repeatPattern().frequency ) ); @@ -572,48 +572,53 @@ const QString &Event::location() const { return locat; } // QString Event::category() const // { // return categ; // } /*! \internal */ Event::Type Event::type() const { return typ; } - +QDateTime Event::start() const { + return start( TRUE ); +} /*! \internal */ QDateTime Event::start( bool actual ) const { QDateTime dt = (startUTC > 0) ? TimeConversion::fromUTC( startUTC ) : QDateTime::currentDateTime(); if ( actual && typ == AllDay ) { QTime t = dt.time(); t.setHMS( 0, 0, 0 ); dt.setTime( t ); } return dt; } +QDateTime Event::end() const { + return end( TRUE ); +} /*! \internal */ QDateTime Event::end( bool actual ) const { QDateTime dt = (endUTC > 0) ? TimeConversion::fromUTC( endUTC ) : QDateTime::currentDateTime(); if ( actual && typ == AllDay ) { QTime t = dt.time(); t.setHMS( 23, 59, 59 ); dt.setTime( t ); } return dt; } /*! diff --git a/library/backend/event.h b/library/backend/event.h index 7fe41a5..2b275a4 100644 --- a/library/backend/event.h +++ b/library/backend/event.h @@ -255,35 +255,35 @@ inline void Event::setAlarm( int minutes, SoundTypeChoice s ) } inline void Event::clearAlarm() { setAlarm(FALSE, 0, Silent); } inline int Event::alarmDelay() const { return alarmTime(); } inline void Event::setAllDay(bool enable) { if (enable) setType(AllDay); - else + else setType(Normal); -}; +}; inline bool Event::isAllDay() const { return type() == AllDay; } inline Event::RepeatType Event::repeatType() const { return repeatPattern().type; } inline int Event::frequency() const { return repeatPattern().frequency; } @@ -328,43 +328,43 @@ inline void Event::setRepeatForever(bool b) pattern.setEndDate(end().date()); pattern.hasEndDate = !b; } inline bool Event::repeatOnWeekDay(int day) const { if (pattern.type != Weekly) return FALSE; return ( (1 << (day - 1)) & pattern.days ) != 0; } inline void Event::setRepeatOnWeekDay(int day, bool enable) { if ( repeatOnWeekDay( day ) != enable ) pattern.days ^= 1 << (day - 1); } - +/* inline QDateTime Event::start( ) const { return start(FALSE); } inline QDateTime Event::end( ) const { return end(FALSE); } - +*/ #ifdef PALMTOPCENTER class QPC_EXPORT EffectiveEventSizeSorter : public QSorter<EffectiveEvent> { public: int compare( const EffectiveEvent& a, const EffectiveEvent& b ) const { return a.size() - b.size(); } }; class QPC_EXPORT EffectiveEventTimeSorter : public QSorter<EffectiveEvent> { public: int compare( const EffectiveEvent& a, const EffectiveEvent& b ) const { return a.start().secsTo( b.start() ); |