Messagelib

threadingcache.h
1/******************************************************************************
2 *
3 * SPDX-FileCopyrightText: 2016 Daniel Vrátil <dvratil@kde.org>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 *
7 *******************************************************************************/
8
9#pragma once
10
11#include "messageitem.h"
12#include <QHash>
13
14namespace MessageList
15{
16namespace Core
17{
18class Aggregation;
19
20class ThreadingCache
21{
22public:
23 ThreadingCache();
24 ~ThreadingCache();
25
26 [[nodiscard]] bool isEnabled() const;
27 void setEnabled(bool enabled);
28
29 void load(const QString &id, const Aggregation *aggregation);
30 void save();
31
32 void addItemToCache(MessageItem *mi);
33
34 void updateParent(MessageItem *mi, MessageItem *parent);
35
36 [[nodiscard]] MessageItem *parentForItem(MessageItem *mi, qint64 &parentId) const;
37
38 void expireParent(MessageItem *item);
39
40private:
41 QHash<qint64 /* child */, qint64 /* parent */> mParentCache;
42 QHash<qint64 /* ID */, MessageItem *> mItemCache;
43
44 QString mCacheId;
48 bool mEnabled = true;
49};
50} // namespace Core
51} // namespace MessageList
@ NoGrouping
Don't group messages at all.
Definition aggregation.h:37
Threading
The available threading methods.
Definition aggregation.h:65
@ NoThreading
Perform no threading at all.
Definition aggregation.h:66
ThreadLeader
The available thread leading options.
Definition aggregation.h:78
@ TopmostMessage
The thread grouping is computed from the topmost message (very similar to least recent,...
Definition aggregation.h:79
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.