1 commit 6bdc6290632be5fc6c103064463d7421b5e3b60d
2 Author: Montel Laurent <montel@kde.org>
3 Date: Fri Oct 7 17:14:06 2011 +0200
5 Fix Bug 283467 - Kmail has duplicated folders after migration from previous version.
7 By default in config we don't translate config name.
8 We use "inbox" "sent-mail" etc.
13 diff --git a/migration/kmail/localfolderscollectionmigrator.cpp b/migration/kmail/localfolderscollectionmigrator.cpp
14 index 3edc59e..ea9f163 100644
15 --- a/migration/kmail/localfolderscollectionmigrator.cpp
16 +++ b/migration/kmail/localfolderscollectionmigrator.cpp
17 @@ -64,23 +64,41 @@ void LocalFoldersCollectionMigrator::setKMailConfig( const KSharedConfigPtr &con
19 const KConfigGroup group( config, QLatin1String( "General" ) );
21 - QString name = group.readEntry( QLatin1String( "inboxFolder" ), i18nc( "mail folder name for role inbox", "inbox" ) );
22 - d->mSystemFolders.insert( name, SpecialMailCollections::Inbox );
24 - name = group.readEntry( QLatin1String( "outboxFolder" ), i18nc( "mail folder name for role outbox", "outbox" ) );
25 - d->mSystemFolders.insert( name, SpecialMailCollections::Outbox );
27 - name = group.readEntry( QLatin1String( "sentFolder" ), i18nc( "mail folder name for role sent-mail", "sent-mail" ) );
28 - d->mSystemFolders.insert( name, SpecialMailCollections::SentMail );
30 - name = group.readEntry( QLatin1String( "trashFolder" ), i18nc( "mail folder name for role trash", "trash" ) );
31 - d->mSystemFolders.insert( name, SpecialMailCollections::Trash );
33 - name = group.readEntry( QLatin1String( "draftsFolder" ), i18nc( "mail folder name for role drafts", "drafts" ) );
34 - d->mSystemFolders.insert( name, SpecialMailCollections::Drafts );
36 - name = group.readEntry( QLatin1String( "templatesFolder" ), i18nc( "mail folder name for role templates", "templates" ) );
37 - d->mSystemFolders.insert( name, SpecialMailCollections::Templates );
38 + if ( group.hasKey( QLatin1String( "inboxFolder" ) ) ) {
39 + const QString name = group.readEntry( QLatin1String( "inboxFolder" ), i18nc( "mail folder name for role inbox", "inbox" ) );
40 + d->mSystemFolders.insert( name, SpecialMailCollections::Inbox );
42 + d->mSystemFolders.insert( QLatin1String( "inbox" ), SpecialMailCollections::Inbox );
44 + if ( group.hasKey( QLatin1String( "outboxFolder" ) ) ) {
45 + const QString name = group.readEntry( QLatin1String( "outboxFolder" ), i18nc( "mail folder name for role outbox", "outbox" ) );
46 + d->mSystemFolders.insert( name, SpecialMailCollections::Outbox );
48 + d->mSystemFolders.insert( QLatin1String( "outbox" ), SpecialMailCollections::Outbox );
50 + if ( group.hasKey( QLatin1String( "sentFolder" ) ) ) {
51 + const QString name = group.readEntry( QLatin1String( "sentFolder" ), i18nc( "mail folder name for role sent-mail", "sent-mail" ) );
52 + d->mSystemFolders.insert( name, SpecialMailCollections::SentMail );
54 + d->mSystemFolders.insert( QLatin1String( "sent-mail" ), SpecialMailCollections::SentMail );
56 + if ( group.hasKey( QLatin1String( "trashFolder" ) ) ) {
57 + const QString name = group.readEntry( QLatin1String( "trashFolder" ), i18nc( "mail folder name for role trash", "trash" ) );
58 + d->mSystemFolders.insert( name, SpecialMailCollections::Trash );
60 + d->mSystemFolders.insert( QLatin1String( "trash" ), SpecialMailCollections::Trash );
62 + if ( group.hasKey( QLatin1String( "draftsFolder" ) ) ) {
63 + const QString name = group.readEntry( QLatin1String( "draftsFolder" ), i18nc( "mail folder name for role drafts", "drafts" ) );
64 + d->mSystemFolders.insert( name, SpecialMailCollections::Drafts );
66 + d->mSystemFolders.insert( QLatin1String( "drafts" ), SpecialMailCollections::Drafts );
68 + if ( group.hasKey( QLatin1String( "templatesFolder" ) ) ) {
69 + const QString name = group.readEntry( QLatin1String( "templatesFolder" ), i18nc( "mail folder name for role templates", "templates" ) );
70 + d->mSystemFolders.insert( name, SpecialMailCollections::Templates );
72 + d->mSystemFolders.insert( QLatin1String( "templates" ), SpecialMailCollections::Templates );
75 void LocalFoldersCollectionMigrator::migrateCollection( const Collection &collection, const QString &folderId )