OSDN Git Service

libs: update the current date of Plasma::Calendar from Plasma::Calendar::setDate()
authorIvailo Monev <xakepa10@gmail.com>
Mon, 24 Jul 2023 17:32:32 +0000 (20:32 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 24 Jul 2023 17:32:32 +0000 (20:32 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
libs/plasmaclock/calendar.cpp

index 9c4ef74..8808e8d 100644 (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);