File indexing completed on 2025-01-19 04:46:52

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "folderconfiguremodifycollectionjob.h"
0008 #include "libfolderconfiguresettings_debug.h"
0009 #include <Akonadi/CollectionModifyJob>
0010 
0011 FolderConfigureModifyCollectionJob::FolderConfigureModifyCollectionJob(QObject *parent)
0012     : QObject(parent)
0013 {
0014 }
0015 
0016 FolderConfigureModifyCollectionJob::~FolderConfigureModifyCollectionJob() = default;
0017 
0018 void FolderConfigureModifyCollectionJob::setCollection(const Akonadi::Collection &col)
0019 {
0020     mCollection = col;
0021 }
0022 
0023 void FolderConfigureModifyCollectionJob::start()
0024 {
0025     auto job = new Akonadi::CollectionModifyJob(mCollection, this);
0026     connect(job, &Akonadi::CollectionModifyJob::result, this, &FolderConfigureModifyCollectionJob::slotCollectionModified);
0027 }
0028 
0029 void FolderConfigureModifyCollectionJob::slotCollectionModified(KJob *job)
0030 {
0031     if (job->error()) {
0032         qCWarning(LIBFOLDERCONFIGURESETTINGS_PLUGIN_LOG) << " Error when we modified collection";
0033     }
0034     deleteLater();
0035 }
0036 
0037 #include "moc_folderconfiguremodifycollectionjob.cpp"