Summary: | Cannot set Addressee birthday from QML (e.g., from plasma-phonebook) | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kcontacts | Reporter: | Kevin Kofler <kevin.kofler> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | vkrause |
Priority: | NOR | ||
Version: | git | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
URL: | https://invent.kde.org/plasma-mobile/plasma-phonebook/-/issues/6 | ||
Latest Commit: | https://invent.kde.org/frameworks/kcontacts/commit/8b4ba9c0ed465ded679e626071feebe8aabe481c | Version Fixed In: |
Description
Kevin Kofler
2021-12-08 04:55:37 UTC
Ping? Would a solution like the one I suggested be acceptable? If so, I can probably send a merge request, but I will not spend my time on it if it is going to be rejected anyway. So I need your feedback! Volker, you are the one who added the Q_PROPERTY lines for Addressee including the one at issue here, could you please chime in? (I am willing to send a merge request if the general approach sounds reasonable to you, but I do not want to waste my time coding a merge request if it will be met with the same silence as this bug report.) Making the birthday property writable in some form, using the approach you outlined or e.g. by marking the existing setter Q_INVOKABLE, seems like a good idea to me. But of course I can't make any promises about this being accepted, I'm not the maintainer of KContacts. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kcontacts/-/merge_requests/37 Git commit 8b4ba9c0ed465ded679e626071feebe8aabe481c by Kevin Kofler. Committed on 30/03/2022 at 23:03. Pushed by kkofler into branch 'master'. Addressee: make birthday writable from QML Add a private Addressee::setBirthdayProperty(const QDateTime &) wrapper method that guesses the extra withTime argument and use that as the WRITE method for the Q_PROPERTY birthday. A non-midnight time spec will lead to the birthday being recorded with the time, a time spec exactly at midnight to a date-only birthday (the common case). This is the best we can do for a property setter. This should make setting the birthday in Plasma Phonebook work again. (It last worked when Plasma Phonebook had its own QML wrapper for the Addressee class, which has been dropped since.) See also: https://invent.kde.org/plasma-mobile/plasma-phonebook/-/issues/6#note_307938 M +5 -0 src/addressee.cpp M +2 -1 src/addressee.h https://invent.kde.org/frameworks/kcontacts/commit/8b4ba9c0ed465ded679e626071feebe8aabe481c |