Messagelib

threadingcache.h
1 /******************************************************************************
2  *
3  * SPDX-FileCopyrightText: 2016 Daniel Vr├ítil <[email protected]>
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 
14 namespace MessageList
15 {
16 namespace Core
17 {
18 class Aggregation;
19 
20 class ThreadingCache
21 {
22 public:
23  ThreadingCache();
24  ~ThreadingCache();
25 
26  Q_REQUIRED_RESULT 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  MessageItem *parentForItem(MessageItem *mi, qint64 &parentId) const;
37 
38  void expireParent(MessageItem *item);
39 
40 private:
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
52 
Perform no threading at all.
Definition: aggregation.h:66
Threading
The available threading methods.
Definition: aggregation.h:65
Don&#39;t group messages at all.
Definition: aggregation.h:37
The thread grouping is computed from the topmost message (very similar to least recent, but might be different if timezones or machine clocks are screwed)
Definition: aggregation.h:79
QAction * load(const QObject *recvr, const char *slot, QObject *parent)
ThreadLeader
The available thread leading options.
Definition: aggregation.h:78
const QList< QKeySequence > & save()
Grouping
Message grouping.
Definition: aggregation.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Dec 6 2021 23:04:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.