Bug 102992 - kmailcvt: problem with import of subfolders
Summary: kmailcvt: problem with import of subfolders
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: kmailcvt (show other bugs)
Version: SVN (3.5 branch)
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-01 12:32 UTC by Danny Kukawka
Modified: 2009-03-19 00:30 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Kukawka 2005-04-01 12:32:53 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    SuSE RPMs
OS:                Linux

There is a problem with the naming of kmailfolder if you import from a mailarchiv with subfolders. The subfolders in the top level of subfolders miss the prefix currently. By this all messages in a subfolder are imported in one kmail mailfolder. 

-------------------------------
reproduce:
- import from evolution (2.x) or thunderbird mail archiv
Comment 1 Danny Kukawka 2005-04-03 04:07:16 UTC
CVS commit by dkukawka: 

fixed problem with import subfolder for thunderbird and evolution 2.x

BUGS: 102992


  M +8 -4      filter_evolution_v2.cxx   1.9
  M +7 -4      filter_thunderbird.cxx   1.9


--- kdepim/kmailcvt/filter_evolution_v2.cxx  #1.8:1.9
@@ -80,5 +80,5 @@ void FilterEvolution_v2::import(FilterIn
     int currentDir = 1, numSubDirs = rootSubDirs.size();
     for(QStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) {
-      importDirContents(info, dir.filePath(*filename), *filename, QString::null);
+      importDirContents(info, dir.filePath(*filename), *filename, *filename);
       info->setOverall((int) ((float) currentDir / numSubDirs * 100));
     }
@@ -185,12 +185,16 @@ void FilterEvolution_v2::importMBox(Filt
       tmp.close();
 
-      QString destFolder = rootDir;
+      QString destFolder = "";
       QString _targetDir = targetDir;
-      if(destFolder.contains(".sbd")) destFolder.remove(".sbd");
       if(!targetDir.isNull()){
          if(_targetDir.contains(".sbd")) _targetDir.remove(".sbd");
-         destFolder += ("-" + _targetDir);
+         destFolder += _targetDir;
          destFolder += "-" + filenameInfo.baseName(TRUE);// mboxName;
       }
+      else {
+        destFolder = rootDir;
+        if(destFolder.contains(".sbd")) destFolder.remove(".sbd");
+      }
+
       
       if(info->removeDupMsg) addMessage( info, destFolder, tmp.name() );

--- kdepim/kmailcvt/filter_thunderbird.cxx  #1.8:1.9
@@ -79,5 +79,5 @@ void FilterThunderbird::import(FilterInf
     int currentDir = 1, numSubDirs = rootSubDirs.size();
     for(QStringList::Iterator filename = rootSubDirs.begin() ; filename != rootSubDirs.end() ; ++filename, ++currentDir) {
-      importDirContents(info, dir.filePath(*filename), *filename, QString::null);
+      importDirContents(info, dir.filePath(*filename), *filename, *filename);
       info->setOverall((int) ((float) currentDir / numSubDirs * 100));
     }
@@ -181,12 +181,15 @@ void FilterThunderbird::importMBox(Filte
       }
       tmp.close();
-      QString destFolder = rootDir;
+      QString destFolder = "";
       QString _targetDir = targetDir;
-      if(destFolder.contains(".sbd")) destFolder.remove(".sbd");
       if(!targetDir.isNull()){
          if(_targetDir.contains(".sbd")) _targetDir.remove(".sbd");
-         destFolder += ("-" + _targetDir);
+         destFolder += _targetDir;
          destFolder += "-" + filenameInfo.baseName(TRUE);// mboxName;
       }
+      else {
+        destFolder = rootDir;
+        if(destFolder.contains(".sbd")) destFolder.remove(".sbd");
+      }
       
       if(info->removeDupMsg) addMessage( info, destFolder, tmp.name() );