11#include <config-libkleo.h>
17#include <gpgme++/key.h>
22class KeyGroup::Private
25 explicit Private(
const Id &
id,
const QString &name,
const std::vector<Key> &keys, Source source);
31 bool isImmutable =
true;
34KeyGroup::Private::Private(
const Id &
id,
const QString &name,
const std::vector<Key> &keys, Source source)
37 , keys(keys.cbegin(), keys.cend())
47KeyGroup::~KeyGroup() =
default;
49KeyGroup::KeyGroup(
const Id &
id,
const QString &name,
const std::vector<Key> &keys, Source source)
50 : d(new Private(id, name, keys, source))
54KeyGroup::KeyGroup(
const KeyGroup &other)
55 : d(new Private(*other.d))
59KeyGroup &KeyGroup::operator=(
const KeyGroup &other)
65KeyGroup::KeyGroup(KeyGroup &&other) =
default;
67KeyGroup &KeyGroup::operator=(KeyGroup &&other) =
default;
69bool KeyGroup::isNull()
const
71 return !d || d->id.isEmpty();
79void KeyGroup::setName(
const QString &name)
91void KeyGroup::setKeys(
const KeyGroup::Keys &keys)
98void KeyGroup::setKeys(
const std::vector<GpgME::Key> &keys)
101 d->keys = Keys(keys.cbegin(), keys.cend());
105const KeyGroup::Keys &KeyGroup::keys()
const
107 static const Keys empty;
108 return d ? d->keys : empty;
111KeyGroup::Source KeyGroup::source()
const
113 return d ? d->source : UnknownSource;
116void KeyGroup::setIsImmutable(
bool isImmutable)
119 d->isImmutable = isImmutable;
123bool KeyGroup::isImmutable()
const
125 return d ? d->isImmutable :
true;
128bool KeyGroup::insert(
const GpgME::Key &key)
130 if (!d || key.isNull()) {
133 return d->keys.insert(key).second;
136bool KeyGroup::erase(
const GpgME::Key &key)
138 if (!d || key.isNull()) {
141 return d->keys.erase(key) > 0;
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:01 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.