author | zecke <zecke> | 2004-10-17 18:38:39 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-17 18:38:39 (UTC) |
commit | e95fcb09fc069a83b3c10c19c081873daba49831 (patch) (side-by-side diff) | |
tree | 13d13bac82d5bcf2489075e4f2962685ff3c897d /library | |
parent | 7e28835e246e06e157d760a40754b6257f2ad6b3 (diff) | |
download | opie-e95fcb09fc069a83b3c10c19c081873daba49831.zip opie-e95fcb09fc069a83b3c10c19c081873daba49831.tar.gz opie-e95fcb09fc069a83b3c10c19c081873daba49831.tar.bz2 |
G++ 4.0 compiler fixes
-Remove anonymous structures and name them
-Include 'card.h' to cardpile to make 'Card' known to QList
so deleteItem will work
-cast 'enum' to char in event.cpp and opimevent.cpp
-rw-r--r-- | library/backend/event.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/backend/event.cpp b/library/backend/event.cpp index 90860e8..abc420b 100644 --- a/library/backend/event.cpp +++ b/library/backend/event.cpp @@ -354,97 +354,97 @@ Event::Event( const QMap<int, QString> &map ) p.hasEndDate = map[ RepeatPatternHasEndDate ].toInt(); p.endDateUTC = map[ RepeatPatternEndDate ].toUInt(); setRepeat( p ); setUid( map[ DatebookUid ].toInt() ); } /*! Destroys an event. */ Event::~Event() { } /*! \internal */ int Event::week( const QDate& date ) { // Calculates the week this date is in within that // month. Equals the "row" is is in in the month view int week = 1; QDate tmp( date.year(), date.month(), 1 ); if ( date.dayOfWeek() < tmp.dayOfWeek() ) ++week; week += ( date.day() - 1 ) / 7; return week; } /*! \internal */ int Event::occurrence( const QDate& date ) { // calculates the number of occurrances of this day of the // week till the given date (e.g 3rd Wednesday of the month) return ( date.day() - 1 ) / 7 + 1; } /*! \internal */ int Event::dayOfWeek( char day ) { int dayOfWeek = 1; char i = Event::MON; - while ( !( i & day ) && i <= Event::SUN ) { + while ( !( i & day ) && i <= static_cast<char>(Event::SUN) ) { i <<= 1; ++dayOfWeek; } return dayOfWeek; } /*! \internal */ 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() ) 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 ) ); m.insert ( RepeatPatternPosition, QString::number( repeatPattern().position ) ); m.insert ( RepeatPatternDays, QString::number( repeatPattern().days ) ); m.insert ( RepeatPatternHasEndDate, QString::number( static_cast<int>( repeatPattern().hasEndDate ) ) ); m.insert ( RepeatPatternEndDate, QString::number( repeatPattern().endDateUTC ) ); m.insert( DatebookUid, QString::number( uid()) ); |