#2755 Fix import dialog path filter matching

This commit is contained in:
Bjørn Erik Jensen 2018-04-19 12:03:24 +02:00
parent bc05621812
commit b3ee1c1f9b

View File

@ -419,7 +419,9 @@ QStringList RicFileHierarchyDialog::createNameFilterList(const QString &fileName
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RicFileHierarchyDialog::pathFilterMatch(const QString& pathFilter, const QString& relPath) bool RicFileHierarchyDialog::pathFilterMatch(const QString& pathFilter, const QString& relPath)
{ {
QRegExp regexp(pathFilter, Qt::CaseInsensitive, QRegExp::Wildcard); QString pattern = pathFilter;
if (relPath.endsWith(SEPARATOR) && !pathFilter.endsWith(SEPARATOR)) pattern += SEPARATOR;
QRegExp regexp(pattern, Qt::CaseInsensitive, QRegExp::Wildcard);
return regexp.exactMatch(relPath); return regexp.exactMatch(relPath);
} }