looqs/shared/filesaver.h
Albert S b6926d510f FileSaver: Don't add files in blacklisted paths
We now resolve symlinks when adding, so we can properly check
whether a path is excluded or not. This accidently also
helps with duplicates.

Excluded paths are hardcoded and can also be appended to
by the user using the settings.

Closes: #34
2022-06-04 17:09:26 +02:00

27 sor
794 B
C++

#ifndef FILESAVER_H
#define FILESAVER_H
#include <QSqlDatabase>
#include <QFileInfo>
#include "pagedata.h"
#include "filedata.h"
#include "sqlitedbservice.h"
#include "common.h"
class FileSaver
{
private:
SqliteDbService *dbService;
QStringList excludedPaths = Common::excludedPaths();
public:
FileSaver(SqliteDbService &dbService);
SaveFileResult addFile(QString path);
SaveFileResult updateFile(QString path);
SaveFileResult saveFile(const QFileInfo &fileInfo);
int processFiles(const QVector<QString> paths, std::function<SaveFileResult(QString path)> saverFunc,
bool keepGoing, bool verbose);
int addFiles(const QVector<QString> paths, bool keepGoing, bool verbose);
int updateFiles(const QVector<QString> paths, bool keepGoing, bool verbose);
};
#endif // FILESAVER_H