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

List:       kde-commits
Subject:    [kdepim] mailimporter: Allow to import mails directly
From:       Montel Laurent <montel () kde ! org>
Date:       2012-03-01 20:01:51
Message-ID: 20120301200151.EA505A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 11e535a29cfe250ccb8176cdf08970bbfe97b590 by Montel Laurent.
Committed on 01/03/2012 at 21:01.
Pushed by mlaurent into branch 'master'.

Allow to import mails directly

M  +9    -3    mailimporter/filter_opera.cpp
M  +2    -0    mailimporter/filter_opera.h

http://commits.kde.org/kdepim/11e535a29cfe250ccb8176cdf08970bbfe97b590

diff --git a/mailimporter/filter_opera.cpp b/mailimporter/filter_opera.cpp
index 5815be5..8b1d784 100644
--- a/mailimporter/filter_opera.cpp
+++ b/mailimporter/filter_opera.cpp
@@ -157,7 +157,13 @@ void FilterOpera::import()
   QString operaDir = kfd->selectedFile();
   delete kfd;
 
-  if (operaDir.isEmpty()) {
+  importMails( operaDir );
+}
+
+void FilterOpera::importMails( const QString &maildir )
+{
+  setMailDir(maildir);
+  if (mailDir().isEmpty()) {
     filterInfo()->alert(i18n("No directory selected."));
     return;
   }
@@ -165,12 +171,12 @@ void FilterOpera::import()
    * If the user only select homedir no import needed because
    * there should be no files and we surely import wrong files.
    */
-  else if ( operaDir == QDir::homePath() || operaDir == (QDir::homePath() + '/')) {
+  else if ( mailDir() == QDir::homePath() || mailDir() == (QDir::homePath() + \
QLatin1Char( '/' ))) {  filterInfo()->addErrorLogEntry(i18n("No files found for \
import."));  } else {
     filterInfo()->setOverall(0);
 
-    QDir importDir (operaDir);
+    QDir importDir (mailDir());
     const QStringList files = importDir.entryList(QStringList("*.[mM][bB][sS]"), \
QDir::Files, QDir::Name);  
     // Count total number of files to be processed
diff --git a/mailimporter/filter_opera.h b/mailimporter/filter_opera.h
index c9fe60e..f8ef435 100644
--- a/mailimporter/filter_opera.h
+++ b/mailimporter/filter_opera.h
@@ -32,6 +32,8 @@ public:
   ~FilterOpera();
 
   void import();
+  void importMails( const QString &maildir );
+
 private:
   void importBox( const QDir & importDir, const QStringList & , const QString & \
accountName = QString());  void importRecursive(const QDir& maildir, const QString \
&accountName = QString() );


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

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