[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/plasmaclock
From:       Christian Loose <christian.loose () hamburg ! de>
Date:       2009-03-14 17:03:39
Message-ID: 1237050219.681997.17400.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 939326 by cloose:

Fix "Go To Today"

-> Block weekSpinBox signals in Calendar::dateUpdated() so the date isn't changed again 
   by calling Calendar::goToWeek()
-> Update d->date in CalendarTable::setDate() after the displayYearChanged() and displayMonthChanged() 
   signals.

BUG: 187083



 M  +4 -0      calendar.cpp  
 M  +3 -1      calendartable.cpp  


--- trunk/KDE/kdebase/workspace/libs/plasmaclock/calendar.cpp #939325:939326
@@ -207,7 +207,11 @@
     d->month->setText(d->calendarTable->calendar()->monthName(date));
     d->year->setText(QString::number(d->calendarTable->calendar()->year(date)));
     d->dateText->setText(formatted);
+
+    // Block the signals to prevent changing the date again
+    d->weekSpinBox->blockSignals(true);
     d->weekSpinBox->setValue(d->calendarTable->calendar()->weekNumber(date));
+    d->weekSpinBox->blockSignals(false);
 
     emit dateChanged(date);
 }
--- trunk/KDE/kdebase/workspace/libs/plasmaclock/calendartable.cpp #939325:939326
@@ -225,7 +225,6 @@
     int oldYear = d->year;
     int oldMonth = d->month;
     QDate oldDate = d->date;
-    d->date = date;
     d->year = d->calendar->year(date);
     d->month = d->calendar->month(date);
     bool fullUpdate = false;
@@ -240,6 +239,9 @@
         fullUpdate = true;
     }
 
+    // now change the date
+    d->date = date;
+
     d->updateHoveredPainting(this, QPointF());
 
     if (fullUpdate) {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic