00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "collectionstatistics.h"
00021
00022 #include <QtCore/QSharedData>
00023 #include <QtCore/QDebug>
00024
00025 using namespace Akonadi;
00026
00030 class CollectionStatistics::Private : public QSharedData
00031 {
00032 public:
00033 Private() :
00034 QSharedData(),
00035 count( -1 ),
00036 unreadCount( -1 ),
00037 size( -1 )
00038 {}
00039
00040 Private( const Private &other ) :
00041 QSharedData( other )
00042 {
00043 count = other.count;
00044 unreadCount = other.unreadCount;
00045 size = other.size;
00046 }
00047
00048 qint64 count;
00049 qint64 unreadCount;
00050 qint64 size;
00051 };
00052
00053
00054 CollectionStatistics::CollectionStatistics() :
00055 d( new Private )
00056 {
00057 }
00058
00059 CollectionStatistics::CollectionStatistics(const CollectionStatistics &other) :
00060 d( other.d )
00061 {
00062 }
00063
00064 CollectionStatistics::~CollectionStatistics()
00065 {
00066 }
00067
00068 qint64 CollectionStatistics::count( ) const
00069 {
00070 return d->count;
00071 }
00072
00073 void CollectionStatistics::setCount( qint64 count )
00074 {
00075 d->count = count;
00076 }
00077
00078 qint64 CollectionStatistics::unreadCount( ) const
00079 {
00080 return d->unreadCount;
00081 }
00082
00083 void CollectionStatistics::setUnreadCount( qint64 count )
00084 {
00085 d->unreadCount = count;
00086 }
00087
00088 qint64 CollectionStatistics::size( ) const
00089 {
00090 return d->size;
00091 }
00092
00093 void CollectionStatistics::setSize( qint64 size )
00094 {
00095 d->size = size;
00096 }
00097
00098 CollectionStatistics& CollectionStatistics::operator =(const CollectionStatistics & other)
00099 {
00100 d = other.d;
00101 return *this;
00102 }
00103
00104 QDebug operator<<( QDebug d, const CollectionStatistics& s )
00105 {
00106 return d << "CollectionStatistics:" << endl
00107 << " count:" << s.count() << endl
00108 << " unread count:" << s.unreadCount() << endl
00109 << " size:" << s.size();
00110 }