author | zautrix <zautrix> | 2005-01-31 08:05:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-31 08:05:32 (UTC) |
commit | f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c (patch) (side-by-side diff) | |
tree | 683febfff7427b923f23178e74b7cc0e50ef461d | |
parent | ed5723f40a93bbedfcbd9f54e6379a23c4a76096 (diff) | |
download | kdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.zip kdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.tar.gz kdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.tar.bz2 |
fix
-rw-r--r-- | korganizer/koagendaview.cpp | 2 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 57 | ||||
-rw-r--r-- | korganizer/kodaymatrix.h | 1 |
3 files changed, 29 insertions, 31 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 8b79788..8e9add3 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -1509,2 +1509,4 @@ void KOAgendaView::updateTodo( Todo * t, int ) { + if ( !isVisible() ) + return; bool remove = false; diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 9c3621e..be5a775 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -21,3 +21,3 @@ with any edition of Qt, and distribute the resulting executable, - without including the source code for Qt in the source distribution. + without including the source ode for Qt in the source distribution. */ @@ -93,2 +93,3 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const mCalendar = calendar; + mPendingUpdateBeforeRepaint = false; @@ -193,2 +194,3 @@ void KODayMatrix::recalculateToday() for (int i=0; i<NUMDAYS; i++) { + events[i] = 0; days[i] = startdate.addDays(i); @@ -212,3 +214,3 @@ void KODayMatrix::repaintViewTimed() { - qDebug("KODayMatrix::repaintViewTimed "); + //qDebug("KODayMatrix::repaintViewTimed "); mRepaintTimer->stop(); @@ -220,12 +222,3 @@ void KODayMatrix::updateViewTimed() mUpdateTimer->stop(); - //QDate actdate = mPendingNewDate; - - static int iii = 0; - qDebug("KODayMatrix::updateView(QDate actdate) %d", ++iii ); - - if (mDayChanged) { - recalculateToday(); - mDayChanged = false; - } - + //qDebug("KODayMatrix::updateView(QDate actdate) %d", ++iii ); for(int i = 0; i < NUMDAYS; i++) { @@ -262,3 +255,4 @@ void KODayMatrix::updateViewTimed() } - repaint(false); + if ( ! mPendingUpdateBeforeRepaint ) + repaint(false); } @@ -267,2 +261,7 @@ void KODayMatrix::updateView(QDate actdate) + 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 @@ -287,24 +286,17 @@ void KODayMatrix::updateView(QDate actdate) } - startdate = actdate; mDayChanged = true; + recalculateToday(); } - qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); - static int iii = 0; - if ( iii < 2 ) { - ++iii; - updateViewTimed(); + //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); + if ( !isVisible() ) { + mPendingUpdateBeforeRepaint = true; } else { - if ( !isVisible() ) { - mUpdateTimer->start( 2000 ); - } else { - if ( mDayChanged ) { - mUpdateTimer->start( 250 ); - } else { - mRepaintTimer->start( 250 ); - mUpdateTimer->start( 2000 ); - } - } + mRepaintTimer->start( 250 ); +#ifdef DESKTOP_VERSION + mUpdateTimer->start( 2000 ); +#else + mUpdateTimer->start( 4000 ); +#endif } - } @@ -497,3 +489,6 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) //kdDebug() << "KODayMatrix::paintEvent() BEGIN" << endl; - + if ( mPendingUpdateBeforeRepaint ) { + updateViewTimed(); + mPendingUpdateBeforeRepaint = false; + } QPainter p(this); diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index 0e9640a..ac2f59c 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h @@ -226,2 +226,3 @@ private: bool mDayChanged; + bool mPendingUpdateBeforeRepaint; |