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

Bug found by andris
wilder
Montel Laurent 9 years ago
parent 13fa700617
commit e79c281ecc
  1. 2
      src/filter/filteractions/filteractionmove.cpp
  2. 14
      src/util/mailutil.cpp
  3. 2
      src/util/mailutil.h

@ -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);

Loading…
Cancel
Save