shared: Indexer: Use WildcardMatcher to ignore paths
This commit is contained in:
bovenliggende
a3666f283e
commit
c2bd1b526b
@ -1,5 +1,6 @@
|
|||||||
#include "indexer.h"
|
#include "indexer.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
|
#include "wildcardmatcher.h"
|
||||||
|
|
||||||
Indexer::Indexer(SqliteDbService &db)
|
Indexer::Indexer(SqliteDbService &db)
|
||||||
{
|
{
|
||||||
@ -17,8 +18,14 @@ void Indexer::beginIndexing()
|
|||||||
this->currentIndexResult.begin = QDateTime::currentDateTime();
|
this->currentIndexResult.begin = QDateTime::currentDateTime();
|
||||||
QVector<QString> dirs;
|
QVector<QString> dirs;
|
||||||
|
|
||||||
|
WildcardMatcher wildcardMatcher;
|
||||||
|
wildcardMatcher.setPatterns(this->ignorePattern);
|
||||||
for(QString &path : this->pathsToScan)
|
for(QString &path : this->pathsToScan)
|
||||||
{
|
{
|
||||||
|
if(wildcardMatcher.match(path))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
QFileInfo info{path};
|
QFileInfo info{path};
|
||||||
if(info.isDir())
|
if(info.isDir())
|
||||||
{
|
{
|
||||||
|
Laden…
Verwijs in nieuw issue
Block a user