akonadi
collectionstatistics.cpp
00001 /* 00002 Copyright (c) 2006 Volker Krause <vkrause@kde.org> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 #include "collectionstatistics.h" 00021 00022 #include <QtCore/QSharedData> 00023 00024 using namespace Akonadi; 00025 00029 class CollectionStatistics::Private : public QSharedData 00030 { 00031 public: 00032 Private() : 00033 QSharedData(), 00034 count( -1 ), 00035 unreadCount( -1 ) 00036 {} 00037 00038 Private( const Private &other ) : 00039 QSharedData( other ) 00040 { 00041 count = other.count; 00042 unreadCount = other.count; 00043 } 00044 00045 qint64 count; 00046 qint64 unreadCount; 00047 }; 00048 00049 00050 CollectionStatistics::CollectionStatistics() : 00051 d( new Private ) 00052 { 00053 } 00054 00055 CollectionStatistics::CollectionStatistics(const CollectionStatistics &other) : 00056 d( other.d ) 00057 { 00058 } 00059 00060 CollectionStatistics::~CollectionStatistics() 00061 { 00062 } 00063 00064 qint64 CollectionStatistics::count( ) const 00065 { 00066 return d->count; 00067 } 00068 00069 void CollectionStatistics::setCount( qint64 count ) 00070 { 00071 d->count = count; 00072 } 00073 00074 qint64 CollectionStatistics::unreadCount( ) const 00075 { 00076 return d->unreadCount; 00077 } 00078 00079 void CollectionStatistics::setUnreadCount( qint64 count ) 00080 { 00081 d->unreadCount = count; 00082 } 00083 00084 CollectionStatistics& CollectionStatistics::operator =(const CollectionStatistics & other) 00085 { 00086 d = other.d; 00087 return *this; 00088 }