From 5db62cbb0d7ec853eda13ef7847e4c3ec4d289e6 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Sun, 30 Oct 2016 13:23:18 +0100 Subject: [PATCH] Clean up api --- CMakeLists.txt | 2 +- src/collectionpage/collectiongeneralpage.cpp | 2 +- .../entitycollectionorderproxymodel.cpp | 2 +- src/kernel/mailkernel.cpp | 22 +------------------ src/kernel/mailkernel.h | 2 +- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3ba0f6..9475524 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.44") +set(PIM_VERSION "5.3.45") set(MAILCOMMON_LIB_VERSION ${PIM_VERSION}) set(AKONADIMIME_LIB_VERSION "5.3.40") set(MESSAGELIB_LIB_VERSION "5.3.40") diff --git a/src/collectionpage/collectiongeneralpage.cpp b/src/collectionpage/collectiongeneralpage.cpp index fd51e03..1038a30 100644 --- a/src/collectionpage/collectiongeneralpage.cpp +++ b/src/collectionpage/collectiongeneralpage.cpp @@ -79,7 +79,7 @@ void CollectionGeneralPage::addLine(QWidget *parent, QVBoxLayout *layout) void CollectionGeneralPage::init(const Akonadi::Collection &collection) { mIsLocalSystemFolder = CommonKernel->isSystemFolderCollection(collection) || - Kernel::folderIsInbox(collection, true); + Kernel::folderIsInbox(collection); mIsResourceFolder = (collection.parentCollection() == Akonadi::Collection::root()); QLabel *label; diff --git a/src/folder/entitycollectionorderproxymodel.cpp b/src/folder/entitycollectionorderproxymodel.cpp index 67547c7..4e42dd9 100644 --- a/src/folder/entitycollectionorderproxymodel.cpp +++ b/src/folder/entitycollectionorderproxymodel.cpp @@ -45,7 +45,7 @@ public: } int rank = 100; - if (Kernel::folderIsInbox(collection, true)) { + if (Kernel::folderIsInbox(collection)) { rank = 1; } else if (Kernel::self()->folderIsDraftOrOutbox(collection)) { if (Kernel::self()->folderIsDrafts(collection)) { diff --git a/src/kernel/mailkernel.cpp b/src/kernel/mailkernel.cpp index 7d533a7..d449afa 100644 --- a/src/kernel/mailkernel.cpp +++ b/src/kernel/mailkernel.cpp @@ -371,7 +371,7 @@ bool Kernel::folderIsSentMailFolder(const Akonadi::Collection &col) return false; } -bool Kernel::folderIsInbox(const Akonadi::Collection &collection, bool withoutPop3InboxSetting) +bool Kernel::folderIsInbox(const Akonadi::Collection &collection) { if (collection.remoteId().toLower() == QLatin1String("inbox") || collection.remoteId().toLower() == QLatin1String("/inbox") || @@ -387,26 +387,6 @@ bool Kernel::folderIsInbox(const Akonadi::Collection &collection, bool withoutPo if (collection.resource().contains(MBOX_RESOURCE_IDENTIFIER)) { return true; } - - if (!withoutPop3InboxSetting) { - 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); - if (targetCollection == collection.id()) { - return true; - } - } - } - } - } return false; } diff --git a/src/kernel/mailkernel.h b/src/kernel/mailkernel.h index f7c175c..8eb37a2 100644 --- a/src/kernel/mailkernel.h +++ b/src/kernel/mailkernel.h @@ -135,7 +135,7 @@ public: */ bool folderIsSentMailFolder(const Akonadi::Collection &); - static bool folderIsInbox(const Akonadi::Collection &, bool withoutPop3InboxSetting = false); + static bool folderIsInbox(const Akonadi::Collection &); void initFolders();