summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-06-29 22:23:52 +0200
committerMontel Laurent <[email protected]>2016-06-29 22:23:52 +0200
commitf81b4cb19830692b914ac324501e19376b8165fb (patch)
tree91612ce5cc0b942b73a9540914d695984cf0bdce
parente654966e271b618c41220d3f2a5b462f7e9da881 (diff)
Don't create url with vacation filename
-rw-r--r--src/ksieveui/util/util.cpp13
-rw-r--r--src/ksieveui/util/util.h2
-rw-r--r--src/ksieveui/widgets/custommanagesievewidget.cpp2
3 files changed, 12 insertions, 5 deletions
diff --git a/src/ksieveui/util/util.cpp b/src/ksieveui/util/util.cpp
index ff3d589..6c34e37 100644
--- a/src/ksieveui/util/util.cpp
+++ b/src/ksieveui/util/util.cpp
@@ -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;
}
}
diff --git a/src/ksieveui/util/util.h b/src/ksieveui/util/util.h
index 3e1a33f..bb13889 100644
--- a/src/ksieveui/util/util.h
+++ b/src/ksieveui/util/util.h
@@ -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.
diff --git a/src/ksieveui/widgets/custommanagesievewidget.cpp b/src/ksieveui/widgets/custommanagesievewidget.cpp
index d97ecf3..b7b6af2 100644
--- a/src/ksieveui/widgets/custommanagesievewidget.cpp
+++ b/src/ksieveui/widgets/custommanagesievewidget.cpp
@@ -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"));