9#include "core/messageitemsetmanager.h"
10#include "core/messageitem.h"
14MessageItemSetManager::MessageItemSetManager()
19MessageItemSetManager::~MessageItemSetManager()
25void MessageItemSetManager::clearAllSets()
27 for (
auto it = mSets->cbegin(), end = mSets->cend(); it != end; ++it) {
33int MessageItemSetManager::setCount()
const
35 return mSets->count();
38void MessageItemSetManager::removeSet(MessageItemSetReference ref)
40 auto set = mSets->value(
static_cast<ulong
>(ref),
nullptr);
44 mSets->remove(
static_cast<ulong
>(ref));
50 auto set = mSets->value(
static_cast<ulong
>(ref),
nullptr);
58void MessageItemSetManager::removeMessageItemFromAllSets(
MessageItem *mi)
62 for (
auto it = mSets->cbegin(), end = mSets->cend(); it != end; ++it) {
64 if ((*it)->isEmpty()) {
65 setsToBeKilled.
append(it.key());
69 for (
const auto set : setsToBeKilled) {
74MessageItemSetReference MessageItemSetManager::createSet()
76 static unsigned long int uNextId = 0;
79 auto set = mSets->value(uNextId,
nullptr);
87 set = mSets->value(uNextId,
nullptr);
91 mSets->insert(uNextId, set);
93 return static_cast<MessageItemSetReference
>(uNextId);
96bool MessageItemSetManager::addMessageItem(MessageItemSetReference ref,
MessageItem *mi)
98 auto set = mSets->value(
static_cast<ulong
>(ref),
nullptr);
The implementation independent part of the MessageList library.
void append(QList< T > &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 11:58:48 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.