summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-22 17:03:38 (UTC)
committer zautrix <zautrix>2005-10-22 17:03:38 (UTC)
commitc1cb0653160e8e449d07a0df7b84b2398c0201fb (patch) (side-by-side diff)
tree41c648d74574cb47b1e3341a918b448b86c264d9
parent3ec18dd19fdf4eb7e763b8022f90de83249facfd (diff)
downloadkdepimpi-c1cb0653160e8e449d07a0df7b84b2398c0201fb.zip
kdepimpi-c1cb0653160e8e449d07a0df7b84b2398c0201fb.tar.gz
kdepimpi-c1cb0653160e8e449d07a0df7b84b2398c0201fb.tar.bz2
fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 7076e05..52fd1e8 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -619,98 +619,98 @@ void KODayMatrix::updateViewTimed()
mRedrawNeeded = true;
if ( ! mPendingUpdateBeforeRepaint )
repaint(false);
}
void KODayMatrix::updateView(QDate actdate)
{
if ( mLastView != KOPrefs::instance()->mCurrentDisplayedView )
mRedrawNeeded = true;
mLastView = KOPrefs::instance()->mCurrentDisplayedView;
if ( ! actdate.isValid() ) {
//qDebug("date not valid ");
return;
}
mDayChanged = false;
//flag to indicate if the starting day of the matrix has changed by this call
//mDayChanged = false;
// if a new startdate is to be set then apply Cornelius's calculation
// of the first day to be shown
if (actdate != startdate) {
// reset index of selection according to shift of starting date from startdate to actdate
if (mSelStart != NOSELECTION) {
int tmp = actdate.daysTo(startdate);
//kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl;
// shift selection if new one would be visible at least partly !
if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) {
// nested if is required for next X display pushed from a different month - correction required
// otherwise, for month forward and backward, it must be avoided
if( mSelStart > NUMDAYS || mSelStart < 0 )
mSelStart = mSelStart + tmp;
if( mSelEnd > NUMDAYS || mSelEnd < 0 )
mSelEnd = mSelEnd + tmp;
}
}
startdate = actdate;
mDayChanged = true;
recalculateToday();
mRedrawNeeded = true;
}
//qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
if ( !isVisible() ) {
mPendingUpdateBeforeRepaint = true;
} else {
#ifdef DESKTOP_VERSION
//mRepaintTimer->start( 100 );
//updateViewTimed();
mUpdateTimer->start( 50 );
#else
- mRepaintTimer->start( 350 );
- mUpdateTimer->start( 800 );
+ mRepaintTimer->start( 250 );
+ mUpdateTimer->start( 500 );
#endif
}
}
void KODayMatrix::updateEvents()
{
if ( !mCalendar ) return;
for( int i = 0; i < NUMDAYS; i++ ) {
// if events are set for the day then remember to draw it bold
QPtrList<Event> eventlist = mCalendar->events( days[ i ] );
int numEvents = eventlist.count();
Event *event;
for( event = eventlist.first(); event != 0;event=eventlist.next()) {
ushort recurType = event->doesRecur();
if ( ( recurType == Recurrence::rDaily &&
!KOPrefs::instance()->mDailyRecur ) ||
( recurType == Recurrence::rWeekly &&
!KOPrefs::instance()->mWeeklyRecur ) ) {
numEvents--;
}
if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) {
numEvents--;
}
}
if ( numEvents )
eDays.setBit(i);
else
eDays.clearBit(i);
}
}
const QDate& KODayMatrix::getDate(int offset)
{
if (offset < 0 || offset > NUMDAYS-1) {
qDebug("Wrong offset2 %d", offset);
return days[0];
}
return days[offset];
}
QString KODayMatrix::getHolidayLabel(int offset)
{
if (offset < 0 || offset > NUMDAYS-1) {
qDebug("Wrong offset1 %d", offset);
return QString();
}
return mHolidays[offset];