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
This commit is contained in:
36
shared/indexsyncer.h
Normal file
36
shared/indexsyncer.h
Normal file
@ -0,0 +1,36 @@
|
||||
#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
|
Fai riferimento in un nuovo problema
Block a user