libs: update the current date of Plasma::Calendar from Plasma::Calendar::setDate()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-07-24 20:32:32 +03:00
parent 7b77d41a52
commit d7d63a156b

View file

@ -174,9 +174,10 @@ void Calendar::setDate(const QDate &toDate)
return;
}
// If new date is the same as old date don't actually need to do anything
if (toDate == date()) {
return;
// NOTE: this method is called by Plasma::ClockApplet::popupEvent() on show so updating as if
// show event ocurred
if (d->automaticUpdates) {
d->currentDate = QDate::currentDate();
}
d->calendarWidget->setSelectedDate(toDate);