Replace IPathMatcher stuff with Filter
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@@ -12,8 +12,6 @@
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
#include <pathmatcher/RegexpMatcher.h>
|
||||
|
||||
class LinkTask : public Task {
|
||||
Q_OBJECT
|
||||
|
||||
@@ -27,7 +25,7 @@ class LinkTask : public Task {
|
||||
|
||||
~LinkTask() { delete m_lnk; }
|
||||
|
||||
void matcher(IPathMatcher::Ptr filter) { m_lnk->matcher(filter); }
|
||||
void matcher(Filter filter) { m_lnk->matcher(filter); }
|
||||
|
||||
void linkRecursively(bool recursive)
|
||||
{
|
||||
@@ -190,7 +188,7 @@ class FileSystemTest : public QObject {
|
||||
qDebug() << tempDir.path();
|
||||
qDebug() << target_dir.path();
|
||||
FS::copy c(folder, target_dir.path());
|
||||
RegexpMatcher::Ptr re = std::make_shared<RegexpMatcher>("[.]?mcmeta");
|
||||
auto re = Filters::regexp(QRegularExpression("/[.]?mcmeta$"));
|
||||
c.matcher(re);
|
||||
c();
|
||||
|
||||
@@ -223,7 +221,7 @@ class FileSystemTest : public QObject {
|
||||
qDebug() << tempDir.path();
|
||||
qDebug() << target_dir.path();
|
||||
FS::copy c(folder, target_dir.path());
|
||||
RegexpMatcher::Ptr re = std::make_shared<RegexpMatcher>("[.]?mcmeta");
|
||||
auto re = Filters::regexp(QRegularExpression("/[.]?mcmeta$"));
|
||||
c.matcher(re);
|
||||
c.whitelist(true);
|
||||
c();
|
||||
@@ -415,7 +413,7 @@ class FileSystemTest : public QObject {
|
||||
qDebug() << target_dir.path();
|
||||
|
||||
LinkTask lnk_tsk(folder, target_dir.path());
|
||||
RegexpMatcher::Ptr re = std::make_shared<RegexpMatcher>("[.]?mcmeta");
|
||||
auto re = Filters::regexp(QRegularExpression("/[.]?mcmeta$"));
|
||||
lnk_tsk.matcher(re);
|
||||
lnk_tsk.linkRecursively(true);
|
||||
connect(&lnk_tsk, &Task::finished,
|
||||
@@ -461,7 +459,7 @@ class FileSystemTest : public QObject {
|
||||
qDebug() << target_dir.path();
|
||||
|
||||
LinkTask lnk_tsk(folder, target_dir.path());
|
||||
RegexpMatcher::Ptr re = std::make_shared<RegexpMatcher>("[.]?mcmeta");
|
||||
auto re = Filters::regexp(QRegularExpression("/[.]?mcmeta$"));
|
||||
lnk_tsk.matcher(re);
|
||||
lnk_tsk.linkRecursively(true);
|
||||
lnk_tsk.whitelist(true);
|
||||
|
||||
Reference in New Issue
Block a user