akonadi
22 #include "freebusyeditwidget.h"
24 #include <QHBoxLayout>
26 #include <kabc/addressee.h>
27 #include <kcalcore/freebusyurlstore.h>
28 #include <kurlrequester.h>
30 FreeBusyEditWidget::FreeBusyEditWidget( QWidget *parent )
31 : QWidget( parent ), mReadOnly( false )
33 QHBoxLayout *layout =
new QHBoxLayout(
this );
34 layout->setMargin( 0 );
36 mURL =
new KUrlRequester;
37 layout->addWidget( mURL );
38 setFocusProxy( mURL );
39 setFocusPolicy( Qt::StrongFocus );
42 FreeBusyEditWidget::~FreeBusyEditWidget()
46 void FreeBusyEditWidget::loadContact(
const KABC::Addressee &contact )
48 if ( contact.preferredEmail().isEmpty() ) {
52 mURL->setUrl( QUrl(KCalCore::FreeBusyUrlStore::self()->readUrl( contact.preferredEmail() ) ) );
55 void FreeBusyEditWidget::storeContact( KABC::Addressee &contact )
const
57 if ( contact.preferredEmail().isEmpty() ) {
61 KCalCore::FreeBusyUrlStore::self()->writeUrl( contact.preferredEmail(), mURL->url().url() );
62 KCalCore::FreeBusyUrlStore::self()->sync();
65 void FreeBusyEditWidget::setReadOnly(
bool readOnly )
67 mURL->setEnabled( !readOnly );
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.