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 );
40 FreeBusyEditWidget::~FreeBusyEditWidget()
44 void FreeBusyEditWidget::loadContact(
const KABC::Addressee &contact )
46 if ( contact.preferredEmail().isEmpty() ) {
50 mURL->setUrl( QUrl(KCalCore::FreeBusyUrlStore::self()->readUrl( contact.preferredEmail() ) ) );
53 void FreeBusyEditWidget::storeContact( KABC::Addressee &contact )
const
55 if ( contact.preferredEmail().isEmpty() ) {
59 KCalCore::FreeBusyUrlStore::self()->writeUrl( contact.preferredEmail(), mURL->url().url() );
60 KCalCore::FreeBusyUrlStore::self()->sync();
63 void FreeBusyEditWidget::setReadOnly(
bool readOnly )
65 mURL->setEnabled( !readOnly );
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:17 by
doxygen 1.8.5 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.