#4555 Fix errors in filter behavior.

Handle double separators
Handle */ pathfilter correctly (no recursive search)
This commit is contained in:
Jacob Støren
2019-08-15 16:08:38 +02:00
parent e1c061fd15
commit cd5943a39c
4 changed files with 47 additions and 30 deletions

View File

@@ -112,3 +112,19 @@ std::pair<QString, QString> RiaFilePathTools::toFolderAndFileName(const QString&
return std::make_pair("", absFN);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaFilePathTools::removeDuplicatePathSeparators(const QString& path)
{
QString correctedPath = path;
int len;
do
{
len = correctedPath.size();
correctedPath.replace(QString("%1%1").arg(SEPARATOR), SEPARATOR);
} while (correctedPath.size() != len);
return correctedPath;
}

View File

@@ -40,4 +40,5 @@ public:
static bool equalPaths(const QString& path1, const QString& path2);
static QString canonicalPath(const QString& path);
static std::pair<QString, QString> toFolderAndFileName(const QString& absFileName);
static QString removeDuplicatePathSeparators(const QString& path);
};