mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
d3d777bc51
Also use qGuiApp instead of qApp. Signed-off-by: Jared Van Bortel <jared@nomic.ai>
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#ifndef LOCALDOCS_H
|
|
#define LOCALDOCS_H
|
|
|
|
#include "localdocsmodel.h" // IWYU pragma: keep
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
|
|
class Database;
|
|
|
|
class LocalDocs : public QObject
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(LocalDocsModel *localDocsModel READ localDocsModel NOTIFY localDocsModelChanged)
|
|
|
|
public:
|
|
static LocalDocs *globalInstance();
|
|
|
|
LocalDocsModel *localDocsModel() const { return m_localDocsModel; }
|
|
|
|
Q_INVOKABLE void addFolder(const QString &collection, const QString &path);
|
|
Q_INVOKABLE void removeFolder(const QString &collection, const QString &path);
|
|
|
|
Database *database() const { return m_database; }
|
|
|
|
public Q_SLOTS:
|
|
void handleChunkSizeChanged();
|
|
void aboutToQuit();
|
|
|
|
Q_SIGNALS:
|
|
void requestStart();
|
|
void requestAddFolder(const QString &collection, const QString &path, bool fromDb);
|
|
void requestRemoveFolder(const QString &collection, const QString &path);
|
|
void requestChunkSizeChange(int chunkSize);
|
|
void localDocsModelChanged();
|
|
|
|
private:
|
|
LocalDocsModel *m_localDocsModel;
|
|
Database *m_database;
|
|
|
|
private:
|
|
explicit LocalDocs();
|
|
friend class MyLocalDocs;
|
|
};
|
|
|
|
#endif // LOCALDOCS_H
|