Commit 420c0ad7 authored by Sergio Martins's avatar Sergio Martins
Browse files

Fix the last bug related to the selection crossing months.

I already fixed this bug some months ago, but it was for the navigator's back/forward arrows.
Now its fixed for the toolbar's Forward/Backward actions too.

BUG: 258866
parent e7a4b1c3
......@@ -43,6 +43,7 @@
#include "koviewmanager.h"
#include "navigatorbar.h"
#include "publishdialog.h"
#include "kodaymatrix.h"
#include "htmlexportsettings.h"
#include "views/agendaview/koagendaview.h"
#include "views/monthview/monthview.h"
......@@ -615,7 +616,9 @@ void CalendarView::goToday()
void CalendarView::goNext()
{
if ( dynamic_cast<MonthView*>( mViewManager->currentView() ) ) {
mDateNavigator->selectNextMonth();
const QDate month = mDateNavigatorContainer->monthOfNavigator( 0 );
QPair<QDate,QDate> limits = KODayMatrix::matrixLimits( month );
mDateNavigator->selectNextMonth( month, limits.first, limits.second );
} else {
mDateNavigator->selectNext();
}
......@@ -624,7 +627,9 @@ void CalendarView::goNext()
void CalendarView::goPrevious()
{
if ( dynamic_cast<MonthView*>( mViewManager->currentView() ) ) {
mDateNavigator->selectPreviousMonth();
const QDate month = mDateNavigatorContainer->monthOfNavigator( 0 );
QPair<QDate,QDate> limits = KODayMatrix::matrixLimits( month );
mDateNavigator->selectPreviousMonth( month, limits.first, limits.second );
} else {
mDateNavigator->selectPrevious();
}
......
......@@ -70,7 +70,6 @@ void DateNavigator::selectDate( const QDate &date )
kDebug() << "an invalid date was passed as a parameter!";
d = QDate::currentDate();
}
mSelectedDates.clear();
mSelectedDates.append( d );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment