diff --git a/src/plugins/qmldesigner/libs/designercore/projectstorage/projectstorageupdater.cpp b/src/plugins/qmldesigner/libs/designercore/projectstorage/projectstorageupdater.cpp index cfaff3d942a..9089efc8c27 100644 --- a/src/plugins/qmldesigner/libs/designercore/projectstorage/projectstorageupdater.cpp +++ b/src/plugins/qmldesigner/libs/designercore/projectstorage/projectstorageupdater.cpp @@ -401,12 +401,12 @@ bool isNotExisting(ProjectStorageUpdater::FileState state) return !isExisting(state); } -Utils::PathString directoryName(std::string_view directoryPath) +std::string_view directoryName(std::string_view directoryPath) { - using namespace std::views; - auto isNotSlash = std::bind_front(std::ranges::not_equal_to{}, '/'); - auto directoryName = directoryPath | reverse | take_while(isNotSlash) | reverse; - return {directoryName.begin(), directoryName.end()}; + auto last = directoryPath.rfind('/'); + if (last == std::string_view::npos) + return {""}; + return directoryPath.substr(last + 1); } } // namespace