Clean up api

wilder
Montel Laurent 10 years ago
parent 02077a93e2
commit 5db62cbb0d
  1. 2
      CMakeLists.txt
  2. 2
      src/collectionpage/collectiongeneralpage.cpp
  3. 2
      src/folder/entitycollectionorderproxymodel.cpp
  4. 22
      src/kernel/mailkernel.cpp
  5. 2
      src/kernel/mailkernel.h

@ -18,7 +18,7 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMQtDeclareLoggingCategory) include(ECMQtDeclareLoggingCategory)
include(ECMAddTests) include(ECMAddTests)
set(PIM_VERSION "5.3.44") set(PIM_VERSION "5.3.45")
set(MAILCOMMON_LIB_VERSION ${PIM_VERSION}) set(MAILCOMMON_LIB_VERSION ${PIM_VERSION})
set(AKONADIMIME_LIB_VERSION "5.3.40") set(AKONADIMIME_LIB_VERSION "5.3.40")
set(MESSAGELIB_LIB_VERSION "5.3.40") set(MESSAGELIB_LIB_VERSION "5.3.40")

@ -79,7 +79,7 @@ void CollectionGeneralPage::addLine(QWidget *parent, QVBoxLayout *layout)
void CollectionGeneralPage::init(const Akonadi::Collection &collection) void CollectionGeneralPage::init(const Akonadi::Collection &collection)
{ {
mIsLocalSystemFolder = CommonKernel->isSystemFolderCollection(collection) || mIsLocalSystemFolder = CommonKernel->isSystemFolderCollection(collection) ||
Kernel::folderIsInbox(collection, true); Kernel::folderIsInbox(collection);
mIsResourceFolder = (collection.parentCollection() == Akonadi::Collection::root()); mIsResourceFolder = (collection.parentCollection() == Akonadi::Collection::root());
QLabel *label; QLabel *label;

@ -45,7 +45,7 @@ public:
} }
int rank = 100; int rank = 100;
if (Kernel::folderIsInbox(collection, true)) { if (Kernel::folderIsInbox(collection)) {
rank = 1; rank = 1;
} else if (Kernel::self()->folderIsDraftOrOutbox(collection)) { } else if (Kernel::self()->folderIsDraftOrOutbox(collection)) {
if (Kernel::self()->folderIsDrafts(collection)) { if (Kernel::self()->folderIsDrafts(collection)) {

@ -371,7 +371,7 @@ bool Kernel::folderIsSentMailFolder(const Akonadi::Collection &col)
return false; return false;
} }
bool Kernel::folderIsInbox(const Akonadi::Collection &collection, bool withoutPop3InboxSetting) bool Kernel::folderIsInbox(const Akonadi::Collection &collection)
{ {
if (collection.remoteId().toLower() == QLatin1String("inbox") || if (collection.remoteId().toLower() == QLatin1String("inbox") ||
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)) { if (collection.resource().contains(MBOX_RESOURCE_IDENTIFIER)) {
return true; 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; return false;
} }

@ -135,7 +135,7 @@ public:
*/ */
bool folderIsSentMailFolder(const Akonadi::Collection &); bool folderIsSentMailFolder(const Akonadi::Collection &);
static bool folderIsInbox(const Akonadi::Collection &, bool withoutPop3InboxSetting = false); static bool folderIsInbox(const Akonadi::Collection &);
void initFolders(); void initFolders();

Loading…
Cancel
Save