File indexing completed on 2024-11-24 04:44:34
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2009 Kevin Krammer <kevin.krammer@gmx.at> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "itemcreatejob.h" 0008 0009 #include "session_p.h" 0010 0011 using namespace Akonadi; 0012 0013 class FileStore::ItemCreateJobPrivate 0014 { 0015 public: 0016 Item mItem; 0017 Collection mCollection; 0018 }; 0019 0020 FileStore::ItemCreateJob::ItemCreateJob(const Item &item, const Collection &collection, FileStore::AbstractJobSession *session) 0021 : FileStore::Job(session) 0022 , d(new ItemCreateJobPrivate()) 0023 { 0024 d->mItem = item; 0025 d->mCollection = collection; 0026 0027 session->addJob(this); 0028 } 0029 0030 FileStore::ItemCreateJob::~ItemCreateJob() = default; 0031 0032 Collection FileStore::ItemCreateJob::collection() const 0033 { 0034 return d->mCollection; 0035 } 0036 0037 Item FileStore::ItemCreateJob::item() const 0038 { 0039 return d->mItem; 0040 } 0041 0042 bool FileStore::ItemCreateJob::accept(FileStore::Job::Visitor *visitor) 0043 { 0044 return visitor->visit(this); 0045 } 0046 0047 void FileStore::ItemCreateJob::handleItemCreated(const Item &item) 0048 { 0049 d->mItem = item; 0050 } 0051 0052 #include "moc_itemcreatejob.cpp"