summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-30 07:34:09 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-30 07:34:09 (GMT)
commit973ac0e85921268fa367adbf42f50a4eb4e64eb1 (patch)
tree716770724492103caa2540ab322c68107355cfda
parent835ba19f5588659d75843d92c916531686b40315 (diff)
Add method to get resource pop3 collection target
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/kernel/mailkernel.cpp21
-rw-r--r--src/kernel/mailkernel.h1
3 files changed, 23 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18d0619..3445762 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
-set(PIM_VERSION "5.3.42")
+set(PIM_VERSION "5.3.43")
set(MAILCOMMON_LIB_VERSION ${PIM_VERSION})
set(AKONADIMIME_LIB_VERSION "5.3.40")
set(MESSAGELIB_LIB_VERSION "5.3.40")
diff --git a/src/kernel/mailkernel.cpp b/src/kernel/mailkernel.cpp
index 507c709..642033e 100644
--- a/src/kernel/mailkernel.cpp
+++ b/src/kernel/mailkernel.cpp
@@ -410,5 +410,26 @@ bool Kernel::folderIsInbox(const Akonadi::Collection &collection, bool withoutPo
return false;
}
+QMap<QString, Akonadi::Collection::Id> Kernel::folderIsInbox()
+{
+ QMap<QString, Akonadi::Collection::Id> mapIdentifierCollectionId;
+ const Akonadi::AgentInstance::List lst = MailCommon::Util::agentInstances();
+ foreach (const Akonadi::AgentInstance &type, lst) {
+ if (type.status() == Akonadi::AgentInstance::Broken) {
+ continue;
+ }
+ const QString typeIdentifier = type.identifier();
+ if (typeIdentifier.contains(POP3_RESOURCE_IDENTIFIER)) {
+ PimCommon::ResourceReadConfigFile resourceFile(typeIdentifier);
+ const KConfigGroup grp = resourceFile.group(QStringLiteral("General"));
+ if (grp.isValid()) {
+ const Akonadi::Collection::Id targetCollection = grp.readEntry(QStringLiteral("targetCollection"), -1);
+ mapIdentifierCollectionId.insert(typeIdentifier, targetCollection);
+ }
+ }
+ }
+ return mapIdentifierCollectionId;
+}
+
}
diff --git a/src/kernel/mailkernel.h b/src/kernel/mailkernel.h
index 02f1bed..d8295e8 100644
--- a/src/kernel/mailkernel.h
+++ b/src/kernel/mailkernel.h
@@ -143,6 +143,7 @@ public:
PimCommon::ImapResourceCapabilitiesManager *imapResourceManager() const;
+ static QMap<QString, Akonadi::Collection::Id> folderIsInbox();
private:
void findCreateDefaultCollection(Akonadi::SpecialMailCollections::Type);