Commit 5c9c45bb authored by Glen Ditchfield's avatar Glen Ditchfield 🐛 Committed by Glen Ditchfield

Handle changes to start dates of recurring to-dos

 * `IncidenceDateTime::load(Todo::Ptr)` did not cause
   `startDateChanged` to be emitted when the start date changed, so
   the recurrence rule editor did not recalculate its menus; see
   bug 430651.
 * If the start date's year changes, the recurrence rule menus must be
   recalculated, because the number of days in February differs
   between leap years and non-leap years.
 * In comparison to `load(Event::Ptr)`, `load(ToDo::Ptr)` did not make
   connections to `updateStartTime` in several circumstances, so
   changing the start date did not cause matching changes to the end
   date.

BUG: 430651

FIXED-IN: 5.16.1
parent 3eef1ba7
Pipeline #46704 passed with stage
in 8 minutes and 42 seconds
......@@ -271,8 +271,7 @@ void IncidenceDateTime::updateStartDate(const QDate &newDate)
return;
}
const bool dateChanged = mCurrentStartDateTime.date().day() != newDate.day()
|| mCurrentStartDateTime.date().month() != newDate.month();
const bool dateChanged = mCurrentStartDateTime.date() != newDate;
QDateTime endDateTime = currentEndDateTime();
int daysep = mCurrentStartDateTime.daysTo(endDateTime);
......@@ -302,8 +301,7 @@ void IncidenceDateTime::updateStartSpec()
mCurrentStartDateTime.setTimeZone(mUi->mTimeZoneComboStart->selectedTimeZone());
const bool dateChanged = mCurrentStartDateTime.date().day() != prevDate.day()
|| mCurrentStartDateTime.date().month() != prevDate.month();
const bool dateChanged = mCurrentStartDateTime.date() != prevDate;
if (dateChanged) {
Q_EMIT startDateChanged(mCurrentStartDateTime.date());
......@@ -661,17 +659,17 @@ void IncidenceDateTime::load(const KCalendarCore::Todo::Ptr &todo, bool isTempla
connect(mUi->mStartCheck, &QCheckBox::toggled, this, &IncidenceDateTime::enableStartEdit);
connect(mUi->mStartCheck, &QCheckBox::toggled, this, &IncidenceDateTime::startDateTimeToggled);
connect(mUi->mStartDateEdit, &KDateComboBox::dateChanged, this,
&IncidenceDateTime::checkDirtyStatus);
&IncidenceDateTime::updateStartDate);
connect(mUi->mStartTimeEdit, &KTimeComboBox::timeChanged, this,
&IncidenceDateTime::updateStartTime);
connect(mUi->mStartTimeEdit, &KTimeComboBox::timeEdited, this,
&IncidenceDateTime::checkDirtyStatus);
&IncidenceDateTime::updateStartTime);
connect(mUi->mTimeZoneComboStart,
static_cast<void (IncidenceEditorNG::KTimeZoneComboBox::*)(int)>(&IncidenceEditorNG::
KTimeZoneComboBox::
currentIndexChanged),
this,
&IncidenceDateTime::checkDirtyStatus);
&IncidenceDateTime::updateStartSpec);
connect(mUi->mEndCheck, &QCheckBox::toggled, this, &IncidenceDateTime::enableEndEdit);
connect(mUi->mEndCheck, &QCheckBox::toggled, this, &IncidenceDateTime::endDateTimeToggled);
......@@ -685,6 +683,8 @@ void IncidenceDateTime::load(const KCalendarCore::Todo::Ptr &todo, bool isTempla
&IncidenceDateTime::endDateChanged);
connect(mUi->mEndTimeEdit, &KTimeComboBox::timeChanged, this,
&IncidenceDateTime::endTimeChanged);
connect(mUi->mEndTimeEdit, &KTimeComboBox::timeEdited, this,
&IncidenceDateTime::endTimeChanged);
connect(mUi->mTimeZoneComboEnd,
static_cast<void (IncidenceEditorNG::KTimeZoneComboBox::*)(int)>(&IncidenceEditorNG::
KTimeZoneComboBox::
......
Markdown is supported
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