[utilities/powerplant] src: Initialize date to today so that its the default value when creating new plant
Carl Schwan <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 65a19aa5fc32498b670ce2d3cc7a32ab83c7e3a9 by Carl Schwan, on behalf of Michael Rostom.
Committed on 07/08/2026 at 14:31.
Pushed by carlschwan into branch 'master'.
Initialize date to today so that its the default value when creating new plant
This bug was introduced by my previous MR https://invent.kde.org/utilities/powerplant/-/merge_requests/66 (sorry). If you create a new plant and don't set the birthdate, it would default to 1970. I just initialized the dateTime to today to avoid that
M +1 -1 src/planteditor.h
https://invent.kde.org/utilities/powerplant/-/commit/65a19aa5fc32498b670ce2d3cc7a32ab83c7e3a9
diff --git a/src/planteditor.h b/src/planteditor.h
index 7279289..d3f31aa 100644
--- a/src/planteditor.h
+++ b/src/planteditor.h
@@ -86,7 +86,7 @@ private:
QString m_species;
QUrl m_imgUrl;
QString m_location;
- QDateTime m_dateOfBirth;
+ QDateTime m_dateOfBirth = QDateTime::currentDateTime();
QDate m_lastWatered;
QDate m_lastFertilized;
int m_waterInterval = 2;