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

0001 /*
0002     SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
0003     SPDX-FileContributor: Kevin Ottens <kevin@kdab.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "resourcetask.h"
0011 
0012 class RetrieveCollectionMetadataTask : public ResourceTask
0013 {
0014     Q_OBJECT
0015 
0016 public:
0017     explicit RetrieveCollectionMetadataTask(const ResourceStateInterface::Ptr &resource, QObject *parent = nullptr);
0018     ~RetrieveCollectionMetadataTask() override;
0019 
0020 private Q_SLOTS:
0021     void onGetMetaDataDone(KJob *job);
0022     void onGetAclDone(KJob *job);
0023     void onRightsReceived(KJob *job);
0024     void onQuotasReceived(KJob *job);
0025 
0026 protected:
0027     void doStart(KIMAP::Session *session) override;
0028 
0029 private:
0030     void endTaskIfNeeded();
0031 
0032     int m_pendingMetaDataJobs = 0;
0033 
0034     Akonadi::Collection m_collection;
0035     KIMAP::Session *m_session = nullptr;
0036 };