From bf8bf1adc0784f8deb43c7299458b45c27d6082c Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 10 Jun 2022 13:26:46 +0200 Subject: [PATCH] Utils: Also use device name when trying to disambiguate path displays With two /tmp/foo.cpp from different devices there is no directly visible difference in the Open Documents. Adding the device path for remote cases introduces a difference. For local files there is no visible difference. Change-Id: I6f1632d6f51ff24573831af3161492989c5c0bec Reviewed-by: Eike Ziller --- src/libs/utils/filepath.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 1d469ec2ef4..14436bdc1d1 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -527,10 +527,11 @@ QString FilePath::fileNameWithPathComponents(int pathComponents) const ; } - // If there are no more slashes before the found one, return the entire string if (i > 0 && m_data.lastIndexOf(slash, i) != -1) return m_data.mid(component); - return m_data; + + // If there are no more slashes before the found one, return the entire string + return displayName(); } /// \returns the base name of the file without the path.