Commit e79c281e authored by Laurent Montel's avatar Laurent Montel 😁

Don't export "account name" when we export filter as sieve script.

Bug found by andris
parent 13fa7006
......@@ -60,7 +60,7 @@ QString FilterActionMove::sieveCode() const
{
QString path;
if (KernelIf->collectionModel()) {
path = MailCommon::Util::fullCollectionPath(mFolder);
path = MailCommon::Util::fullCollectionPath(mFolder, false);
} else {
path = QString::number(mFolder.id());
}
......
......@@ -103,7 +103,7 @@ bool MailCommon::Util::isLocalCollection(const QString &resource)
|| resource.contains(QStringLiteral("akonadi_mixedmaildir_resource"));
}
QString MailCommon::Util::fullCollectionPath(const Akonadi::Collection &collection)
QString MailCommon::Util::fullCollectionPath(const Akonadi::Collection &collection, bool addAccountName)
{
QString fullPath;
......@@ -116,8 +116,18 @@ QString MailCommon::Util::fullCollectionPath(const Akonadi::Collection &collecti
fullPath = idx.data().toString();
idx = idx.parent();
while (idx != QModelIndex()) {
fullPath = idx.data().toString() + QLatin1Char('/') + fullPath;
const QString tmp = idx.data().toString() + QLatin1Char('/') + fullPath;
idx = idx.parent();
if (idx != QModelIndex()) {
fullPath = tmp;
} else {
if (!addAccountName) {
break;
} else {
fullPath = tmp;
break;
}
}
}
return fullPath;
}
......
......@@ -68,7 +68,7 @@ MAILCOMMON_EXPORT bool isVirtualCollection(const Akonadi::Collection &col);
MAILCOMMON_EXPORT bool isVirtualCollection(const QString &resource);
MAILCOMMON_EXPORT QString fullCollectionPath(const Akonadi::Collection &collection);
MAILCOMMON_EXPORT QString fullCollectionPath(const Akonadi::Collection &collection, bool addAccountName = true);
MAILCOMMON_EXPORT bool showJobErrorMessage(KJob *job);
......
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