File indexing completed on 2024-05-12 16:21:30

0001 /**
0002  * SPDX-FileCopyrightText: 2021-2022 Bart De Vries <bart@mogwai.be>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #pragma once
0008 
0009 #include <KJob>
0010 #include <QVector>
0011 
0012 #include "error.h"
0013 #include "updatefeedjob.h"
0014 
0015 class FetchFeedsJob : public KJob
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     explicit FetchFeedsJob(const QStringList &urls, QObject *parent = nullptr);
0021 
0022     void start() override;
0023     bool aborted();
0024     void abort();
0025 
0026 Q_SIGNALS:
0027     void aborting();
0028     void logError(Error::Type type, const QString &url, const QString &id, const int errorId, const QString &errorString, const QString &title);
0029 
0030 private:
0031     QStringList m_urls;
0032 
0033     void fetch();
0034     void monitorProgress();
0035 
0036     QVector<UpdateFeedJob *> m_feedjobs;
0037     bool m_abort = false;
0038 };