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
This commit is contained in:
2022-05-29 15:46:06 +02:00
parent 483ea04638
commit b6926d510f
4 changed files with 32 additions and 7 deletions

View File

@ -5,11 +5,12 @@
#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);
@ -20,8 +21,6 @@ class FileSaver
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