Commit b6130103 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Backport try to select correct folder

parent 0365eb3d
...@@ -127,14 +127,20 @@ void FilterThunderbird::import() ...@@ -127,14 +127,20 @@ void FilterThunderbird::import()
// Select directory from where I have to import files // Select directory from where I have to import files
const QString maildir = QFileDialog::getExistingDirectory(0, QString(), thunderDir); const QString maildir = QFileDialog::getExistingDirectory(0, QString(), thunderDir);
if (!maildir.isEmpty()) { if (!maildir.isEmpty()) {
const QString mailDirThunderbird = maildir + QLatin1String("/Mail/Local Folders/");
if (QDir(mailDirThunderbird).exists()) {
importMails(mailDirThunderbird);
} else {
importMails(maildir); importMails(maildir);
} }
}
} }
bool FilterThunderbird::excludeFiles(const QString &file) bool FilterThunderbird::excludeFiles(const QString &file)
{ {
if ((file.endsWith(QLatin1String(".msf")) || if ((file.endsWith(QLatin1String(".msf")) ||
file.endsWith(QLatin1String("msgFilterRules.dat")) || file.endsWith(QLatin1String(".dat")) ||
file.endsWith(QLatin1String(".json")) ||
file.endsWith(QLatin1String(".html")))) { file.endsWith(QLatin1String(".html")))) {
return true; return true;
} }
...@@ -209,8 +215,6 @@ void FilterThunderbird::importDirContents(const QString &dirName, const QString ...@@ -209,8 +215,6 @@ void FilterThunderbird::importDirContents(const QString &dirName, const QString
return; return;
} }
/** Here Import all archives in the current dir */ /** Here Import all archives in the current dir */
QDir dir(dirName);
QDir importDir(dirName); QDir importDir(dirName);
const QStringList files = importDir.entryList(QStringList(QStringLiteral("[^\\.]*")), QDir::Files, QDir::Name); const QStringList files = importDir.entryList(QStringList(QStringLiteral("[^\\.]*")), QDir::Files, QDir::Name);
QStringList::ConstIterator mailFileEnd = files.constEnd(); QStringList::ConstIterator mailFileEnd = files.constEnd();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment