From ec9e85656339dbc9e6918a1369c981cece7bc97d Mon Sep 17 00:00:00 2001 From: Karsten Heimrich Date: Mon, 3 May 2021 14:40:53 +0200 Subject: Fix QSaveFile and QTemporaryFile issues with windows network shares The commit amends commit 3966b571 to take UNC prefix into account as well. Fixes the weird file name output as reported in QTBUG-74291 and QTBUG-83365. Replace manual separator normalizing in qt_cleanPath(), this is another spot where UNC prefix handling needs to be applied. Also make QTemporaryFile operate on '/' as file separators to fix creating both file types with native path separators on network shares. Fixes: QTBUG-74291 Fixes: QTBUG-76228 Fixes: QTBUG-83365 Pick-to: 5.15 6.0 6.1 Change-Id: Iff8d26b994bf4194c074cd5c996cda3934297fa5 Reviewed-by: Edward Welbourne Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira --- src/corelib/io/qfilesystementry.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/corelib/io/qfilesystementry.cpp') diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp index 9b474b25b1..83f8a86439 100644 --- a/src/corelib/io/qfilesystementry.cpp +++ b/src/corelib/io/qfilesystementry.cpp @@ -142,12 +142,6 @@ void QFileSystemEntry::resolveFilePath() const if (m_filePath.isEmpty() && !m_nativeFilePath.isEmpty()) { #if defined(QFILESYSTEMENTRY_NATIVE_PATH_IS_UTF16) m_filePath = QDir::fromNativeSeparators(m_nativeFilePath); -#ifdef Q_OS_WIN - if (m_filePath.startsWith(QLatin1String("//?/UNC/"))) - m_filePath = m_filePath.remove(2,6); - if (m_filePath.startsWith(QLatin1String("//?/"))) - m_filePath = m_filePath.remove(0,4); -#endif #else m_filePath = QDir::fromNativeSeparators(QFile::decodeName(m_nativeFilePath)); #endif -- cgit v1.2.3