Utils: Make path cleaning platform agnostic

Unfortunately, QDir::cleanPath() only cleans according to the rules
of the host system, which can be wrong in remote setups.

As the implementation is not accessible/tweakable from the outside,
copy the relevant code and remove the platform #ifdef's.

Change-Id: Ife9a925412a12d3cef21ed3721a387c61c152ddf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-07-14 15:04:44 +02:00
parent 712311b20c
commit dd585c601c
5 changed files with 256 additions and 31 deletions

View File

@@ -268,7 +268,10 @@ private:
QTCREATOR_UTILS_EXPORT QTextStream &operator<<(QTextStream &s, const FilePath &fn);
bool isRelativePathHelper(const QString &path, OsType osType);
QString doCleanPath(const QString &input);
// For testing
QTCREATOR_UTILS_EXPORT QString doCleanPath(const QString &input);
QTCREATOR_UTILS_EXPORT QString cleanPathHelper(const QString &path);
} // namespace Utils