Commit 0f3bbe64 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Implement import identity

parent 37f1ffec
Pipeline #21509 failed with stage
in 18 seconds
[General]
Default Identity=2
[Identity #0]
Attach Vcard=false
Autocorrection Language=fr_FR
Bcc=dd@foo.com
Default Domain=9td
Dictionary=français (France)
Disable Fcc=false
Drafts=3730
Email Address=dd@foo.com
Email Aliases=dde@foo.com
Fcc=3734
Identity=Kolab
Image Location=
Inline Signature=OpenGL Experts\n
Inlined Html=false
Name=Bla Bli
Pgp Auto Encrypt=false
Pgp Auto Sign=false
Preferred Crypto Message Format=s/mime
SMIME Encryption Key=E225DBF44009243D1F177F552D5397C
SMIME Signing Key=9243D1F177F552D5397C
Signature Enabled=true
Signature Type=inline
Templates=3735
Transport=1960518839
X-FaceEnabled=true
uoid=1
[Identity #1]
Attach Vcard=false
Autocorrection Language=fr_FR
Bcc=foo@kde.org
Default Domain=zym0
Dictionary=American English (United States)
Disable Fcc=false
Drafts=3730
Email Address=foo@kde.org
Email Aliases=
Fcc=3734
Identity=Default
Image Location=
Inline Signature=olutions\s
Inlined Html=false
Name=kd
Organization=kde
PGP Encryption Key=CDF87D8A5BAA692D34B30D1065D31
PGP Signing Key=F87D8A5BAA692D34B30D1065D31
Pgp Auto Encrypt=false
Pgp Auto Sign=false
Preferred Crypto Message Format=openpgp/mime
Reply-To Address=foo@kde.org
Signature Enabled=true
Signature Type=inline
Templates=3735
Transport=1701481874
X-FaceEnabled=false
uoid=2
......@@ -88,26 +88,29 @@ QString ImportMailJobInterfaceTestImpl::adaptNewResourceUrl(bool overwriteResour
void ImportMailJobInterfaceTestImpl::addNewIdentity(const QString &name, KConfigGroup &group, int defaultIdentities, int oldUid)
{
//qDebug() << " void ImportMailJobInterfaceTestImpl::addNewIdentity(const QString &name, KConfigGroup &group, int defaultIdentities, int oldUid) not implemented yet" << oldUid << " name " << name;
const QString uniqueName = uniqueIdentityName(name);
qDebug() << " void ImportMailJobInterfaceTestImpl::addNewIdentity(const QString &name, KConfigGroup &group, int defaultIdentities, int oldUid) not implemented yet" << oldUid << " name " << name;
KIdentityManagement::Identity identity;
identity.setUoid(mIdentityUoid++);
uint value = mIdentityUoid;
mIdentityUoid++;
identity.setUoid(value);
group.writeEntry(QStringLiteral("Name"), uniqueName);
group.sync();
//TODO ????
KConfig config(QStringLiteral("/tmp/identities//identities/emailidentities"));
identity.readConfig(group);
if (oldUid != -1) {
mHashIdentity.insert(oldUid, identity.uoid());
if (oldUid == defaultIdentities) {
//TODO
//mIdentityManager->setAsDefault(identity->uoid());
KConfigGroup grpGeneral = config.group(QStringLiteral("General"));
grpGeneral.writeEntry("Default Identity", identity.uoid());
}
}
// identity.writeConfig();
//TODO write identity ?
//TODO log it.
//mIdentityManager->commit();
KConfigGroup grp = config.group(QStringLiteral("Identity #%1").arg(value-1));
identity.writeConfig(grp);
}
QString ImportMailJobInterfaceTestImpl::uniqueIdentityName(const QString &name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment