forked from qt-creator/qt-creator
Utils: Re-do FilePath::toUserOutput()
Use the FilePath's knowledge of the target os instead of always using the host os. Change-Id: I996db68486f4616c8636ae501cce7a778269f1cf Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -477,12 +477,14 @@ void FileUtils::setDeviceFileHooks(const DeviceFileHooks &hooks)
|
||||
}
|
||||
|
||||
/// \returns a QString to display to the user
|
||||
/// Converts the separators to the native format
|
||||
/// Converts the separators to the native format of the system
|
||||
/// this path belongs to.
|
||||
QString FilePath::toUserOutput() const
|
||||
{
|
||||
if (m_scheme.isEmpty())
|
||||
return QDir::toNativeSeparators(m_data);
|
||||
return toString();
|
||||
FilePath tmp = *this;
|
||||
if (osType() == OsTypeWindows)
|
||||
tmp.m_data.replace('/', '\\');
|
||||
return tmp.toString();
|
||||
}
|
||||
|
||||
QString FilePath::fileName() const
|
||||
|
||||
Reference in New Issue
Block a user