[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepim] backupmail: Improve++
From:       Montel Laurent <montel () kde ! org>
Date:       2012-06-05 19:10:09
Message-ID: 20120605191009.B0D96A60CD () git ! kde ! org
[Download RAW message or body]

Git commit 25c6eaabc4b0d23d14c9ac56e3f50309a2b5414f by Montel Laurent.
Committed on 05/06/2012 at 21:09.
Pushed by mlaurent into branch 'master'.

Improve++

M  +17   -0    backupmail/backupdata.cpp
M  +23   -0    backupmail/restoredata.cpp

http://commits.kde.org/kdepim/25c6eaabc4b0d23d14c9ac56e3f50309a2b5414f

diff --git a/backupmail/backupdata.cpp b/backupmail/backupdata.cpp
index 1efce89..fdb33d2 100644
--- a/backupmail/backupdata.cpp
+++ b/backupmail/backupdata.cpp
@@ -213,6 +213,23 @@ void BackupData::backupConfig()
         }
       }
     }
+
+    const QString generalStr("General");
+    if(kmailConfig->hasGroup(generalStr)) {
+      KConfigGroup generalGroup = kmailConfig->group(generalStr);
+      const QString startupFolderStr("startupFolder");
+      if(generalGroup.hasKey(startupFolderStr)) {
+        const int collectionId = generalGroup.readEntry(startupFolderStr,-1);
+        if(collectionId!=-1) {
+          const QString realPath = \
MailCommon::Util::fullCollectionPath(Akonadi::Collection( collectionId )); +          \
generalGroup.writeEntry(startupFolderStr,realPath); +        }
+      }
+    }
+
+
+
+
     kmailConfig->sync();
 //TODO fix other group/key based on akonadi-id
 
diff --git a/backupmail/restoredata.cpp b/backupmail/restoredata.cpp
index 0edeb6a..a70f9d2 100644
--- a/backupmail/restoredata.cpp
+++ b/backupmail/restoredata.cpp
@@ -559,8 +559,31 @@ void RestoreData::importKmailConfig(const KArchiveFile* \
kmailsnippet, const QStr  composerGroup.writeEntry(previousStr,id);
       }
     }
+    const QString previousIdentityStr("previous-identity");
+    if(composerGroup.hasKey(previousIdentityStr)) {
+      const int identityValue = composerGroup.readEntry(previousIdentityStr, -1);
+      if(identityValue!=-1) {
+        if(mHashIdentity.contains(identityValue)) {
+          composerGroup.writeEntry(previousIdentityStr,mHashIdentity.value(identityValue));
 +        } else {
+          composerGroup.writeEntry(previousIdentityStr,identityValue);
+        }
+      }
+    }
   }
 
+  const QString generalStr("General");
+  if(kmailConfig->hasGroup(generalStr)) {
+    KConfigGroup generalGroup = kmailConfig->group(generalStr);
+    const QString startupFolderStr("startupFolder");
+    if(generalGroup.hasKey(startupFolderStr)) {
+      const QString path = generalGroup.readEntry(startupFolderStr);
+      if(!path.isEmpty()) {
+        Akonadi::Collection::Id id = adaptFolderId(path);
+        generalGroup.writeEntry(startupFolderStr,id);
+      }
+    }
+  }
 //TODO fix all other id
   kmailConfig->sync();
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic