1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
From: Montel Laurent <montel@kde.org>
Date: Fri, 07 Oct 2011 15:14:06 +0000
Subject: Fix Bug 283467 - Kmail has duplicated folders after migration from previous version.
X-Git-Url: http://quickgit.kde.org/?p=kdepim-runtime.git&a=commitdiff&h=6bdc6290632be5fc6c103064463d7421b5e3b60d
---
Fix Bug 283467 - Kmail has duplicated folders after migration from previous version.
By default in config we don't translate config name.
We use "inbox" "sent-mail" etc.
BUG: 283467
FIXED-IN: 4.7.3
---
--- a/migration/kmail/localfolderscollectionmigrator.cpp
+++ b/migration/kmail/localfolderscollectionmigrator.cpp
@@ -64,23 +64,41 @@ void LocalFoldersCollectionMigrator::set
const KConfigGroup group( config, QLatin1String( "General" ) );
- QString name = group.readEntry( QLatin1String( "inboxFolder" ), i18nc( "mail folder name for role inbox", "inbox" ) );
- d->mSystemFolders.insert( name, SpecialMailCollections::Inbox );
-
- name = group.readEntry( QLatin1String( "outboxFolder" ), i18nc( "mail folder name for role outbox", "outbox" ) );
- d->mSystemFolders.insert( name, SpecialMailCollections::Outbox );
-
- name = group.readEntry( QLatin1String( "sentFolder" ), i18nc( "mail folder name for role sent-mail", "sent-mail" ) );
- d->mSystemFolders.insert( name, SpecialMailCollections::SentMail );
-
- name = group.readEntry( QLatin1String( "trashFolder" ), i18nc( "mail folder name for role trash", "trash" ) );
- d->mSystemFolders.insert( name, SpecialMailCollections::Trash );
-
- name = group.readEntry( QLatin1String( "draftsFolder" ), i18nc( "mail folder name for role drafts", "drafts" ) );
- d->mSystemFolders.insert( name, SpecialMailCollections::Drafts );
-
- name = group.readEntry( QLatin1String( "templatesFolder" ), i18nc( "mail folder name for role templates", "templates" ) );
- d->mSystemFolders.insert( name, SpecialMailCollections::Templates );
+ if ( group.hasKey( QLatin1String( "inboxFolder" ) ) ) {
+ const QString name = group.readEntry( QLatin1String( "inboxFolder" ), i18nc( "mail folder name for role inbox", "inbox" ) );
+ d->mSystemFolders.insert( name, SpecialMailCollections::Inbox );
+ } else
+ d->mSystemFolders.insert( QLatin1String( "inbox" ), SpecialMailCollections::Inbox );
+
+ if ( group.hasKey( QLatin1String( "outboxFolder" ) ) ) {
+ const QString name = group.readEntry( QLatin1String( "outboxFolder" ), i18nc( "mail folder name for role outbox", "outbox" ) );
+ d->mSystemFolders.insert( name, SpecialMailCollections::Outbox );
+ } else
+ d->mSystemFolders.insert( QLatin1String( "outbox" ), SpecialMailCollections::Outbox );
+
+ if ( group.hasKey( QLatin1String( "sentFolder" ) ) ) {
+ const QString name = group.readEntry( QLatin1String( "sentFolder" ), i18nc( "mail folder name for role sent-mail", "sent-mail" ) );
+ d->mSystemFolders.insert( name, SpecialMailCollections::SentMail );
+ } else
+ d->mSystemFolders.insert( QLatin1String( "sent-mail" ), SpecialMailCollections::SentMail );
+
+ if ( group.hasKey( QLatin1String( "trashFolder" ) ) ) {
+ const QString name = group.readEntry( QLatin1String( "trashFolder" ), i18nc( "mail folder name for role trash", "trash" ) );
+ d->mSystemFolders.insert( name, SpecialMailCollections::Trash );
+ } else
+ d->mSystemFolders.insert( QLatin1String( "trash" ), SpecialMailCollections::Trash );
+
+ if ( group.hasKey( QLatin1String( "draftsFolder" ) ) ) {
+ const QString name = group.readEntry( QLatin1String( "draftsFolder" ), i18nc( "mail folder name for role drafts", "drafts" ) );
+ d->mSystemFolders.insert( name, SpecialMailCollections::Drafts );
+ } else
+ d->mSystemFolders.insert( QLatin1String( "drafts" ), SpecialMailCollections::Drafts );
+
+ if ( group.hasKey( QLatin1String( "templatesFolder" ) ) ) {
+ const QString name = group.readEntry( QLatin1String( "templatesFolder" ), i18nc( "mail folder name for role templates", "templates" ) );
+ d->mSystemFolders.insert( name, SpecialMailCollections::Templates );
+ } else
+ d->mSystemFolders.insert( QLatin1String( "templates" ), SpecialMailCollections::Templates );
}
void LocalFoldersCollectionMigrator::migrateCollection( const Collection &collection, const QString &folderId )
|