Commit ad4af671 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Convert id

parent c424acfc
Pipeline #95732 failed with stage
in 2 minutes and 20 seconds
...@@ -1022,28 +1022,22 @@ void ImportMailJobInterface::copyMailArchiveConfig(const KSharedConfig::Ptr &arc ...@@ -1022,28 +1022,22 @@ void ImportMailJobInterface::copyMailArchiveConfig(const KSharedConfig::Ptr &arc
void ImportMailJobInterface::copyUnifiedMailBoxConfig(const KSharedConfig::Ptr &archiveConfigOrigin, const KSharedConfig::Ptr &archiveConfigDestination) void ImportMailJobInterface::copyUnifiedMailBoxConfig(const KSharedConfig::Ptr &archiveConfigOrigin, const KSharedConfig::Ptr &archiveConfigDestination)
{ {
#if 0 auto group = archiveConfigOrigin->group("UnifiedMailboxes");
const QString archiveGroupPattern = QStringLiteral("FolderArchiveAccount "); auto groupCopy = archiveConfigDestination->group("UnifiedMailboxes");
const QStringList archiveList = archiveConfigOrigin->groupList().filter(archiveGroupPattern); const auto boxGroups = group.groupList();
for (const QString &str : archiveList) { for (const auto &str : boxGroups) {
const QString resourcename = str.right(str.length() - archiveGroupPattern.length()); KConfigGroup oldGroup = group.group(str);
if (!resourcename.isEmpty()) { const Akonadi::Collection::Id id = convertPathToId(oldGroup.readEntry(QStringLiteral("collectionId")));
KConfigGroup oldGroup = archiveConfigOrigin->group(str); if (id != -1) {
QString newResourceName; KConfigGroup newGroup = groupCopy.group(str);
if (mHashResources.contains(resourcename)) { oldGroup.copyTo(&newGroup);
newResourceName = mHashResources.value(resourcename); newGroup.writeEntry(QStringLiteral("collectionId"), id);
const Akonadi::Collection::Id id = convertPathToId(oldGroup.readEntry(QStringLiteral("topLevelCollectionId")));
if (id != -1) {
KConfigGroup newGroup(archiveConfigDestination, archiveGroupPattern + newResourceName);
oldGroup.copyTo(&newGroup);
newGroup.writeEntry(QStringLiteral("topLevelCollectionId"), id);
}
}
oldGroup.deleteGroup();
} }
// FIXME convertCollectionListStrToAkonadiId(kaddressBookConfig, str, QStringLiteral("sources"), true);
//const QString sourceKey(QStringLiteral("sources"));
//convertCollectionListToRealPath(oldGroup, sourceKey);
oldGroup.deleteGroup();
} }
#endif
} }
......
Supports Markdown
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