summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1785b8a..7566c6f 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -678,23 +678,43 @@ void CalendarView::scrollBarValue(int val )
int day = mNavigator->selectedDates().first().dayOfYear();
int stepdays = val;
if ( mDateScrollBar->lineStep () <= count ) {
- val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
+ //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
//qDebug("VAL %d ",val );
stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
- stepdays = day-1+stepdays;
+ stepdays = day+stepdays;
if ( stepdays < 0 ) stepdays = 0;
}
- if ( stepdays == day -1 ) {
+ if ( stepdays == day ) {
block = false;
return;
}
int year = mNavigator->selectedDates().first().year();
QDate d ( year,1,1 );
- mNavigator->selectDates( d.addDays( stepdays) , count );
+ mNavigator->selectDates( d.addDays( stepdays-1) , count );
block = false;
#endif
}
+void CalendarView::updateView(const QDate &start, const QDate &end)
+{
+#ifdef DESKTOP_VERSION
+ if ( ! mDateScrollBar->draggingSlider () ) {
+ int dof = start.dayOfYear();
+ //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() );
+ if ( dof != mDateScrollBar->value() ) {
+ mDateScrollBar->blockSignals( true );
+ mDateScrollBar->setValue( start.dayOfYear());
+ mDateScrollBar->blockSignals( false );
+ }
+ }
+#endif
+ mTodoList->updateView();
+ mViewManager->updateView(start, end);
+ //mDateNavigator->updateView();
+}
+
+
+
void CalendarView::checkFiles()
{
QString message;
@@ -2633,22 +2653,6 @@ void CalendarView::updateTodoViews()
}
-void CalendarView::updateView(const QDate &start, const QDate &end)
-{
-#ifdef DESKTOP_VERSION
- if ( ! mDateScrollBar->draggingSlider () ) {
- int dof = start.dayOfYear()-1;
- if ( dof != mDateScrollBar->value() ) {
- mDateScrollBar->blockSignals( true );
- mDateScrollBar->setValue( start.dayOfYear()-1);
- mDateScrollBar->blockSignals( false );
- }
- }
-#endif
- mTodoList->updateView();
- mViewManager->updateView(start, end);
- //mDateNavigator->updateView();
-}
void CalendarView::clearAllViews()
{