Diffstat (limited to 'korganizer/datenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/datenavigator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/datenavigator.cpp b/korganizer/datenavigator.cpp index 8d35c42..e26e20b 100644 --- a/korganizer/datenavigator.cpp +++ b/korganizer/datenavigator.cpp | |||
@@ -191,97 +191,97 @@ void DateNavigator::selectWorkWeek( const QDate &d ) | |||
191 | 191 | ||
192 | QDate firstDate = d.addDays( 1 - dayOfWeek ); | 192 | QDate firstDate = d.addDays( 1 - dayOfWeek ); |
193 | 193 | ||
194 | int weekStart = KGlobal::locale()->weekStartDay(); | 194 | int weekStart = KGlobal::locale()->weekStartDay(); |
195 | if ( weekStart != 1 && dayOfWeek >= weekStart ) { | 195 | if ( weekStart != 1 && dayOfWeek >= weekStart ) { |
196 | firstDate = firstDate.addDays( 7 ); | 196 | firstDate = firstDate.addDays( 7 ); |
197 | } | 197 | } |
198 | 198 | ||
199 | selectDates( firstDate, 5 ); | 199 | selectDates( firstDate, 5 ); |
200 | } | 200 | } |
201 | 201 | ||
202 | void DateNavigator::selectToday() | 202 | void DateNavigator::selectToday() |
203 | { | 203 | { |
204 | QDate d = QDate::currentDate(); | 204 | QDate d = QDate::currentDate(); |
205 | 205 | ||
206 | int dateCount = mSelectedDates.count(); | 206 | int dateCount = mSelectedDates.count(); |
207 | 207 | ||
208 | if ( dateCount == 5 ) selectWorkWeek( d ); | 208 | if ( dateCount == 5 ) selectWorkWeek( d ); |
209 | else if ( dateCount == 7 ) selectWeek( d ); | 209 | else if ( dateCount == 7 ) selectWeek( d ); |
210 | else selectDates( d, dateCount ); | 210 | else selectDates( d, dateCount ); |
211 | } | 211 | } |
212 | 212 | ||
213 | void DateNavigator::selectPreviousYear() | 213 | void DateNavigator::selectPreviousYear() |
214 | { | 214 | { |
215 | QDate firstSelected = mSelectedDates.first(); | 215 | QDate firstSelected = mSelectedDates.first(); |
216 | int weekDay = firstSelected.dayOfWeek(); | 216 | int weekDay = firstSelected.dayOfWeek(); |
217 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 ); | 217 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 ); |
218 | 218 | ||
219 | selectWeekByDay( weekDay, firstSelected ); | 219 | selectWeekByDay( weekDay, firstSelected ); |
220 | } | 220 | } |
221 | 221 | ||
222 | void DateNavigator::selectPreviousMonth() | 222 | void DateNavigator::selectPreviousMonth() |
223 | { | 223 | { |
224 | QDate firstSelected = mSelectedDates.first(); | 224 | QDate firstSelected = mSelectedDates.first(); |
225 | int weekDay = firstSelected.dayOfWeek(); | 225 | int weekDay = firstSelected.dayOfWeek(); |
226 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 ); | 226 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 ); |
227 | 227 | ||
228 | 228 | ||
229 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) | 229 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) |
230 | selectMonthByDate( firstSelected ); | 230 | selectMonthByDate( firstSelected ); |
231 | else | 231 | else |
232 | selectWeekByDay( weekDay, firstSelected ); | 232 | selectWeekByDay( weekDay, firstSelected ); |
233 | } | 233 | } |
234 | 234 | ||
235 | void DateNavigator::selectNextMonth() | 235 | void DateNavigator::selectNextMonth() |
236 | { | 236 | { |
237 | QDate firstSelected = mSelectedDates.first(); | 237 | QDate firstSelected = mSelectedDates.first(); |
238 | int weekDay = firstSelected.dayOfWeek(); | 238 | int weekDay = firstSelected.dayOfWeek(); |
239 | 239 | ||
240 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, 1 ); | 240 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, 1 ); |
241 | 241 | ||
242 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) | 242 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) |
243 | selectMonthByDate( firstSelected ); | 243 | selectMonthByDate( firstSelected ); |
244 | else | 244 | else |
245 | selectWeekByDay( weekDay, firstSelected ); | 245 | selectWeekByDay( weekDay, firstSelected ); |
246 | 246 | ||
247 | } | 247 | } |
248 | 248 | ||
249 | void DateNavigator::selectNextYear() | 249 | void DateNavigator::selectNextYear() |
250 | { | 250 | { |
251 | QDate firstSelected = mSelectedDates.first(); | 251 | QDate firstSelected = mSelectedDates.first(); |
252 | int weekDay = firstSelected.dayOfWeek(); | 252 | int weekDay = firstSelected.dayOfWeek(); |
253 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, 1 ); | 253 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, 1 ); |
254 | 254 | ||
255 | selectWeekByDay( weekDay, firstSelected ); | 255 | selectWeekByDay( weekDay, firstSelected ); |
256 | } | 256 | } |
257 | 257 | ||
258 | void DateNavigator::selectPrevious() | 258 | void DateNavigator::selectPrevious() |
259 | { | 259 | { |
260 | int offset = -7; | 260 | int offset = -7; |
261 | if ( datesCount() == 1 ) { | 261 | if ( datesCount() == 1 ) { |
262 | offset = -1; | 262 | offset = -1; |
263 | } | 263 | } |
264 | if ( mViewManager ) | 264 | if ( mViewManager ) |
265 | if ( mViewManager->showsNextDays() ) | 265 | if ( mViewManager->showsNextDays() ) |
266 | offset = -datesCount(); | 266 | offset = -datesCount(); |
267 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); | 267 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); |
268 | } | 268 | } |
269 | 269 | ||
270 | void DateNavigator::selectNext() | 270 | void DateNavigator::selectNext() |
271 | { | 271 | { |
272 | int offset = 7; | 272 | int offset = 7; |
273 | if ( datesCount() == 1 ) { | 273 | if ( datesCount() == 1 ) { |
274 | offset = 1; | 274 | offset = 1; |
275 | } | 275 | } |
276 | if ( mViewManager ) | 276 | if ( mViewManager ) |
277 | if ( mViewManager->showsNextDays() ) | 277 | if ( mViewManager->showsNextDays() ) |
278 | offset = datesCount(); | 278 | offset = datesCount(); |
279 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); | 279 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); |
280 | } | 280 | } |
281 | 281 | ||
282 | void DateNavigator::emitSelected() | 282 | void DateNavigator::emitSelected() |
283 | { | 283 | { |
284 | emit datesSelected( mSelectedDates ); | 284 | emit datesSelected( mSelectedDates ); |
285 | } | 285 | } |
286 | 286 | ||
287 | #include "datenavigator.moc" | 287 | //#include "datenavigator.moc" |