2023-05-23 02:13:42 +00:00
|
|
|
#ifndef LOCALDOCSMODEL_H
|
|
|
|
#define LOCALDOCSMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
#include "database.h"
|
|
|
|
|
|
|
|
class LocalDocsModel : public QAbstractListModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum Roles {
|
|
|
|
CollectionRole = Qt::UserRole + 1,
|
2023-06-03 14:08:59 +00:00
|
|
|
FolderPathRole,
|
|
|
|
InstalledRole
|
2023-05-23 02:13:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
explicit LocalDocsModel(QObject *parent = nullptr);
|
|
|
|
int rowCount(const QModelIndex & = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
2023-06-03 14:08:59 +00:00
|
|
|
void addCollectionItem(const CollectionItem &item);
|
2023-05-23 02:13:42 +00:00
|
|
|
void handleCollectionListUpdated(const QList<CollectionItem> &collectionList);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QList<CollectionItem> m_collectionList;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LOCALDOCSMODEL_H
|