gpt4all/gpt4all-chat/localdocs.h
Jared Van Bortel c622921894
improve mixpanel usage statistics (#2238)
Other changes:
- Always display first start dialog if privacy options are unset (e.g. if the user closed GPT4All without selecting them)
- LocalDocs scanQueue is now always deferred
- Fix a potential crash in magic_match
- LocalDocs indexing is now started after the first start dialog is dismissed so usage stats are included

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
2024-04-25 13:16:52 -04:00

45 lines
1.1 KiB
C++

#ifndef LOCALDOCS_H
#define LOCALDOCS_H
#include "localdocsmodel.h"
#include "database.h"
#include <QObject>
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