summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-31 08:05:32 (UTC)
committer zautrix <zautrix>2005-01-31 08:05:32 (UTC)
commitf7663a4c854d217bcb4f828a3ebb69cc40d0dd7c (patch) (unidiff)
tree683febfff7427b923f23178e74b7cc0e50ef461d
parented5723f40a93bbedfcbd9f54e6379a23c4a76096 (diff)
downloadkdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.zip
kdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.tar.gz
kdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp2
-rw-r--r--korganizer/kodaymatrix.cpp57
-rw-r--r--korganizer/kodaymatrix.h1
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
@@ -1508,4 +1508,6 @@ void KOAgendaView::setStartHour( int h )
1508void KOAgendaView::updateTodo( Todo * t, int ) 1508void KOAgendaView::updateTodo( Todo * t, int )
1509{ 1509{
1510 if ( !isVisible() )
1511 return;
1510 bool remove = false; 1512 bool remove = false;
1511 bool removeAD = false; 1513 bool removeAD = false;
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 9c3621e..be5a775 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -20,5 +20,5 @@
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source ode for Qt in the source distribution.
23*/ 23*/
24 24
@@ -92,4 +92,5 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const
92{ 92{
93 mCalendar = calendar; 93 mCalendar = calendar;
94 mPendingUpdateBeforeRepaint = false;
94 95
95 // initialize dynamic arrays 96 // initialize dynamic arrays
@@ -192,4 +193,5 @@ void KODayMatrix::recalculateToday()
192 today = -1; 193 today = -1;
193 for (int i=0; i<NUMDAYS; i++) { 194 for (int i=0; i<NUMDAYS; i++) {
195 events[i] = 0;
194 days[i] = startdate.addDays(i); 196 days[i] = startdate.addDays(i);
195 daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] )); 197 daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] ));
@@ -211,5 +213,5 @@ void KODayMatrix::updateView()
211void KODayMatrix::repaintViewTimed() 213void KODayMatrix::repaintViewTimed()
212{ 214{
213 qDebug("KODayMatrix::repaintViewTimed "); 215 //qDebug("KODayMatrix::repaintViewTimed ");
214 mRepaintTimer->stop(); 216 mRepaintTimer->stop();
215 repaint(false); 217 repaint(false);
@@ -219,14 +221,5 @@ void KODayMatrix::updateViewTimed()
219 221
220 mUpdateTimer->stop(); 222 mUpdateTimer->stop();
221 //QDate actdate = mPendingNewDate; 223 //qDebug("KODayMatrix::updateView(QDate actdate) %d", ++iii );
222
223 static int iii = 0;
224 qDebug("KODayMatrix::updateView(QDate actdate) %d", ++iii );
225
226 if (mDayChanged) {
227 recalculateToday();
228 mDayChanged = false;
229 }
230
231 for(int i = 0; i < NUMDAYS; i++) { 224 for(int i = 0; i < NUMDAYS; i++) {
232 225
@@ -261,9 +254,15 @@ void KODayMatrix::updateViewTimed()
261 } 254 }
262 } 255 }
263 repaint(false); 256 if ( ! mPendingUpdateBeforeRepaint )
257 repaint(false);
264 } 258 }
265void KODayMatrix::updateView(QDate actdate) 259void KODayMatrix::updateView(QDate actdate)
266{ 260{
267 261
262 if ( ! actdate.isValid() ) {
263 //qDebug("date not valid ");
264 return;
265 }
266 mDayChanged = false;
268 //flag to indicate if the starting day of the matrix has changed by this call 267 //flag to indicate if the starting day of the matrix has changed by this call
269 //mDayChanged = false; 268 //mDayChanged = false;
@@ -286,26 +285,19 @@ void KODayMatrix::updateView(QDate actdate)
286 } 285 }
287 } 286 }
288
289 startdate = actdate; 287 startdate = actdate;
290 mDayChanged = true; 288 mDayChanged = true;
289 recalculateToday();
291 } 290 }
292 qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() ); 291 //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
293 static int iii = 0; 292 if ( !isVisible() ) {
294 if ( iii < 2 ) { 293 mPendingUpdateBeforeRepaint = true;
295 ++iii;
296 updateViewTimed();
297 } else { 294 } else {
298 if ( !isVisible() ) { 295 mRepaintTimer->start( 250 );
299 mUpdateTimer->start( 2000 ); 296#ifdef DESKTOP_VERSION
300 } else { 297 mUpdateTimer->start( 2000 );
301 if ( mDayChanged ) { 298#else
302 mUpdateTimer->start( 250 ); 299 mUpdateTimer->start( 4000 );
303 } else { 300#endif
304 mRepaintTimer->start( 250 );
305 mUpdateTimer->start( 2000 );
306 }
307 }
308 } 301 }
309
310} 302}
311 303
@@ -496,5 +488,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
496{ 488{
497//kdDebug() << "KODayMatrix::paintEvent() BEGIN" << endl; 489//kdDebug() << "KODayMatrix::paintEvent() BEGIN" << endl;
498 490 if ( mPendingUpdateBeforeRepaint ) {
491 updateViewTimed();
492 mPendingUpdateBeforeRepaint = false;
493 }
499 QPainter p(this); 494 QPainter p(this);
500 495
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index 0e9640a..ac2f59c 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -225,4 +225,5 @@ private:
225 QTimer* mRepaintTimer; 225 QTimer* mRepaintTimer;
226 bool mDayChanged; 226 bool mDayChanged;
227 bool mPendingUpdateBeforeRepaint;
227 228
228 /** returns the index of the day located at the matrix's widget (x,y) position. 229 /** returns the index of the day located at the matrix's widget (x,y) position.