Commit 792b4d44 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix mail autotest

parent 3d4f22d9
......@@ -137,6 +137,12 @@ QString ExportMailJobInterfaceTestImpl::createResource(const QString &resources,
return {};
}
QVector<uint> ExportMailJobInterfaceTestImpl::listIdentityUoid() const
{
//TODO
return {};
}
ExportMailJobInterfaceTest::ExportMailJobInterfaceTest(QObject *parent)
: QObject(parent)
{
......@@ -183,3 +189,5 @@ void ExportMailJobInterfaceTest::exportMail()
file->start();
delete exportNote;
}
......@@ -50,6 +50,7 @@ protected:
void backupMailResourceFile(const QString &agentIdentifier, const QString &defaultPath) override;
Q_REQUIRED_RESULT QString adaptNewResourceUrl(bool overwriteResources, const KSharedConfig::Ptr &resourceConfig, const QString &storePath) override;
Q_REQUIRED_RESULT QString createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings, bool synchronizeTree) override;
Q_REQUIRED_RESULT QVector<uint> listIdentityUoid() const override;
void exportFilters() override;
};
......
......@@ -470,9 +470,8 @@ void ExportMailJobInterface::backupConfig()
}
//Automatic Add Contacts
KIdentityManagement::IdentityManager::ConstIterator end = mIdentityManager->end();
for (KIdentityManagement::IdentityManager::ConstIterator it = mIdentityManager->begin(); it != end; ++it) {
const uint identity = (*it).uoid();
const QVector<uint> listIdentities = listIdentityUoid();
for (uint identity : listIdentities) {
const QString groupId = QStringLiteral("Automatic Add Contacts %1").arg(identity);
if (kmailConfig->hasGroup(groupId)) {
KConfigGroup identityGroup = kmailConfig->group(groupId);
......
......@@ -58,6 +58,7 @@ protected:
virtual Q_REQUIRED_RESULT QString resourcePath(const QString &identifier) const = 0;
virtual void backupMailResourceFile(const QString &agentIdentifier, const QString &defaultPath) = 0;
virtual void exportFilters() = 0;
virtual Q_REQUIRED_RESULT QVector<uint> listIdentityUoid() const = 0;
private:
void slotCheckBackupIdentity();
void slotCheckBackupMailTransport();
......
......@@ -159,3 +159,14 @@ void ExportMailJobInterfaceImpl::exportFilters()
}
}
}
QVector<uint> ExportMailJobInterfaceImpl::listIdentityUoid() const
{
QVector<uint> listUiod;
KIdentityManagement::IdentityManager::ConstIterator end = mIdentityManager->end();
for (KIdentityManagement::IdentityManager::ConstIterator it = mIdentityManager->begin(); it != end; ++it) {
const uint identityUoid = (*it).uoid();
listUiod << identityUoid;
}
return listUiod;
}
......@@ -49,6 +49,7 @@ protected:
Q_REQUIRED_RESULT QString adaptNewResourceUrl(bool overwriteResources, const KSharedConfig::Ptr &resourceConfig, const QString &storePath) override;
Q_REQUIRED_RESULT QString createResource(const QString &resources, const QString &name, const QMap<QString, QVariant> &settings, bool synchronizeTree) override;
void exportFilters() override;
Q_REQUIRED_RESULT QVector<uint> listIdentityUoid() const override;
};
#endif // ExportMailJob_H
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