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 "itemmovejob.h" 0009 0010 #include "session_p.h" 0011 0012 using namespace Akonadi; 0013 0014 class FileStore::ItemMoveJobPrivate 0015 { 0016 public: 0017 Item mItem; 0018 Collection mTargetParent; 0019 }; 0020 0021 FileStore::ItemMoveJob::ItemMoveJob(const Item &item, const Collection &targetParent, FileStore::AbstractJobSession *session) 0022 : FileStore::Job(session) 0023 , d(new ItemMoveJobPrivate()) 0024 { 0025 d->mItem = item; 0026 d->mTargetParent = targetParent; 0027 0028 session->addJob(this); 0029 } 0030 0031 FileStore::ItemMoveJob::~ItemMoveJob() = default; 0032 0033 Collection FileStore::ItemMoveJob::targetParent() const 0034 { 0035 return d->mTargetParent; 0036 } 0037 0038 Item FileStore::ItemMoveJob::item() const 0039 { 0040 return d->mItem; 0041 } 0042 0043 bool FileStore::ItemMoveJob::accept(FileStore::Job::Visitor *visitor) 0044 { 0045 return visitor->visit(this); 0046 } 0047 0048 void FileStore::ItemMoveJob::handleItemMoved(const Item &item) 0049 { 0050 d->mItem = item; 0051 } 0052 0053 #include "moc_itemmovejob.cpp"