[frameworks-kcontacts] [Bug 446665] New: Cannot set Addressee birthday from QML (e.g., from plasma-phonebook)

Kevin Kofler bugzilla_noreply at kde.org
Wed Dec 8 04:55:37 GMT 2021


https://bugs.kde.org/show_bug.cgi?id=446665

            Bug ID: 446665
           Summary: Cannot set Addressee birthday from QML (e.g., from
                    plasma-phonebook)
           Product: frameworks-kcontacts
           Version: git
          Platform: Other
               URL: https://invent.kde.org/plasma-mobile/plasma-phonebook/
                    -/issues/6
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kdepim-bugs at kde.org
          Reporter: kevin.kofler at chello.at
  Target Milestone: ---

As can be seen in:
https://invent.kde.org/frameworks/kcontacts/-/blob/c0bd98e873075d57eed2555f9f4126ba660dc59a/src/addressee.h#L85
the birthday property in Addressee is not writable, and neither is there a
scriptable explicit setter.

This is the root cause of this plasma-phonebook regression:
https://invent.kde.org/plasma-mobile/plasma-phonebook/-/issues/6#note_307938

As the comment in addressee.h says, the issue that makes this not
straightforward is the withTime argument. I think the best that can be done is
something like:

Q_PROPERTY(QDateTime birthday READ birthday WRITE setBirthdayProperty)

void setBirthdayProperty(const QDateTime &birthday) {
  setBirthday(birthday, birthday.time().msecsSinceStartOfDay() != 0);
}

(which will treat an explicit time of midnight the same as no time, but at
least it should do the right thing in the context of the Phonebook application
where we do not allow setting a time to begin with, and even with a time, it
will do the right thing in most cases).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Kdepim-bugs mailing list