diff --git a/core/autotests/mail/data/export/identitiesandconfigandmailtransportandresources/list.txt b/core/autotests/mail/data/export/identitiesandconfigandmailtransportandresources/list.txt index ff2a7b4..bb786d0 100644 --- a/core/autotests/mail/data/export/identitiesandconfigandmailtransportandresources/list.txt +++ b/core/autotests/mail/data/export/identitiesandconfigandmailtransportandresources/list.txt @@ -1,19 +1,20 @@ information/VERSION_2 information/exportdatatype.xml identities/emailidentities configs/akonadi_archivemail_agentrc configs/foldermailarchiverc configs/kabldaprc configs/kmail2rc configs/templatesconfigurationrc transports/mailtransports configs/filters mails/akonadi_mbox_resource_1/agent_config_akonadi_mbox_resource_1 mails/akonadi_mbox_resource_1/akonadi_mbox_resource_1.mbox mails/akonadi_mbox_resource_1/akonadi_mbox_resource_1rc mails/akonadi_mixedmaildir_resource_1/agent_config_akonadi_mixedmaildir_resource_1 mails/akonadi_mixedmaildir_resource_1/akonadi_mixedmaildir_resource_1rc mails/akonadi_mixedmaildir_resource_1/mail.zip mails/akonadi_maildir_resource_1/mail.zip mails/akonadi_maildir_resource_1/agent_config_akonadi_maildir_resource_1 mails/akonadi_maildir_resource_1/akonadi_maildir_resource_1rc +resources/akonadi_pop3_resource_1rc diff --git a/core/autotests/mail/data/export/identitiesandconfigandmailtransportandresources/references/resources/akonadi_pop3_resource_1rc b/core/autotests/mail/data/export/identitiesandconfigandmailtransportandresources/references/resources/akonadi_pop3_resource_1rc new file mode 100644 index 0000000..e69de29 diff --git a/core/autotests/mail/data/export/mailconfigandresource/config/akonadi_pop3_resource_1rc b/core/autotests/mail/data/export/mailconfigandresource/config/akonadi_pop3_resource_1rc new file mode 100644 index 0000000..cd81e09 --- /dev/null +++ b/core/autotests/mail/data/export/mailconfigandresource/config/akonadi_pop3_resource_1rc @@ -0,0 +1,15 @@ +[General] +host=pop3.foo.org +intervalCheckEnabled=true +intervalCheckInterval=24 +leaveOnServer=true +leaveOnServerDays=25 +login=kde%foo.org +name=kde +pipelining=true +targetCollection=3778 +useTLS=true + +[LeaveOnServer] +seenUidList=1589466101.18581.mail175.ha.foo.net\\,S=6906,1589466102.10772.mail114.ha.foo.net\\ +seenUidTimeList=1589467684,1589467684 diff --git a/core/autotests/mail/data/export/mailconfigandresource/list.txt b/core/autotests/mail/data/export/mailconfigandresource/list.txt index 36aa710..83fda4f 100644 --- a/core/autotests/mail/data/export/mailconfigandresource/list.txt +++ b/core/autotests/mail/data/export/mailconfigandresource/list.txt @@ -1,6 +1,7 @@ configs/kmail2rc information/VERSION_2 information/exportdatatype.xml configs/foldermailarchiverc configs/templatesconfigurationrc configs/filters +resources/akonadi_pop3_resource_1rc diff --git a/core/autotests/mail/data/export/mailconfigandresource/references/resources/akonadi_pop3_resource_1rc b/core/autotests/mail/data/export/mailconfigandresource/references/resources/akonadi_pop3_resource_1rc new file mode 100644 index 0000000..3785ddb --- /dev/null +++ b/core/autotests/mail/data/export/mailconfigandresource/references/resources/akonadi_pop3_resource_1rc @@ -0,0 +1,15 @@ +[General] +host=pop3.foo.org +intervalCheckEnabled=true +intervalCheckInterval=24 +leaveOnServer=true +leaveOnServerDays=25 +login=kde%foo.org +name=kde +pipelining=true +targetCollection=foo/bla bla/bli3778 +useTLS=true + +[LeaveOnServer] +seenUidList=1589466101.18581.mail175.ha.foo.net\\,S=6906,1589466102.10772.mail114.ha.foo.net\\ +seenUidTimeList=1589467684,1589467684 diff --git a/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/archive.zip b/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/archive.zip index 2dae4ab..c408cd8 100644 Binary files a/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/archive.zip and b/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/archive.zip differ diff --git a/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/list.txt b/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/list.txt index 3c9ee52..f19b314 100644 --- a/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/list.txt +++ b/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/list.txt @@ -1,19 +1,20 @@ configs/akonadi_archivemail_agentrc configs/filters configs/foldermailarchiverc configs/kabldaprc configs/kmail2rc configs/templatesconfigurationrc identities/emailidentities information/VERSION_2 information/exportdatatype.xml mails/akonadi_maildir_resource_1/agent_config_akonadi_maildir_resource_1 mails/akonadi_maildir_resource_1/akonadi_maildir_resource_1rc mails/akonadi_maildir_resource_1/mail.zip mails/akonadi_mbox_resource_1/agent_config_akonadi_mbox_resource_1 mails/akonadi_mbox_resource_1/akonadi_mbox_resource_1.mbox mails/akonadi_mbox_resource_1/akonadi_mbox_resource_1rc mails/akonadi_mixedmaildir_resource_1/agent_config_akonadi_mixedmaildir_resource_1 mails/akonadi_mixedmaildir_resource_1/akonadi_mixedmaildir_resource_1rc mails/akonadi_mixedmaildir_resource_1/mail.zip transports/mailtransports +resources/akonadi_pop3_resource_1rc diff --git a/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/references/loggingfile.txt b/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/references/loggingfile.txt index 0b1e617..e25b942 100644 --- a/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/references/loggingfile.txt +++ b/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/references/loggingfile.txt @@ -1,32 +1,36 @@ akonadi_mixedmaildir_resource Local Folders Path /tmp/backupmail//0/ TopLevelIsContainer true 0 -------------------------- akonadi_mbox_resource mbox1 Path /tmp/backupmail//akonadi_mbox_resource_1.mbox 0 -------------------------- akonadi_maildir_resource maildir 1 Path /tmp/backupmail//1/ TopLevelIsContainer true 0 -------------------------- akonadi_mixedmaildir_resource_new_resource_0 akonadi_maildir_resource_new_resource_2 -------------------------- +akonadi_pop3_resource +akonadi_pop3_resource_1rc +0 +-------------------------- Special Collection : 3 colId 3734 -------------------------- Special Collection : 5 colId 3730 -------------------------- Special Collection : 6 colId 3735 -------------------------- Special Collection : 3 colId 3734 -------------------------- Special Collection : 5 colId 3730 -------------------------- Special Collection : 6 colId 3735 -------------------------- diff --git a/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/references/resources/akonadi_pop3_resource_1rc b/core/autotests/mail/data/import/identitiesandconfigandmailtransportandresources/references/resources/akonadi_pop3_resource_1rc new file mode 100644 index 0000000..e69de29 diff --git a/core/autotests/mail/exportmailjobinterfacetest.cpp b/core/autotests/mail/exportmailjobinterfacetest.cpp index 0a47f90..5a23713 100644 --- a/core/autotests/mail/exportmailjobinterfacetest.cpp +++ b/core/autotests/mail/exportmailjobinterfacetest.cpp @@ -1,88 +1,95 @@ /* Copyright (C) 2020 Laurent Montel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "exportmailjobinterfacetest.h" #include "exportmailjobinterfacetestimpl.h" #include "archivestorage.h" #include "testexportfile.h" #include #include QTEST_MAIN(ExportMailJobInterfaceTest) ExportMailJobInterfaceTest::ExportMailJobInterfaceTest(QObject *parent) : QObject(parent) { } void ExportMailJobInterfaceTest::exportMail_data() { QTest::addColumn("configpath"); QTest::addColumn("options"); const QByteArray pathConfig(QByteArray(PIMDATAEXPORTER_DIR) + "/export/"); Utils::StoredTypes options = {Utils::StoredType::Config}; QTest::newRow("mailonlyconfig") << pathConfig + QByteArray("mailonlyconfig/") << options; options = {Utils::StoredType::Config|Utils::StoredType::Resources}; QTest::newRow("mailconfigandresource") << pathConfig + QByteArray("mailconfigandresource/") << options; options = {Utils::StoredType::MailTransport}; QTest::newRow("mailtransport") << pathConfig + QByteArray("mailtransport/") << options; options = {Utils::StoredType::Identity}; QTest::newRow("identities") << pathConfig + QByteArray("identities/") << options; options = {Utils::StoredType::Identity|Utils::StoredType::Config}; QTest::newRow("identitiesandconfig") << pathConfig + QByteArray("identitiesandconfig/") << options; options = {Utils::StoredType::Config|Utils::StoredType::Identity|Utils::StoredType::MailTransport}; QTest::newRow("identitiesandconfigandmailtransport") << pathConfig + QByteArray("identitiesandconfigandmailtransport/") << options; options = {Utils::StoredType::Config|Utils::StoredType::Identity|Utils::StoredType::MailTransport|Utils::StoredType::Resources|Utils::StoredType::Mails}; QTest::newRow("identitiesandconfigandmailtransportandresources") << pathConfig + QByteArray("identitiesandconfigandmailtransportandresources/") << options; } void ExportMailJobInterfaceTest::exportMail() { QFETCH(QByteArray, configpath); QFETCH(Utils::StoredTypes, options); TestExportFile *file = new TestExportFile(this); file->setPathConfig(configpath); QVector lstInfo; Utils::AkonadiInstanceInfo info; info.identifier = QLatin1String("akonadi_mbox_resource_1"); info.mimeTypes = QStringList() << KMime::Message::mimeType(); info.capabilities = QStringList() << QLatin1String("Resource"); lstInfo << info; info.identifier = QLatin1String("akonadi_maildir_resource_1"); info.mimeTypes = QStringList() << KMime::Message::mimeType(); info.capabilities = QStringList() << QLatin1String("Resource"); lstInfo << info; info.identifier = QLatin1String("akonadi_mixedmaildir_resource_1"); info.mimeTypes = QStringList() << KMime::Message::mimeType(); info.capabilities = QStringList() << QLatin1String("Resource"); lstInfo << info; + + //Pop3 support + info.identifier = QLatin1String("akonadi_pop3_resource_1"); + info.mimeTypes = QStringList() << KMime::Message::mimeType(); + info.capabilities = QStringList() << QLatin1String("Resource"); + lstInfo << info; + //TODO add kolab and other //Add extra resource. info.identifier = QStringLiteral("akonadi_kalarm_dir_resource_2"); lstInfo << info; ExportMailJobInterfaceTestImpl *exportMail = new ExportMailJobInterfaceTestImpl(this, options, file->archiveStorage(), 1); exportMail->setListOfResource(lstInfo); exportMail->setPathConfig(QLatin1String(configpath)); file->setAbstractImportExportJob(exportMail); file->start(); delete exportMail; } diff --git a/core/autotests/mail/exportmailjobinterfacetestimpl.cpp b/core/autotests/mail/exportmailjobinterfacetestimpl.cpp index e61be69..0cb74fd 100644 --- a/core/autotests/mail/exportmailjobinterfacetestimpl.cpp +++ b/core/autotests/mail/exportmailjobinterfacetestimpl.cpp @@ -1,144 +1,145 @@ /* Copyright (C) 2020 Laurent Montel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "exportmailjobinterfacetestimpl.h" #include "archivestorage.h" #include "resourceconvertertest.h" #include "saveresourceconfigtest.h" #include "testbackupresourcefilejob.h" #include ExportMailJobInterfaceTestImpl::ExportMailJobInterfaceTestImpl(QObject *parent, Utils::StoredTypes typeSelected, ArchiveStorage *archiveStorage, int numberOfStep) : ExportMailJobInterface(parent, typeSelected, archiveStorage, numberOfStep) { } ExportMailJobInterfaceTestImpl::~ExportMailJobInterfaceTestImpl() { } void ExportMailJobInterfaceTestImpl::convertCollectionToRealPath(KConfigGroup &group, const QString ¤tKey) { ResourceConverterTest resourceConverter; resourceConverter.setTestPath(mPathConfig); resourceConverter.convertCollectionToRealPath(group, currentKey); } void ExportMailJobInterfaceTestImpl::convertCollectionListToRealPath(KConfigGroup &group, const QString ¤tKey) { ResourceConverterTest resourceConverter; resourceConverter.setTestPath(mPathConfig); resourceConverter.convertCollectionListToRealPath(group, currentKey); } void ExportMailJobInterfaceTestImpl::convertCollectionIdsToRealPath(KConfigGroup &group, const QString ¤tKey, const QString &prefixCollection) { ResourceConverterTest resourceConverter; resourceConverter.setTestPath(mPathConfig); resourceConverter.convertCollectionIdsToRealPath(group, currentKey, prefixCollection); } Akonadi::Collection::Id ExportMailJobInterfaceTestImpl::convertFolderPathToCollectionId(const QString &path) { ResourceConverterTest resourceConverterTest; resourceConverterTest.setTestPath(mPathConfig); return resourceConverterTest.convertFolderPathToCollectionId(path); } QVector ExportMailJobInterfaceTestImpl::filters() { return {}; } void ExportMailJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier) { //qDebug() << " void ExportMailJobInterfaceTestImpl::exportResourceToArchive(const QString &archivePath, const QString &url, const QString &identifier)" << identifier; SaveResourceConfigTest saveResourceConfig; saveResourceConfig.setArchive(mArchiveStorage->archive()); saveResourceConfig.exportResourceToArchive(archivePath, url, identifier, Utils::resourceMailArchiveName(), { QLatin1String("akonadi_maildir_resource_"), QLatin1String("akonadi_mixedmaildir_resource_")}); slotMailsJobTerminated(); } QVector ExportMailJobInterfaceTestImpl::listOfResource() { return mListAkonadiInstanceInfo; } QString ExportMailJobInterfaceTestImpl::storeResources(KZip *archive, const QString &identifier, const QString &path) { ResourceConverterTest converter; + converter.setTestPath(mPathConfig); return converter.storeResources(archive, identifier, path); } QString ExportMailJobInterfaceTestImpl::convertToFullCollectionPath(const qlonglong collectionValue) { ResourceConverterTest converter; converter.setTestPath(mPathConfig); return converter.convertToFullCollectionPath(collectionValue); } QString ExportMailJobInterfaceTestImpl::resourcePath(const QString &identifier) const { ResourceConverterTest converter; converter.setTestPath(mPathConfig); const QString url = converter.resourcePath(identifier); return url; } void ExportMailJobInterfaceTestImpl::backupMailResourceFile(const QString &agentIdentifier, const QString &defaultPath) { TestBackupResourceFileJob *job = new TestBackupResourceFileJob(this); job->setDefaultPath(defaultPath); job->setIdentifier(agentIdentifier); job->setTestPath(mPathConfig); job->setZip(archive()); connect(job, &TestBackupResourceFileJob::error, this, &ExportMailJobInterfaceTestImpl::error); connect(job, &TestBackupResourceFileJob::info, this, &ExportMailJobInterfaceTestImpl::info); job->start(); } QString ExportMailJobInterfaceTestImpl::adaptNewResourceUrl(bool overwriteResources, const KSharedConfig::Ptr &resourceConfig, const QString &storePath) { ResourceConverterTest resourceConverterTest; resourceConverterTest.setTestPath(mPathConfig); return resourceConverterTest.adaptNewResourceUrl(overwriteResources, resourceConfig, storePath); } QString ExportMailJobInterfaceTestImpl::createResource(const QString &resources, const QString &name, const QMap &settings, bool synchronizeTree) { Q_UNREACHABLE(); return {}; } QVector ExportMailJobInterfaceTestImpl::listIdentityUoid() const { return {10, 11, 12, 13, 14}; } void ExportMailJobInterfaceTestImpl::exportFilters() { const QString filename = mPathConfig + QLatin1String("filters"); const bool fileAdded = archive()->addLocalFile(filename, Utils::configsPath() + QStringLiteral("filters")); if (fileAdded) { Q_EMIT info(QStringLiteral("Filters backup done.")); } else { Q_EMIT error(QStringLiteral("Filters cannot be exported.")); } } diff --git a/core/resourceconverterbase.cpp b/core/resourceconverterbase.cpp index 7e7f9de..d4b7e03 100644 --- a/core/resourceconverterbase.cpp +++ b/core/resourceconverterbase.cpp @@ -1,221 +1,221 @@ /* Copyright (C) 2020 Laurent Montel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "resourceconverterbase.h" #include "utils.h" #include #include #include #include #include #include #include ResourceConverterBase::ResourceConverterBase() { } ResourceConverterBase::~ResourceConverterBase() { } QString ResourceConverterBase::adaptResourcePath(const KSharedConfigPtr &resourceConfig, const QString &storedData) { QString newUrl = ResourceConverterBase::resourcePath(resourceConfig); if (!newUrl.contains(installDefaultDirectory())) { QFileInfo fileInfo(newUrl); fileInfo.fileName(); //qCDebug(PIMDATAEXPORTERCORE_LOG)<<" url "<group(QStringLiteral("General")); QString url = group.readEntry(QStringLiteral("Path"), defaultPath); if (!url.isEmpty()) { url.replace(QLatin1String("$HOME"), QDir::homePath()); } url = changeResourcePath(url); return url; } QString ResourceConverterBase::resourcePath(const QString &agentIdentifier, const QString &defaultPath) { const QString agentFileName = agentIdentifier + QStringLiteral("rc"); const QString configFileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + agentFileName; //qDebug() << "configFileName " << configFileName; KSharedConfigPtr resourceConfig = KSharedConfig::openConfig(configFileName); const QString url = resourcePath(resourceConfig, defaultPath); //qDebug() << " resourcePath " << url; return url; } QString ResourceConverterBase::changeResourcePath(QString url) const { return url; } //Merge two methods I think void ResourceConverterBase::convertCollectionIdsToRealPath(KConfigGroup &group, const QString ¤tKey, const QString &prefixCollection) { if (group.hasKey(currentKey)) { const QStringList value = group.readEntry(currentKey, QStringList()); QStringList newValue; for (QString str : value) { bool found = false; if (!prefixCollection.isEmpty() && str.startsWith(prefixCollection)) { str.remove(0, prefixCollection.length()); } const qlonglong collectionId = str.toLongLong(&found); if (found) { const QString realPath = convertToFullCollectionPath(collectionId); if (!realPath.isEmpty()) { newValue << realPath; } } } if (newValue.isEmpty()) { group.deleteEntry(currentKey); } else { group.writeEntry(currentKey, newValue); } } } void ResourceConverterBase::convertCollectionListToRealPath(KConfigGroup &group, const QString ¤tKey) { if (group.hasKey(currentKey)) { const QStringList listExpension = group.readEntry(currentKey, QStringList()); if (listExpension.isEmpty()) { group.deleteEntry(currentKey); } else { QStringList result; for (QString collection : listExpension) { collection.remove(QLatin1Char('c')); bool found = false; const qlonglong collectionValue = collection.toLongLong(&found); if (found && collectionValue != -1) { const QString realPath = convertToFullCollectionPath(collectionValue); if (!realPath.isEmpty()) { result << realPath; } } } if (result.isEmpty()) { group.deleteEntry(currentKey); } else { group.writeEntry(currentKey, result); } } } } void ResourceConverterBase::convertCollectionToRealPath(KConfigGroup &group, const QString ¤tKey) { if (group.hasKey(currentKey)) { QString collectionId = group.readEntry(currentKey); if (collectionId.isEmpty()) { group.deleteEntry(currentKey); } else { collectionId.remove(QLatin1Char('c')); bool found = false; const qlonglong collectionValue = collectionId.toLongLong(&found); if (found && collectionValue != -1) { const QString realPath = convertToFullCollectionPath(collectionValue); group.writeEntry(currentKey, realPath); } else { group.deleteEntry(currentKey); } } } } QString ResourceConverterBase::agentFileName(const QString &filename) { QString agentFileConfigName = filename; agentFileConfigName.remove(Utils::resourcesPath()); agentFileConfigName.remove(agentFileConfigName.length() - 2, 2); //Remove "rc" agentFileConfigName = Utils::resourcesPath() + Utils::prefixAkonadiConfigFile() + agentFileConfigName; return agentFileConfigName; } QString ResourceConverterBase::storeResources(KZip *archive, const QString &identifier, const QString &path) { const QString agentFileName = identifier + QStringLiteral("rc"); const QString configFileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + agentFileName; - qCDebug(PIMDATAEXPORTERCORE_LOG) << "configFileName " << configFileName << "agentFileName " << configFileName; + qCWarning(PIMDATAEXPORTERCORE_LOG) << "configFileName " << configFileName << "agentFileName " << configFileName; KSharedConfigPtr resourceConfig = KSharedConfig::openConfig(configFileName); QTemporaryFile tmp; tmp.open(); KConfig *config = resourceConfig->copyTo(tmp.fileName()); if (identifier.contains(POP3_RESOURCE_IDENTIFIER)) { const QString targetCollection = QStringLiteral("targetCollection"); KConfigGroup group = config->group("General"); if (group.hasKey(targetCollection)) { group.writeEntry(targetCollection, convertToFullCollectionPath(group.readEntry(targetCollection).toLongLong())); } } else if (PimCommon::Util::isImapResource(identifier)) { const QString trash = QStringLiteral("TrashCollection"); KConfigGroup group = config->group("cache"); if (group.hasKey(trash)) { group.writeEntry(trash, convertToFullCollectionPath(group.readEntry(trash).toLongLong())); } } //Customize resource if necessary here. config->sync(); bool fileAdded = archive->addLocalFile(tmp.fileName(), path + agentFileName); delete config; if (!fileAdded) { return i18n("Resource file \"%1\" cannot be added to backup file.", agentFileName); } const QString agentConfigFileName = Utils::prefixAkonadiConfigFile() + identifier; const QString agentConfigFileNamePath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1String("/akonadi/") + agentConfigFileName; if (QFileInfo::exists(agentConfigFileNamePath)) { fileAdded = archive->addLocalFile(agentConfigFileNamePath, path + agentConfigFileName); if (!fileAdded) { return i18n("Resource file \"%1\" cannot be added to backup file.", agentFileName); } } return QString(); }