summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--library/backend/event.cpp7
-rw-r--r--library/backend/event.h4
2 files changed, 8 insertions, 3 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
@@ -576,40 +576,45 @@ const QString &Event::location() const
576// QString Event::category() const 576// QString Event::category() const
577// { 577// {
578// return categ; 578// return categ;
579// } 579// }
580 580
581/*! 581/*!
582 \internal 582 \internal
583*/ 583*/
584Event::Type Event::type() const 584Event::Type Event::type() const
585{ 585{
586 return typ; 586 return typ;
587} 587}
588 588QDateTime Event::start() const {
589 return start( TRUE );
590}
589/*! 591/*!
590 \internal 592 \internal
591*/ 593*/
592QDateTime Event::start( bool actual ) const 594QDateTime Event::start( bool actual ) const
593{ 595{
594 QDateTime dt = (startUTC > 0) ? TimeConversion::fromUTC( startUTC ) : QDateTime::currentDateTime(); 596 QDateTime dt = (startUTC > 0) ? TimeConversion::fromUTC( startUTC ) : QDateTime::currentDateTime();
595 597
596 if ( actual && typ == AllDay ) { 598 if ( actual && typ == AllDay ) {
597 QTime t = dt.time(); 599 QTime t = dt.time();
598 t.setHMS( 0, 0, 0 ); 600 t.setHMS( 0, 0, 0 );
599 dt.setTime( t ); 601 dt.setTime( t );
600 } 602 }
601 return dt; 603 return dt;
602} 604}
603 605
606QDateTime Event::end() const {
607 return end( TRUE );
608}
604/*! 609/*!
605 \internal 610 \internal
606*/ 611*/
607QDateTime Event::end( bool actual ) const 612QDateTime Event::end( bool actual ) const
608{ 613{
609 QDateTime dt = (endUTC > 0) ? TimeConversion::fromUTC( endUTC ) : QDateTime::currentDateTime(); 614 QDateTime dt = (endUTC > 0) ? TimeConversion::fromUTC( endUTC ) : QDateTime::currentDateTime();
610 615
611 if ( actual && typ == AllDay ) { 616 if ( actual && typ == AllDay ) {
612 QTime t = dt.time(); 617 QTime t = dt.time();
613 t.setHMS( 23, 59, 59 ); 618 t.setHMS( 23, 59, 59 );
614 dt.setTime( t ); 619 dt.setTime( t );
615 } 620 }
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
@@ -332,35 +332,35 @@ inline void Event::setRepeatForever(bool b)
332inline bool Event::repeatOnWeekDay(int day) const 332inline bool Event::repeatOnWeekDay(int day) const
333{ 333{
334 if (pattern.type != Weekly) 334 if (pattern.type != Weekly)
335 return FALSE; 335 return FALSE;
336 return ( (1 << (day - 1)) & pattern.days ) != 0; 336 return ( (1 << (day - 1)) & pattern.days ) != 0;
337} 337}
338 338
339inline void Event::setRepeatOnWeekDay(int day, bool enable) 339inline void Event::setRepeatOnWeekDay(int day, bool enable)
340{ 340{
341 if ( repeatOnWeekDay( day ) != enable ) 341 if ( repeatOnWeekDay( day ) != enable )
342 pattern.days ^= 1 << (day - 1); 342 pattern.days ^= 1 << (day - 1);
343} 343}
344 344/*
345inline QDateTime Event::start( ) const 345inline QDateTime Event::start( ) const
346{ 346{
347 return start(FALSE); 347 return start(FALSE);
348} 348}
349 349
350inline QDateTime Event::end( ) const 350inline QDateTime Event::end( ) const
351{ 351{
352 return end(FALSE); 352 return end(FALSE);
353} 353}
354 354*/
355#ifdef PALMTOPCENTER 355#ifdef PALMTOPCENTER
356class QPC_EXPORT EffectiveEventSizeSorter : public QSorter<EffectiveEvent> 356class QPC_EXPORT EffectiveEventSizeSorter : public QSorter<EffectiveEvent>
357{ 357{
358public: 358public:
359 int compare( const EffectiveEvent& a, const EffectiveEvent& b ) const 359 int compare( const EffectiveEvent& a, const EffectiveEvent& b ) const
360 { 360 {
361 return a.size() - b.size(); 361 return a.size() - b.size();
362 } 362 }
363}; 363};
364 364
365class QPC_EXPORT EffectiveEventTimeSorter : public QSorter<EffectiveEvent> 365class QPC_EXPORT EffectiveEventTimeSorter : public QSorter<EffectiveEvent>
366{ 366{