File indexing completed on 2023-12-03 08:28:33

0001 /*
0002  * Copyright (C) 2013  Daniel Vrátil <dvratil@redhat.com>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2.1 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Lesser General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Lesser General Public
0015  * License along with this library; if not, write to the Free Software
0016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0017  *
0018  */
0019 
0020 #include "log-search-hit.h"
0021 
0022 #include <QtCore/QSharedData>
0023 
0024 #include <TelepathyQt/Account>
0025 
0026 #include "log-entity.h"
0027 
0028 using namespace KTp;
0029 
0030 class LogSearchHit::Private: public QSharedData
0031 {
0032   public:
0033     Private(const Tp::AccountPtr &account_, const KTp::LogEntity &entity_,
0034             const QDate &date_):
0035         QSharedData(),
0036         account(account_),
0037         entity(entity_),
0038         date(date_)
0039     {
0040     }
0041 
0042     Private(const Private &other):
0043         QSharedData(other),
0044         account(other.account),
0045         entity(other.entity),
0046         date(other.date)
0047     {
0048     }
0049 
0050     Tp::AccountPtr account;
0051     KTp::LogEntity entity;
0052     QDate date;
0053 };
0054 
0055 LogSearchHit::LogSearchHit(const Tp::AccountPtr &account, const LogEntity &entity,
0056                            const QDate &date):
0057     d(new Private(account, entity, date))
0058 {
0059 }
0060 
0061 LogSearchHit::LogSearchHit(const LogSearchHit& other):
0062     d(other.d)
0063 {
0064 }
0065 
0066 LogSearchHit::~LogSearchHit()
0067 {
0068 }
0069 
0070 LogSearchHit& LogSearchHit::operator=(const LogSearchHit &other)
0071 {
0072     if (this != &other) {
0073         d = other.d;
0074     }
0075 
0076     return *this;
0077 }
0078 
0079 Tp::AccountPtr LogSearchHit::account() const
0080 {
0081     return d->account;
0082 }
0083 
0084 KTp::LogEntity LogSearchHit::entity() const
0085 {
0086     return d->entity;
0087 }
0088 
0089 QDate LogSearchHit::date() const
0090 {
0091     return d->date;
0092 }