author | zautrix <zautrix> | 2005-03-29 12:14:44 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 12:14:44 (UTC) |
commit | 894717798a8d129f4b991a2fe856d2f1e8e9624a (patch) (unidiff) | |
tree | fd28b6e3855d0f684bc9f341e60a0c1d0d50cd56 | |
parent | 4af444fb7071d37c966f002f4971d209971679c9 (diff) | |
download | kdepimpi-894717798a8d129f4b991a2fe856d2f1e8e9624a.zip kdepimpi-894717798a8d129f4b991a2fe856d2f1e8e9624a.tar.gz kdepimpi-894717798a8d129f4b991a2fe856d2f1e8e9624a.tar.bz2 |
fix
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index edeebdf..27ba9e0 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -97,65 +97,65 @@ void DateNavigatorContainer::slotgoPrevYear() | |||
97 | 97 | ||
98 | } | 98 | } |
99 | void DateNavigatorContainer::slotgoPrevMonth() | 99 | void DateNavigatorContainer::slotgoPrevMonth() |
100 | { | 100 | { |
101 | jumpMonth( -1 ); | 101 | jumpMonth( -1 ); |
102 | emit goPrevMonth(); | 102 | emit goPrevMonth(); |
103 | 103 | ||
104 | } | 104 | } |
105 | void DateNavigatorContainer::slotgoNextMonth() | 105 | void DateNavigatorContainer::slotgoNextMonth() |
106 | { | 106 | { |
107 | jumpMonth( 1 ); | 107 | jumpMonth( 1 ); |
108 | emit goNextMonth(); | 108 | emit goNextMonth(); |
109 | } | 109 | } |
110 | void DateNavigatorContainer::jumpMonth( int month ) | 110 | void DateNavigatorContainer::jumpMonth( int month ) |
111 | { | 111 | { |
112 | 112 | ||
113 | QDate baseDate = mNavigatorView->baseDate(); | 113 | QDate baseDate = mNavigatorView->baseDate(); |
114 | computeMonthSelected( baseDate.month() + month, false ); | 114 | computeMonthSelected( baseDate.month() + month, false ); |
115 | } | 115 | } |
116 | void DateNavigatorContainer::slotMonthSelected( int month ) | 116 | void DateNavigatorContainer::slotMonthSelected( int month ) |
117 | { | 117 | { |
118 | computeMonthSelected( month, true ); | 118 | computeMonthSelected( month, true ); |
119 | } | 119 | } |
120 | void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit ) | 120 | void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit ) |
121 | { | 121 | { |
122 | //qDebug("slotMonthSelected %d ", month); | 122 | //qDebug("slotMonthSelected %d ", month); |
123 | QDate baseDate = mNavigatorView->baseDate(); | 123 | QDate baseDate = mNavigatorView->baseDate(); |
124 | if ( baseDate.month() == month ) | 124 | if ( baseDate.month() == month ) |
125 | return; | 125 | return; |
126 | //qDebug("month %d %d ",baseDate.month(),month); | 126 | //qDebug("month %d %d ",baseDate.month(),month); |
127 | QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); | 127 | QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); |
128 | date = date.addDays( -(baseDate.month()-month ) *30 ); | 128 | date = date.addDays( -(baseDate.month()-month ) *30 ); |
129 | QDate newBase = QDate ( date.year(), date.month() , baseDate.day() ); | 129 | QDate newBase = QDate ( date.year(), date.month() ,1 ); |
130 | 130 | ||
131 | //qDebug("NEW BASE %s", newBase.toString().latin1()); | 131 | //qDebug("NEW BASE %s", newBase.toString().latin1()); |
132 | mNavigatorView->setBaseDate( newBase ); | 132 | mNavigatorView->setBaseDate( newBase ); |
133 | QDate last = lastAvailableDate(); | 133 | QDate last = lastAvailableDate(); |
134 | QDate first = firstAvailableDate(); | 134 | QDate first = firstAvailableDate(); |
135 | 135 | ||
136 | QDate selFirst = mFirstSelectedDate; | 136 | QDate selFirst = mFirstSelectedDate; |
137 | QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); | 137 | QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); |
138 | if ( selFirst >= first && selLast <= last ) { | 138 | if ( selFirst >= first && selLast <= last ) { |
139 | setBaseDates(); | 139 | setBaseDates(); |
140 | if ( forceEmit ) | 140 | if ( forceEmit ) |
141 | updateDayMatrixDates(); | 141 | updateDayMatrixDates(); |
142 | } | 142 | } |
143 | else { | 143 | else { |
144 | setBaseDates(); | 144 | setBaseDates(); |
145 | if ( forceEmit ) | 145 | if ( forceEmit ) |
146 | updateDayMatrixDates(); | 146 | updateDayMatrixDates(); |
147 | if ( forceEmit ) | 147 | if ( forceEmit ) |
148 | emit monthSelected( month ); | 148 | emit monthSelected( month ); |
149 | } | 149 | } |
150 | } | 150 | } |
151 | void DateNavigatorContainer::setCalendar( Calendar *cal ) | 151 | void DateNavigatorContainer::setCalendar( Calendar *cal ) |
152 | { | 152 | { |
153 | mCalendar = cal; | 153 | mCalendar = cal; |
154 | mNavigatorView->setCalendar( cal ); | 154 | mNavigatorView->setCalendar( cal ); |
155 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 155 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
156 | KDateNavigator *n = mExtraViews.at( i ); | 156 | KDateNavigator *n = mExtraViews.at( i ); |
157 | n->setCalendar( cal ); | 157 | n->setCalendar( cal ); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | void DateNavigatorContainer::checkUpdateDayMatrixDates() | 160 | void DateNavigatorContainer::checkUpdateDayMatrixDates() |
161 | { | 161 | { |