forked from qt-creator/qt-creator
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 <eike.ziller@qt.io>
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user