4#include "identityeditorbackend.h"
6namespace KIdentityManagementQuick
8IdentityEditorBackend::Mode IdentityEditorBackend::mode()
const
13void IdentityEditorBackend::setMode(Mode mode)
23KIdentityManagementCore::Identity IdentityEditorBackend::identity()
const
28void IdentityEditorBackend::setIdentity(
const KIdentityManagementCore::Identity &identity)
30 if (mIdentity == identity) {
38uint IdentityEditorBackend::identityUoid()
const
40 return mIdentity.uoid();
43void IdentityEditorBackend::setIdentityUoid(uint identityUoid)
45 if (mIdentity.uoid() == identityUoid) {
49 const auto &identity = mIdentityManager->modifyIdentityForUoid(identityUoid);
50 setIdentity(identity);
53void IdentityEditorBackend::saveIdentity(
const KIdentityManagementCore::Identity &modifiedIdentity)
55 mIdentityManager->saveIdentity(modifiedIdentity);
58void IdentityEditorBackend::addEmailAlias(
const QString &alias)
60 auto aliases = mIdentity.emailAliases();
61 aliases.append(alias);
62 mIdentity.setEmailAliases(aliases);
65void IdentityEditorBackend::modifyEmailAlias(
const QString &originalAlias,
const QString &modifiedAlias)
67 auto aliases = mIdentity.emailAliases();
68 std::replace(aliases.begin(), aliases.end(), originalAlias, modifiedAlias);
69 mIdentity.setEmailAliases(aliases);
72void IdentityEditorBackend::removeEmailAlias(
const QString &alias)
74 auto aliases = mIdentity.emailAliases();
75 aliases.removeAll(alias);
76 mIdentity.setEmailAliases(aliases);
80#include "moc_identityeditorbackend.cpp"