File indexing completed on 2024-05-05 04:50:49

0001 /*
0002  * SPDX-FileCopyrightText: 2020 George Florea Bănuș <georgefb899@gmail.com>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 #ifndef SUBTITLESFOLDERSMODEL_H
0008 #define SUBTITLESFOLDERSMODEL_H
0009 
0010 #include <QAbstractListModel>
0011 #include <QtQml/qqmlregistration.h>
0012 
0013 class SubtitlesFoldersModel : public QAbstractListModel
0014 {
0015     Q_OBJECT
0016     QML_NAMED_ELEMENT(SubtitlesFoldersModel)
0017 
0018 public:
0019     explicit SubtitlesFoldersModel(QObject *parent = nullptr);
0020 
0021     // Basic functionality:
0022     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0023 
0024     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0025 
0026 public Q_SLOTS:
0027     void updateFolder(const QString &folder, int row);
0028     void deleteFolder(int row);
0029     void addFolder();
0030 
0031 private:
0032     QStringList m_list;
0033 };
0034 
0035 #endif // SUBTITLESFOLDERSMODEL_H