// SPDX-FileCopyrightText: 2020 Jonah BrĂ¼chert // // SPDX-License-Identifier: GPL-2.0-or-later #pragma once #include class DownloadsModel : public QAbstractListModel { Q_OBJECT enum Role { UrlRole, FileNameRole, DownloadRole, MimeTypeIconRole, DownloadedFilePathRole, }; public: explicit DownloadsModel(QObject *parent = nullptr); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; int rowCount(const QModelIndex &parent = {}) const override; QHash roleNames() const override; Q_INVOKABLE void removeDownload(const int index); };