author | zautrix <zautrix> | 2005-03-21 16:28:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-21 16:28:05 (UTC) |
commit | 070055b60f76ffd6907e44a4ffc2d752578f3211 (patch) (unidiff) | |
tree | 727346a900b4712f36842c460bfa0fef1ba6382b | |
parent | 86c420a68008e4430bd769ebdecdfa430ba552f5 (diff) | |
download | kdepimpi-070055b60f76ffd6907e44a4ffc2d752578f3211.zip kdepimpi-070055b60f76ffd6907e44a4ffc2d752578f3211.tar.gz kdepimpi-070055b60f76ffd6907e44a4ffc2d752578f3211.tar.bz2 |
fix
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 7 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 9506768..b147427 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -128,13 +128,18 @@ void DateNavigatorContainer::selectDates( const DateList &dateList ) | |||
128 | { | 128 | { |
129 | mNavigatorView->selectDates( dateList ); | 129 | mNavigatorView->selectDates( dateList ); |
130 | setBaseDates(); | 130 | setBaseDates(); |
131 | if ( mExtraViews.count() ) { | 131 | if ( mExtraViews.count() ) { |
132 | KDateNavigator *view = mExtraViews.at( 0 ); | 132 | KDateNavigator *view = mExtraViews.at( 0 ); |
133 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); | 133 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); |
134 | view->dayMatrix()->repaint( false ); | 134 | view->dayMatrix()->repaint( false ); |
135 | if ( mExtraViews.count() > 1 ) { | ||
136 | KDateNavigator *view = mExtraViews.at( 1 ); | ||
137 | view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); | ||
138 | view->dayMatrix()->repaint( false ); | ||
139 | } | ||
135 | } | 140 | } |
136 | } | 141 | } |
137 | 142 | ||
138 | void DateNavigatorContainer::setBaseDates() | 143 | void DateNavigatorContainer::setBaseDates() |
139 | { | 144 | { |
140 | KCal::DateList dateList = mNavigatorView->selectedDates(); | 145 | KCal::DateList dateList = mNavigatorView->selectedDates(); |
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index a776cb6..d7a4112 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp | |||
@@ -287,12 +287,13 @@ void KODayMatrix::addSelectedDaysTo(DateList& selDays) | |||
287 | void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) | 287 | void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end) |
288 | { | 288 | { |
289 | mSelStart = startdate.daysTo(start); | 289 | mSelStart = startdate.daysTo(start); |
290 | if ( mSelStart < 0 ) | 290 | if ( mSelStart < 0 ) |
291 | mSelStart = 0; | 291 | mSelStart = 0; |
292 | mSelEnd = startdate.daysTo(end); | 292 | mSelEnd = startdate.daysTo(end); |
293 | //qDebug("SELECTION %d %d ", mSelStart ,mSelEnd ); | ||
293 | if ( mSelEnd < 0 ) | 294 | if ( mSelEnd < 0 ) |
294 | clearSelection(); | 295 | clearSelection(); |
295 | } | 296 | } |
296 | void KODayMatrix::clearSelection() | 297 | void KODayMatrix::clearSelection() |
297 | { | 298 | { |
298 | mSelEnd = mSelStart = NOSELECTION; | 299 | mSelEnd = mSelStart = NOSELECTION; |
@@ -688,13 +689,19 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) | |||
688 | if (mSelStart != NOSELECTION) { | 689 | if (mSelStart != NOSELECTION) { |
689 | bool skip = false; | 690 | bool skip = false; |
690 | if ( ! mouseDown ) { | 691 | if ( ! mouseDown ) { |
691 | int mo = days[20].month(); | 692 | int mo = days[20].month(); |
692 | //qDebug("-- %d %d ", mSelStartT, mSelEndT); | 693 | //qDebug("-- %d %d ", mSelStartT, mSelEndT); |
693 | //qDebug("%d %d %d - d %d", mo, days[mSelStartT].month() , days[mSelEndT].month(), days[mSelEndT].day() ); | 694 | //qDebug("%d %d %d - d %d", mo, days[mSelStartT].month() , days[mSelEndT].month(), days[mSelEndT].day() ); |
694 | if ( days[mSelStartT].month() > mo || days[mSelEndT].month() < mo ) { | 695 | int startMo = days[mSelStartT].month(); |
696 | int endMo = days[mSelEndT].month(); | ||
697 | if ( startMo == 12 && mo == 1 && endMo == 1 ) | ||
698 | startMo = 1; | ||
699 | if ( endMo == 1 && mo == 12 ) | ||
700 | endMo = 12; | ||
701 | if ( (startMo > mo || endMo < mo) ) { | ||
695 | skip = true; | 702 | skip = true; |
696 | } else { | 703 | } else { |
697 | if ( days[mSelStartT].month() != mo ) { | 704 | if ( days[mSelStartT].month() != mo ) { |
698 | int add = days[mSelStartT].daysInMonth ()-days[mSelStartT].day(); | 705 | int add = days[mSelStartT].daysInMonth ()-days[mSelStartT].day(); |
699 | mSelStartT += add +1; | 706 | mSelStartT += add +1; |
700 | } | 707 | } |