summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 322131f..ecca374 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -295,100 +295,100 @@ bool KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end)
{
mRedrawNeeded = true;
bool noSel = (mSelEnd == NOSELECTION && mSelStart == NOSELECTION );
mSelStart = startdate.daysTo(start);
if ( mSelStart < 0 )
mSelStart = 0;
mSelEnd = startdate.daysTo(end);
if ( mSelEnd > NUMDAYS-1 )
mSelEnd = NUMDAYS-1;
if ( mSelEnd < 0 || mSelStart > NUMDAYS-1 ) {
clearSelection();
if ( noSel )
return false;
}
return true;
}
void KODayMatrix::clearSelection()
{
mSelEnd = mSelStart = NOSELECTION;
}
void KODayMatrix::recalculateToday()
{
today = -1;
for (int i=0; i<NUMDAYS; i++) {
//events[i] = 0;
days[i] = startdate.addDays(i);
daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] ));
// if today is in the currently displayed month, hilight today
if (days[i].year() == QDate::currentDate().year() &&
days[i].month() == QDate::currentDate().month() &&
days[i].day() == QDate::currentDate().day()) {
today = i;
}
}
// qDebug(QString("Today is visible at %1.").arg(today));
}
void KODayMatrix::updateView()
{
updateView(startdate);
}
void KODayMatrix::repaintViewTimed()
{
mRedrawNeeded = true;
- bDays.fill( false);
- pDays.fill( false);
- hDays.fill( false);
- eDays.fill( false);
+ // bDays.fill( false);
+ //pDays.fill( false);
+ //hDays.fill( false);
+ //eDays.fill( false);
mRepaintTimer->stop();
int startDay = days[0].dayOfWeek(); // 1...7 7 = sunday
int i;
for(i = 0; i < NUMDAYS; i++) {
if ( ( (i+startDay) % 7 == 0 ) ) {
pDays.setBit(i);
}
}
repaint(false);
}
void KODayMatrix::computeEvent(Event *event, int i )
{
QString holiStr = mHolidays[i];
if ( event->isHoliday()) {
pDays.setBit(i);
hDays.setBit(i);
if ( !holiStr.isEmpty() )
holiStr += "\n";
holiStr += event->summary();
if ( !event->location().isEmpty() )
holiStr += " (" + event->location() + ")";
mHolidays[i] =holiStr ;
}
if ( event->isBirthday()) {
pDays.setBit(i);
if ( !holiStr.isEmpty() )
holiStr += "\n";
holiStr += i18n("Birthday") + ": "+event->summary();
if ( !event->location().isEmpty() )
holiStr += " (" + event->location() + ")";
bDays.setBit(i);
mHolidays[i] =holiStr ;
}
eDays.setBit(i);
}
void KODayMatrix::updateViewTimed()
{
mUpdateTimer->stop();
if ( !mCalendar ) {
qDebug("NOT CAL ");
return;
}
#if 1
int i;
int timeSpan = NUMDAYS-1;
QPtrList<Event> events = mCalendar->events();
Event *event;