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

Don't create url with vacation filename

parent e654966e
......@@ -48,8 +48,9 @@
using namespace KSieveUi;
QUrl KSieveUi::Util::findSieveUrlForAccount(const QString &identifier)
QUrl KSieveUi::Util::findSieveUrlForAccount(const QString &identifier, bool withVacationFileName)
{
qDebug()<<" QUrl KSieveUi::Util::findSieveUrlForAccount(const QString &identifier)"<<identifier << "withVacationFileName" << withVacationFileName;
QScopedPointer<OrgKdeAkonadiImapSettingsInterface> interface(PimCommon::Util::createImapSettingsInterface(identifier));
if (!interface) {
......@@ -115,7 +116,10 @@ QUrl KSieveUi::Util::findSieveUrlForAccount(const QString &identifier)
u.addQueryItem(QStringLiteral("x-allow-unencrypted"), QStringLiteral("true"));
}
u = u.adjusted(QUrl::RemoveFilename);
u.setPath(u.path() + QLatin1Char('/') + QString(interface->sieveVacationFilename()));
if (withVacationFileName) {
u.setPath(u.path() + QLatin1Char('/') + QString(interface->sieveVacationFilename()));
}
qDebug()<<" real QUrl KSieveUi::Util::findSieveUrlForAccount(const QString &identifier) url "<< u;
return u;
} else {
QUrl u;
......@@ -174,7 +178,10 @@ QUrl KSieveUi::Util::findSieveUrlForAccount(const QString &identifier)
u.setUserName(interface->sieveCustomUsername());
}
u = u.adjusted(QUrl::RemoveFilename);
u.setPath(u.path() + QLatin1Char('/') + QString(interface->sieveVacationFilename()));
if (withVacationFileName) {
u.setPath(u.path() + QLatin1Char('/') + QString(interface->sieveVacationFilename()));
}
qDebug()<<" QUrl KSieveUi::Util::findSieveUrlForAccount(const QString &identifier) url "<< u;
return u;
}
}
......
......@@ -59,7 +59,7 @@ namespace Util
/**
* Returns the sieve url for the account with the given @p identifier.
*/
QUrl findSieveUrlForAccount(const QString &identifier);
QUrl findSieveUrlForAccount(const QString &identifier, bool withVacationFileName = true);
/**
* Returns the list of configured IMAP agent instances.
......
......@@ -53,7 +53,7 @@ bool CustomManageSieveWidget::refreshList()
last = new SieveTreeWidgetItem(treeView(), last);
last->setIcon(0, QIcon::fromTheme(QStringLiteral("network-server")));
const QUrl u = KSieveUi::Util::findSieveUrlForAccount(type.identifier());
const QUrl u = KSieveUi::Util::findSieveUrlForAccount(type.identifier(), false);
if (u.isEmpty()) {
QTreeWidgetItem *item = new QTreeWidgetItem(last);
item->setText(0, i18n("No Sieve URL configured"));
......
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