summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-26 13:57:21 +0200
committerMontel Laurent <[email protected]>2017-10-26 13:57:21 +0200
commitecdb2acfb95acbf7a534a5aabc45d01abcd30907 (patch)
tree53d003fe541819e0fff046d3334e7835284f873e
parentaf4b8e6a0859fe98a1fb22336bae201d095849a8 (diff)
Now we can define imap folder in manage vacation
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/ksieveui/CMakeLists.txt3
-rw-r--r--src/ksieveui/util/util_p.h10
-rw-r--r--src/ksieveui/vacation/multiimapvacationdialog.cpp14
-rw-r--r--src/ksieveui/vacation/multiimapvacationdialog.h3
-rw-r--r--src/ksieveui/vacation/multiimapvacationmanager.cpp10
-rw-r--r--src/ksieveui/vacation/multiimapvacationmanager.h4
7 files changed, 24 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 90f3be3..a34ca31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
-set(PIM_VERSION "5.6.43")
+set(PIM_VERSION "5.6.44")
project(libksieve VERSION ${PIM_VERSION})
diff --git a/src/ksieveui/CMakeLists.txt b/src/ksieveui/CMakeLists.txt
index 8da03bd..c0b7ab2 100644
--- a/src/ksieveui/CMakeLists.txt
+++ b/src/ksieveui/CMakeLists.txt
@@ -262,7 +262,7 @@ set_target_properties(KF5KSieveUi PROPERTIES
)
target_include_directories(KF5KSieveUi INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KSieveUi/;${KDE_INSTALL_INCLUDEDIR_KF5}/ksieveui;${KDE_INSTALL_INCLUDEDIR_KF5}>")
-target_include_directories(KF5KSieveUi PUBLIC "$<BUILD_INTERFACE:${libksieve_SOURCE_DIR}/src/ksieveui;${libksieve_BINARY_DIR}/src/ksieveui>")
+target_include_directories(KF5KSieveUi PUBLIC "$<BUILD_INTERFACE:${libksieve_SOURCE_DIR}/src/ksieveui;${libksieve_SOURCE_DIR}/src/ksieveui/util/;${libksieve_BINARY_DIR}/src/ksieveui>")
ecm_generate_headers(ksieveui_CamelCase_HEADERS
HEADER_NAMES
@@ -370,6 +370,7 @@ install(FILES
${ksieveui_editor_HEADERS}
${ksieveui_util_HEADERS}
${ksieveui_managescriptsjob_HEADERS}
+ util/util_p.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/ksieveui
COMPONENT Devel
)
diff --git a/src/ksieveui/util/util_p.h b/src/ksieveui/util/util_p.h
index a6951d5..4113f34 100644
--- a/src/ksieveui/util/util_p.h
+++ b/src/ksieveui/util/util_p.h
@@ -39,7 +39,7 @@
#ifndef KSIEVE_KSIEVEUI_UTIL_P_H
#define KSIEVE_KSIEVEUI_UTIL_P_H
-#include "ksieveui_private_export.h"
+#include "ksieveui_export.h"
#include <KSieveUi/SieveImapAccountSettings>
#include <KSieveUi/SieveImapInstance>
#include <memory>
@@ -58,9 +58,9 @@ namespace Util {
struct AccountInfo {
KSieveUi::SieveImapAccountSettings sieveImapAccountSettings;
QUrl sieveUrl;
- KSIEVEUI_TESTS_EXPORT bool operator==(const AccountInfo &other) const;
+ KSIEVEUI_EXPORT bool operator==(const AccountInfo &other) const;
};
-KSIEVEUI_TESTS_EXPORT QDebug operator <<(QDebug d, const Util::AccountInfo &info);
+KSIEVEUI_EXPORT QDebug operator <<(QDebug d, const Util::AccountInfo &info);
/**
* Returns the list of configured IMAP agent instances.
@@ -79,12 +79,12 @@ bool hasKep14Support(const QStringList &sieveCapabilities, const QStringList &av
*/
bool isKep14ProtectedName(const QString &scriptName);
-KSIEVEUI_TESTS_EXPORT KSieveUi::Util::AccountInfo findAccountInfo(const QString &identifier, SieveImapPasswordProvider *provider, bool withVacationFileName,
+KSIEVEUI_EXPORT KSieveUi::Util::AccountInfo findAccountInfo(const QString &identifier, SieveImapPasswordProvider *provider, bool withVacationFileName,
std::unique_ptr<KSieveUi::AbstractAkonadiImapSettingInterface> &interface);
/**
* Returns all sieve account info with the given @p identifier.
*/
-KSIEVEUI_TESTS_EXPORT KSieveUi::Util::AccountInfo fullAccountInfo(const QString &identifier, SieveImapPasswordProvider *provider, bool withVacationFileName = true);
+KSIEVEUI_EXPORT KSieveUi::Util::AccountInfo fullAccountInfo(const QString &identifier, SieveImapPasswordProvider *provider, bool withVacationFileName = true);
}
}
diff --git a/src/ksieveui/vacation/multiimapvacationdialog.cpp b/src/ksieveui/vacation/multiimapvacationdialog.cpp
index 6baa4c4..96df53e 100644
--- a/src/ksieveui/vacation/multiimapvacationdialog.cpp
+++ b/src/ksieveui/vacation/multiimapvacationdialog.cpp
@@ -118,12 +118,11 @@ void MultiImapVacationDialog::init()
bool foundOneImap = false;
QDialogButtonBox *buttonBox = nullptr;
- const QMap <QString, QUrl> list = d->mVacationManager->serverList();
- QMapIterator<QString, QUrl> i(list);
+ const QMap <QString, KSieveUi::Util::AccountInfo> list = d->mVacationManager->serverList();
+ QMapIterator<QString, KSieveUi::Util::AccountInfo> i(list);
while (i.hasNext()) {
i.next();
- const QUrl url = i.value();
- createPage(i.key(), url);
+ createPage(i.key(), i.value());
foundOneImap = true;
}
if (foundOneImap) {
@@ -151,13 +150,14 @@ void MultiImapVacationDialog::slotCanceled()
Q_EMIT cancelClicked();
}
-void MultiImapVacationDialog::createPage(const QString &serverName, const QUrl &url)
+void MultiImapVacationDialog::createPage(const QString &serverName, const KSieveUi::Util::AccountInfo &info)
{
VacationPageWidget *page = new VacationPageWidget;
- page->setServerUrl(url);
+ page->setServerUrl(info.sieveUrl);
page->setServerName(serverName);
page->setVacationManager(d->mVacationManager);
- d->mTabWidget->addTab(page, serverName + QStringLiteral(" (%1)").arg(url.userName()));
+ page->setSieveImapAccountSettings(info.sieveImapAccountSettings);
+ d->mTabWidget->addTab(page, serverName + QStringLiteral(" (%1)").arg(info.sieveUrl.userName()));
}
void MultiImapVacationDialog::readConfig()
diff --git a/src/ksieveui/vacation/multiimapvacationdialog.h b/src/ksieveui/vacation/multiimapvacationdialog.h
index f48653b..4883d37 100644
--- a/src/ksieveui/vacation/multiimapvacationdialog.h
+++ b/src/ksieveui/vacation/multiimapvacationdialog.h
@@ -23,6 +23,7 @@
#include <QDialog>
#include <QUrl>
#include "ksieveui_export.h"
+#include "util_p.h"
namespace KSieveUi {
class VacationCreateScriptJob;
@@ -47,7 +48,7 @@ private:
void slotOkClicked();
void slotDefaultClicked();
void slotCanceled();
- void createPage(const QString &serverName, const QUrl &url);
+ void createPage(const QString &serverName, const KSieveUi::Util::AccountInfo &info);
void init();
void readConfig();
void writeConfig();
diff --git a/src/ksieveui/vacation/multiimapvacationmanager.cpp b/src/ksieveui/vacation/multiimapvacationmanager.cpp
index 4c4d89f..a99366e 100644
--- a/src/ksieveui/vacation/multiimapvacationmanager.cpp
+++ b/src/ksieveui/vacation/multiimapvacationmanager.cpp
@@ -40,9 +40,9 @@ MultiImapVacationManager::~MultiImapVacationManager()
{
}
-QMap <QString, QUrl> MultiImapVacationManager::serverList() const
+QMap <QString, KSieveUi::Util::AccountInfo> MultiImapVacationManager::serverList() const
{
- QMap <QString, QUrl> list;
+ QMap <QString, KSieveUi::Util::AccountInfo> list;
const QVector<KSieveUi::SieveImapInstance> instances = KSieveUi::Util::sieveImapInstances();
for (const KSieveUi::SieveImapInstance &instance : instances) {
if (instance.status() == KSieveUi::SieveImapInstance::Broken) {
@@ -52,7 +52,7 @@ QMap <QString, QUrl> MultiImapVacationManager::serverList() const
const KSieveUi::Util::AccountInfo info = KSieveUi::Util::fullAccountInfo(instance.identifier(), mPasswordProvider);
const QUrl url = info.sieveUrl;
if (!url.isEmpty()) {
- list.insert(instance.name(), url);
+ list.insert(instance.name(), info);
}
}
return list;
@@ -84,10 +84,10 @@ void MultiImapVacationManager::checkVacation()
mNumberOfJobs = 0;
mCheckInProgress = true;
- QMapIterator<QString, QUrl> i(serverList());
+ QMapIterator<QString, KSieveUi::Util::AccountInfo> i(serverList());
while (i.hasNext()) {
i.next();
- checkVacation(i.key(), i.value());
+ checkVacation(i.key(), i.value().sieveUrl);
}
}
diff --git a/src/ksieveui/vacation/multiimapvacationmanager.h b/src/ksieveui/vacation/multiimapvacationmanager.h
index 3db5e9b..a6fd441 100644
--- a/src/ksieveui/vacation/multiimapvacationmanager.h
+++ b/src/ksieveui/vacation/multiimapvacationmanager.h
@@ -22,7 +22,7 @@
#include <QObject>
#include <QMap>
-
+#include "util_p.h"
#include "ksieveui_export.h"
class QUrl;
@@ -39,7 +39,7 @@ public:
~MultiImapVacationManager();
void checkVacation();
- QMap<QString, QUrl> serverList() const;
+ QMap<QString, KSieveUi::Util::AccountInfo> serverList() const;
void checkVacation(const QString &serverName, const QUrl &url);
bool kep14Support(const QString &serverName) const;