mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-18 03:25:46 +00:00
32 lines
783 B
C++
32 lines
783 B
C++
#ifndef LOCALDOCSMODEL_H
|
|
#define LOCALDOCSMODEL_H
|
|
|
|
#include <QAbstractListModel>
|
|
#include "database.h"
|
|
|
|
class LocalDocsModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum Roles {
|
|
CollectionRole = Qt::UserRole + 1,
|
|
FolderPathRole,
|
|
InstalledRole
|
|
};
|
|
|
|
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:
|
|
void addCollectionItem(const CollectionItem &item);
|
|
void handleCollectionListUpdated(const QList<CollectionItem> &collectionList);
|
|
|
|
private:
|
|
QList<CollectionItem> m_collectionList;
|
|
};
|
|
|
|
#endif // LOCALDOCSMODEL_H
|