File indexing completed on 2024-11-24 04:44:34

0001 /*  This file is part of the KDE project
0002     SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
0003     SPDX-FileContributor: Kevin Krammer <krake@kdab.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "collectiondeletejob.h"
0009 
0010 #include "session_p.h"
0011 
0012 using namespace Akonadi;
0013 
0014 class FileStore::CollectionDeleteJobPrivate
0015 {
0016 public:
0017     Collection mCollection;
0018 };
0019 
0020 FileStore::CollectionDeleteJob::CollectionDeleteJob(const Collection &collection, FileStore::AbstractJobSession *session)
0021     : FileStore::Job(session)
0022     , d(new CollectionDeleteJobPrivate())
0023 {
0024     Q_ASSERT(session != nullptr);
0025 
0026     d->mCollection = collection;
0027 
0028     session->addJob(this);
0029 }
0030 
0031 FileStore::CollectionDeleteJob::~CollectionDeleteJob() = default;
0032 
0033 Collection FileStore::CollectionDeleteJob::collection() const
0034 {
0035     return d->mCollection;
0036 }
0037 
0038 bool FileStore::CollectionDeleteJob::accept(FileStore::Job::Visitor *visitor)
0039 {
0040     return visitor->visit(this);
0041 }
0042 
0043 void FileStore::CollectionDeleteJob::handleCollectionDeleted(const Collection &collection)
0044 {
0045     d->mCollection = collection;
0046 }
0047 
0048 #include "moc_collectiondeletejob.cpp"