summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-08-10 07:57:16 +0200
committerMontel Laurent <[email protected]>2017-08-10 07:57:16 +0200
commitf8d35af306c13e180cdff2564c51e8fbf8f32e3a (patch)
treed5beb88244182c1058be76c5f7411a0ef5b270c6
parentb1654dcf78e854564c4bdeb3f4221d5cd4eb7a49 (diff)
Make sure that we return a account configurated
but found by David
-rw-r--r--src/mailimporter/filters/filterthunderbird.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mailimporter/filters/filterthunderbird.cpp b/src/mailimporter/filters/filterthunderbird.cpp
index ae766b5..e01df4e 100644
--- a/src/mailimporter/filters/filterthunderbird.cpp
+++ b/src/mailimporter/filters/filterthunderbird.cpp
@@ -23,6 +23,7 @@
#include <QTemporaryFile>
#include <KConfig>
#include <QFile>
+#include <QDebug>
#include <QRegularExpression>
using namespace MailImporter;
@@ -50,7 +51,22 @@ QString FilterThunderbird::isMailerFound()
{
QDir directory(FilterThunderbird::defaultSettingsPath());
if (directory.exists()) {
- return i18nc("name of thunderbird application", "Thunderbird");
+ QString currentProfile;
+ const QMap<QString, QString> listOfPath = FilterThunderbird::listProfile(currentProfile, FilterThunderbird::defaultSettingsPath());
+ bool foundMailConfigurated = false;
+ QMap<QString, QString>::const_iterator i = listOfPath.constBegin();
+ while (i != listOfPath.constEnd()) {
+ QDir dir(FilterThunderbird::defaultSettingsPath() + QLatin1Char('/') + i.value());
+ if (!dir.entryList(QStringList({QStringLiteral("ImapMail"), QStringLiteral("Mail")}), QDir::Dirs).isEmpty()) {
+ foundMailConfigurated = true;
+ break;
+ }
+ ++i;
+ }
+ if (foundMailConfigurated)
+ return i18nc("name of thunderbird application", "Thunderbird");
+ else
+ return {};
}
return {};
}