Changeset View
Changeset View
Standalone View
Standalone View
src/contact-editor/editor/personaleditor/personaleditorwidget.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
68 | 68 | | |||
69 | PersonalEditorWidget::~PersonalEditorWidget() | 69 | PersonalEditorWidget::~PersonalEditorWidget() | ||
70 | { | 70 | { | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | void PersonalEditorWidget::loadContact(const KContacts::Addressee &contact) | 73 | void PersonalEditorWidget::loadContact(const KContacts::Addressee &contact) | ||
74 | { | 74 | { | ||
75 | mBirthdateWidget->setDate(contact.birthday().date()); | 75 | mBirthdateWidget->setDate(contact.birthday().date()); | ||
76 | mAnniversaryWidget->setDate(QDate::fromString(ContactEditor::Utils::loadCustom(contact, QStringLiteral("X-Anniversary")), | 76 | mAnniversaryWidget->setDate(contact.anniversary()); | ||
77 | Qt::ISODate)); | 77 | | ||
78 | // family group | 78 | // family group | ||
79 | mPartnerWidget->setText(ContactEditor::Utils::loadCustom(contact, QStringLiteral("X-SpousesName"))); | 79 | mPartnerWidget->setText(contact.spousesName()); | ||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | void PersonalEditorWidget::storeContact(KContacts::Addressee &contact) | 82 | void PersonalEditorWidget::storeContact(KContacts::Addressee &contact) | ||
83 | { | 83 | { | ||
84 | contact.setBirthday(mBirthdateWidget->date()); | 84 | contact.setBirthday(mBirthdateWidget->date()); | ||
85 | ContactEditor::Utils::storeCustom(contact, QStringLiteral("X-Anniversary"), mAnniversaryWidget->date().toString(Qt::ISODate)); | 85 | contact.setAnniversary(mAnniversaryWidget->date()); | ||
86 | 86 | | |||
87 | // family group | 87 | // family group | ||
88 | ContactEditor::Utils::storeCustom(contact, QStringLiteral("X-SpousesName"), mPartnerWidget->text().trimmed()); | 88 | contact.setSpousesName(mPartnerWidget->text().trimmed()); | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | void PersonalEditorWidget::setReadOnly(bool readOnly) | 91 | void PersonalEditorWidget::setReadOnly(bool readOnly) | ||
92 | { | 92 | { | ||
93 | // widgets from dates group | 93 | // widgets from dates group | ||
94 | mBirthdateWidget->setReadOnly(readOnly); | 94 | mBirthdateWidget->setReadOnly(readOnly); | ||
95 | mAnniversaryWidget->setReadOnly(readOnly); | 95 | mAnniversaryWidget->setReadOnly(readOnly); | ||
96 | 96 | | |||
97 | // widgets from family group | 97 | // widgets from family group | ||
98 | mPartnerWidget->setReadOnly(readOnly); | 98 | mPartnerWidget->setReadOnly(readOnly); | ||
99 | } | 99 | } |