Commit 7331c7be authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to export akonadi_unifiedmailbox_agentrc

parent fee8480e
[General]
createDefaultBoxes=false
enabled=true
fixedSpecialCollections=true
[KFileDialog Settings]
detailViewIconSize=16
[UnifiedMailboxEditorDialog]
Size=1075,695
[UnifiedMailboxSettingsDialog]
Size=500,500
[UnifiedMailboxes][drafts]
collectionId=1384
icon=document-properties
name=Drafts
sources=12
[UnifiedMailboxes][inbox]
collectionId=1385
icon=mail-folder-inbox
name=Inbox
sources=11,16
[UnifiedMailboxes][sent-mail]
collectionId=1383
icon=mail-folder-sent
name=Sent
sources=6
[UnifiedMailboxes][test-unified]
collectionId=1386
icon=akonadi
name=test-unified
sources=64,1377,1379,54,55
......@@ -4,6 +4,7 @@ information/exportdatatype.xml
configs/foldermailarchiverc
configs/templatesconfigurationrc
configs/filters
configs/akonadi_unifiedmailbox_agentrc
resources/akonadi_pop3_resource_1rc
resources/akonadi_imap_resource_1rc
resources/akonadi_kolab_resource_1rc
......
[General]
createDefaultBoxes=false
enabled=true
fixedSpecialCollections=true
[KFileDialog Settings]
detailViewIconSize=16
[UnifiedMailboxEditorDialog]
Size=1075,695
[UnifiedMailboxSettingsDialog]
Size=500,500
[UnifiedMailboxes][drafts]
collectionId=foo/bla bla/bli1384
icon=document-properties
name=Drafts
sources=foo/bla bla/bli12
[UnifiedMailboxes][inbox]
collectionId=foo/bla bla/bli1385
icon=mail-folder-inbox
name=Inbox
sources=foo/bla bla/bli11,foo/bla bla/bli16
[UnifiedMailboxes][sent-mail]
collectionId=foo/bla bla/bli1383
icon=mail-folder-sent
name=Sent
sources=foo/bla bla/bli6
[UnifiedMailboxes][test-unified]
collectionId=foo/bla bla/bli1386
icon=akonadi
name=test-unified
sources=foo/bla bla/bli64,foo/bla bla/bli1377,foo/bla bla/bli1379,foo/bla bla/bli54,foo/bla bla/bli55
......@@ -226,7 +226,6 @@ void ExportMailJobInterface::backupConfig()
backupFile(tmp.fileName(), Utils::configsPath(), folderMailArchiveStr);
delete archiveConfig;
}
#if 0 // PORT it
const QString unifiedMailBoxStr(QStringLiteral("akonadi_unifiedmailbox_agentrc"));
const QString unifiedMailBoxrc = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + unifiedMailBoxStr;
if (QFileInfo::exists(unifiedMailBoxrc)) {
......@@ -236,24 +235,26 @@ void ExportMailJobInterface::backupConfig()
tmp.open();
KConfig *archiveConfig = mboxrc->copyTo(tmp.fileName());
const QStringList archiveList = archiveConfig->groupList().filter(QRegularExpression(QStringLiteral("FolderArchiveAccount")));
auto group = archiveConfig->group("UnifiedMailboxes");
const auto boxGroups = group.groupList();
for (const auto &str : boxGroups) {
KConfigGroup oldGroup = group.group(str);
for (const QString &str : archiveList) {
KConfigGroup oldGroup = archiveConfig->group(str);
const qint64 id = oldGroup.readEntry("topLevelCollectionId", -1);
const qint64 id = oldGroup.readEntry("collectionId", -1);
if (id != -1) {
const QString realPath = convertToFullCollectionPath(id);
if (!realPath.isEmpty()) {
oldGroup.writeEntry(QStringLiteral("topLevelCollectionId"), realPath);
oldGroup.writeEntry(QStringLiteral("collectionId"), realPath);
}
}
const QString sourceKey(QStringLiteral("sources"));
convertCollectionListToRealPath(oldGroup, sourceKey);
}
archiveConfig->sync();
backupFile(tmp.fileName(), Utils::configsPath(), unifiedMailBoxStr);
delete archiveConfig;
}
#endif
const QString archiveMailAgentConfigurationStr(QStringLiteral("akonadi_archivemail_agentrc"));
const QString archiveMailAgentconfigurationrc =
......
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