Utils: Split FilePath::fileName

Into the regular case, and a fileNameWithPathComponents() function
handling the rarely used case with argument.

This saves a few cycles in the regular case and makes the function
usable by member function pointer in e.g. Utils::transform.

Change-Id: Ic4469198c3f8a44f59e50d70e67b864d876700d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-08-14 10:49:09 +02:00
parent 1ca91b16a0
commit e027ed5e96
3 changed files with 11 additions and 3 deletions

View File

@@ -80,7 +80,8 @@ public:
QString toUserOutput() const;
QString shortNativePath() const;
QString fileName(int pathComponents = 0) const;
QString fileName() const;
QString fileNameWithPathComponents(int pathComponents) const;
bool exists() const;
bool isWritablePath() const;