summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 749204b..c5acafd 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1309,15 +1309,28 @@ void KOAgendaView::setHolidayMasks()
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"))) {
+ showHoliday = true;
+ break;
+ }
+ }
+
+ }
+
#ifndef KORG_NOPLUGINS
bool showHoliday = KOPrefs::instance()->mExcludeHolidays &&
!KOCore::self()->holiday(date).isEmpty();
- bool showDay = showSaturday || showSunday || showHoliday;
-#else
- bool showDay = showSaturday || showSunday;
#endif
+ bool showDay = showSaturday || showSunday || showHoliday;
+
if (showDay) {
mHolidayMask.at(i) = true;
} else {
mHolidayMask.at(i) = false;