looqs/shared/indexsyncer.h
Albert S abc126548b shared: Introduce IndexSyncer, containing logic of cli/CommandUpdate
IndexSyncer contains most of the logic of cli/CommandUpdate, so
it can be reused in the GUI where we need it too
2022-06-04 17:09:26 +02:00

37 lines
867 B
C++

#ifndef INDEXSYNCER_H
#define INDEXSYNCER_H
#include "sqlitedbservice.h"
class IndexSyncer : public QObject
{
Q_OBJECT
private:
SqliteDbService *dbService = nullptr;
bool keepGoing = true;
bool removeDeletedFromIndex = true;
bool dryRun = false;
bool verbose = false;
QString pattern;
public:
IndexSyncer(SqliteDbService &dbService);
public slots:
void sync();
void setDryRun(bool dryRun);
void setVerbose(bool verbose);
void setKeepGoing(bool keepGoing);
void setRemoveDeletedFromIndex(bool removeDeletedFromIndex);
void setPattern(QString pattern);
signals:
void error(QString error);
void removed(QString path);
void removedDryRun(QString path);
void updatedDryRun(QString path);
void updated(QString path);
void finished(unsigned int totalUpdated, unsigned int totalDeleted, unsigned int totalErrored);
};
#endif // INDEXSYNCER_H