akonadi/contact
22#include "secrecyeditwidget.h"
26#include <kabc/addressee.h>
27#include <kabc/secrecy.h>
30SecrecyEditWidget::SecrecyEditWidget(QWidget *parent)
33 QVBoxLayout *layout =
new QVBoxLayout(
this);
36 mSecrecyCombo =
new KComboBox(
this);
37 layout->addWidget(mSecrecyCombo);
39 const KABC::Secrecy::TypeList list = KABC::Secrecy::typeList();
40 KABC::Secrecy::TypeList::ConstIterator it;
43 KABC::Secrecy::TypeList::ConstIterator end(list.constEnd());
44 for (it = list.constBegin(); it != end; ++it) {
45 mSecrecyCombo->insertItem(*it, KABC::Secrecy::typeLabel(*it));
49SecrecyEditWidget::~SecrecyEditWidget()
53void SecrecyEditWidget::setReadOnly(
bool readOnly)
55 mSecrecyCombo->setEnabled(!readOnly);
58void SecrecyEditWidget::loadContact(
const KABC::Addressee &contact)
60 if (contact.secrecy().type() != KABC::Secrecy::Invalid) {
61 mSecrecyCombo->setCurrentIndex(contact.secrecy().type());
65void SecrecyEditWidget::storeContact(KABC::Addressee &contact)
const
67 KABC::Secrecy secrecy;
68 secrecy.setType((KABC::Secrecy::Type)mSecrecyCombo->currentIndex());
70 contact.setSecrecy(secrecy);
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by
doxygen 1.9.5 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.