2021-09-23 19:23:39 +02:00
|
|
|
/**
|
2022-05-24 13:43:13 +02:00
|
|
|
* SPDX-FileCopyrightText: 2021-2022 Bart De Vries <bart@mogwai.be>
|
2021-09-23 19:23:39 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <KJob>
|
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
#include "error.h"
|
|
|
|
#include "updatefeedjob.h"
|
|
|
|
|
|
|
|
class FetchFeedsJob : public KJob
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit FetchFeedsJob(const QStringList &urls, QObject *parent = nullptr);
|
|
|
|
|
|
|
|
void start() override;
|
2021-10-29 17:00:52 +02:00
|
|
|
bool aborted();
|
|
|
|
void abort();
|
2021-09-23 19:23:39 +02:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
2021-10-29 17:00:52 +02:00
|
|
|
void aborting();
|
2021-09-23 19:23:39 +02:00
|
|
|
void logError(Error::Type type, const QString &url, const QString &id, const int errorId, const QString &errorString, const QString &title);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QStringList m_urls;
|
|
|
|
|
|
|
|
void fetch();
|
|
|
|
void monitorProgress();
|
|
|
|
|
|
|
|
QVector<UpdateFeedJob *> m_feedjobs;
|
2021-10-29 17:00:52 +02:00
|
|
|
bool m_abort = false;
|
2021-09-23 19:23:39 +02:00
|
|
|
};
|