4#include "identityeditorbackend.h"
6using namespace KIdentityManagementQuick;
7IdentityEditorBackend::Mode IdentityEditorBackend::mode()
const
12void IdentityEditorBackend::setMode(Mode mode)
22KIdentityManagementCore::Identity IdentityEditorBackend::identity()
const
27void IdentityEditorBackend::setIdentity(
const KIdentityManagementCore::Identity &identity)
29 if (mIdentity == identity) {
37uint IdentityEditorBackend::identityUoid()
const
39 return mIdentity.uoid();
42void IdentityEditorBackend::setIdentityUoid(uint identityUoid)
44 if (mIdentity.uoid() == identityUoid) {
48 const auto &identity = mIdentityManager->modifyIdentityForUoid(identityUoid);
49 setIdentity(identity);
52void IdentityEditorBackend::saveIdentity(
const KIdentityManagementCore::Identity &modifiedIdentity)
54 mIdentityManager->saveIdentity(modifiedIdentity);
57void IdentityEditorBackend::addEmailAlias(
const QString &alias)
59 auto aliases = mIdentity.emailAliases();
60 aliases.append(alias);
61 mIdentity.setEmailAliases(aliases);
64void IdentityEditorBackend::modifyEmailAlias(
const QString &originalAlias,
const QString &modifiedAlias)
66 auto aliases = mIdentity.emailAliases();
67 std::replace(aliases.begin(), aliases.end(), originalAlias, modifiedAlias);
68 mIdentity.setEmailAliases(aliases);
71void IdentityEditorBackend::removeEmailAlias(
const QString &alias)
73 auto aliases = mIdentity.emailAliases();
74 aliases.removeAll(alias);
75 mIdentity.setEmailAliases(aliases);
78#include "moc_identityeditorbackend.cpp"