-rw-r--r-- | korganizer/koagendaview.cpp | 3 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 4 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 3 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 8 |
4 files changed, 8 insertions, 10 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index e029fdb..eb3a6cd 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -1409,26 +1409,25 @@ void KOAgendaView::setHolidayMasks() mHolidayMask.resize(mSelectedDates.count()); uint i; for(i=0;i<mSelectedDates.count();++i) { QDate date = mSelectedDates[i]; bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); bool showHoliday = false; if ( KOPrefs::instance()->mExcludeHolidays ) { QPtrList<Event> events = calendar()->events( date, true ); Event *event; for( event = events.first(); event; event = events.next() ) { - if ( event->categories().contains("Holiday") || - event->categories().contains(i18n("Holiday"))) { + if ( event->isHoliday()) { showHoliday = true; break; } } } #ifndef KORG_NOPLUGINS bool showHoliday = KOPrefs::instance()->mExcludeHolidays && !KOCore::self()->holiday(date).isEmpty(); #endif bool showDay = showSaturday || showSunday || showHoliday; diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index d7a4112..36cd990 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -339,32 +339,32 @@ void KODayMatrix::updateViewTimed() // if events are set for the day then remember to draw it bold QPtrList<Event> eventlist = mCalendar->events(days[i]); Event *event; int numEvents = eventlist.count(); QString holiStr = ""; bDays.clearBit(i); for(event=eventlist.first();event != 0;event=eventlist.next()) { ushort recurType = event->recurrence()->doesRecur(); if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { numEvents--; } - if ( event->categories().contains( i18n("Holiday") ) || event->categories().contains( "Holiday" )) { + if ( event->isHoliday()) { if ( !holiStr.isEmpty() ) holiStr += "\n"; holiStr += event->summary(); if ( !event->location().isEmpty() ) holiStr += " (" + event->location() + ")"; } - if ( event->categories().contains( i18n("Birthday") ) || event->categories().contains( "Birthday" )) { + if ( event->isBirthday()) { if ( !holiStr.isEmpty() ) holiStr += "\n"; holiStr += i18n("Birthday") + ": "+event->summary(); if ( !event->location().isEmpty() ) holiStr += " (" + event->location() + ")"; bDays.setBit(i); } } events[i] = numEvents; //if it is a holy day then draw it red. Sundays are consider holidays, too if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || !holiStr.isEmpty()) { diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 004ff50..76982b4 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -506,26 +506,25 @@ void MonthViewCell::startUpdateCell() void MonthViewCell::insertEvent(Event *event) { QString mToolTipText; mItemList->setFocusPolicy(WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return; else if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) return; } - if ( event->categories().contains("Holiday") || - event->categories().contains(i18n("Holiday"))) { + if ( event->isHoliday()) { setHoliday( true ); if ( mDate.dayOfWeek() == 7 ) mItemList->setLineWidth( 3 ); } QString text; int multiday = 0;// 1 = start, 2 = midddle, 3 = end day if (event->isMultiDay()) { QString prefix = "<->";multiday = 2; QString time; if ( event->doesRecur() ) { if ( event->recursOn( mDate) ) { prefix ="->" ;multiday = 1; diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 18dc656..66ff75d 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -469,25 +469,25 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a QDateTime noc; QString tempText; if ( appendTable && !notRed ) { tempText = "<table>"; } bool ok = true; if ( reply ) { noc = ev->getNextOccurence( cdt, &ok ); if (! ok && ev->type() == "Event") return false; } bool bDay = false; - if ( ev->categories().contains( i18n("Birthday") ) || ev->categories().contains( i18n("Anniversary") ) ) + if ( ev->isBirthday() || ev->isAnniversary() ) bDay = true; tempText += "<tr><td><b>"; if (ev->type()=="Event") { if (reply) { if (!ev->doesFloat()) tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; else tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; } else { if (!ev->doesFloat()) { Event *event = static_cast<Event *>(ev); @@ -527,28 +527,28 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a tempText += "<font color=\"#F00000\">" + dateText + "</font>"; } else if ( st < cdt ) tempText += "<font color=\"#008000\">" + dateText + "</font>"; else tempText += dateText; } } else { if ( bDay ) { - if ( ev->categories().contains( i18n("Birthday") )) - tempText += "<font color=\"#F00000\">" + i18n("Birthday") +":</font>"; + if ( ev->isBirthday()) + tempText += "<font color=\"#00B000\">" + i18n("Birthday") +":</font>"; else - tempText += "<font color=\"#F00000\">" + i18n("Anniversary")+":</font>"; + tempText += "<font color=\"#00B0000\">" + i18n("Anniversary")+":</font>"; } else { tempText += i18n("Allday:"); } } } } else { mTodos.append( ev ); tempText += i18n("ToDo:"); if (reply) { tempText += " "; if ( noc != cdt ) { |