Commit 08905bf4 authored by Tomaz  Canabrava's avatar Tomaz Canabrava Committed by Tomaz Canabrava
Browse files

Simplify match of files with space

parent 09473afc
...@@ -519,7 +519,6 @@ void FileFilter::HotSpot::activate(QObject *) ...@@ -519,7 +519,6 @@ void FileFilter::HotSpot::activate(QObject *)
QString createFileRegex(const QStringList &patterns) QString createFileRegex(const QStringList &patterns)
{ {
const QString filePattern = QStringLiteral(R"RG([A-Za-z0-9\._\-~]+)RG"); const QString filePattern = QStringLiteral(R"RG([A-Za-z0-9\._\-~]+)RG");
const QString filePatternSpa = QStringLiteral(R"RG([A-Za-z0-9\._\-~\s]+)RG");
const QString pathPattern QStringLiteral(R"RG(([A-Za-z0-9\._\-/]+/))RG"); const QString pathPattern QStringLiteral(R"RG(([A-Za-z0-9\._\-/]+/))RG");
QStringList suffixes = patterns.filter(QRegularExpression(QStringLiteral("^\\*") + filePattern + QStringLiteral("$"))); QStringList suffixes = patterns.filter(QRegularExpression(QStringLiteral("^\\*") + filePattern + QStringLiteral("$")));
...@@ -569,7 +568,9 @@ FileFilter::FileFilter(Session *session) : ...@@ -569,7 +568,9 @@ FileFilter::FileFilter(Session *session) :
const QString regex = QLatin1String("(\\b") + fileRegex + QLatin1String("\\b)") // file names with no spaces const QString regex = QLatin1String("(\\b") + fileRegex + QLatin1String("\\b)") // file names with no spaces
+ QLatin1Char('|') + QLatin1Char('|')
+ QLatin1String("('") + fileRegex + QLatin1String("')"); // file names with spaces + QLatin1String("'[^']*'")
+ QLatin1Char('|')// file names with spaces denoted by single quote
+ QLatin1String(R"RGX("[^"]*")RGX"); // file names with spaces denoted by double quotes
re.setPattern(regex); re.setPattern(regex);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment