Akonadi

core/collectionstatistics.cpp
1 /*
2  SPDX-FileCopyrightText: 2006 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "collectionstatistics.h"
8 
9 #include <QDebug>
10 #include <QSharedData>
11 
12 using namespace Akonadi;
13 
14 /**
15  * @internal
16  */
17 class Akonadi::CollectionStatisticsPrivate : public QSharedData
18 {
19 public:
20  qint64 count = -1;
21  qint64 unreadCount = -1;
22  qint64 size = -1;
23 };
24 
26  : d(new CollectionStatisticsPrivate)
27 {
28 }
29 
31  : d(other.d)
32 {
33 }
34 
36 
38 {
39  return d->count;
40 }
41 
43 {
44  d->count = count;
45 }
46 
48 {
49  return d->unreadCount;
50 }
51 
53 {
54  d->unreadCount = count;
55 }
56 
58 {
59  return d->size;
60 }
61 
63 {
64  d->size = size;
65 }
66 
68 {
69  d = other.d;
70  return *this;
71 }
72 
74 {
75  return d << "CollectionStatistics:\n"
76  << " count:" << s.count() << '\n'
77  << " unread count:" << s.unreadCount() << '\n'
78  << " size:" << s.size();
79 }
Provides statistics information of a Collection.
QDataStream & operator<<(QDataStream &out, const KDateTime &dateTime)
qint64 size() const
Returns the total size of the items in this collection or -1 if this information is not available.
qint64 count() const
Returns the number of items in this collection or -1 if this information is not available.
qint64 unreadCount() const
Returns the number of unread items in this collection or -1 if this information is not available.
CollectionStatistics & operator=(const CollectionStatistics &other)
Assigns other to this statistics object and returns a reference to this one.
void setCount(qint64 count)
Sets the number of items in this collection.
void setUnreadCount(qint64 count)
Sets the number of unread items in this collection.
CollectionStatistics()
Creates a new collection statistics object.
void setSize(qint64 size)
Sets the total size of the items in this collection.
~CollectionStatistics()
Destroys the collection statistics object.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jul 2 2022 06:41:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.