akonadi
22 #include "freebusyeditwidget.h"
24 #include <QHBoxLayout>
26 #include <kabc/addressee.h>
27 #include <kcalcore/freebusyurlstore.h>
28 #include <kurlrequester.h>
31 FreeBusyEditWidget::FreeBusyEditWidget(
QWidget *parent)
38 mURL =
new KUrlRequester;
39 mURL->lineEdit()->setTrapReturnKey(
true);
42 setFocusPolicy(Qt::StrongFocus);
45 FreeBusyEditWidget::~FreeBusyEditWidget()
49 void FreeBusyEditWidget::loadContact(
const KABC::Addressee &contact)
51 if (contact.preferredEmail().isEmpty()) {
55 mURL->setUrl(
QUrl(KCalCore::FreeBusyUrlStore::self()->readUrl(contact.preferredEmail())));
58 void FreeBusyEditWidget::storeContact(KABC::Addressee &contact)
const
60 if (contact.preferredEmail().isEmpty()) {
64 KCalCore::FreeBusyUrlStore::self()->writeUrl(contact.preferredEmail(), mURL->url().url());
65 KCalCore::FreeBusyUrlStore::self()->sync();
68 void FreeBusyEditWidget::setReadOnly(
bool readOnly)
70 mURL->setEnabled(!readOnly);
void setMargin(int margin)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.