* Returns a slash plus the path to @p filePath relative to its parent directory @p parentDirectoryPath. * @param filePath the path to a file. * @param parentDirectoryPath the path to a parent directory of @p filePath without a trailing slash * (an empty string is the root directory path). */
| 88 | * (an empty string is the root directory path). |
| 89 | */ |
| 90 | QString removeDirectoryPrefix(QString filePath, const QString& parentDirectoryPath) |
| 91 | { |
| 92 | Q_ASSERT(filePath.startsWith(parentDirectoryPath)); |
| 93 | Q_ASSERT(filePath.size() > parentDirectoryPath.size()); |
| 94 | Q_ASSERT(filePath.at(parentDirectoryPath.size()) == QLatin1Char{'/'}); |
| 95 | filePath.remove(0, parentDirectoryPath.size()); |
| 96 | return filePath; |
| 97 | } |
| 98 | |
| 99 | class FileFinder |
| 100 | { |
no test coverage detected