diff options
Diffstat (limited to 'src/corelib/io/qfilesystementry.cpp')
-rw-r--r-- | src/corelib/io/qfilesystementry.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp index 709970e3ac..c590d81f7a 100644 --- a/src/corelib/io/qfilesystementry.cpp +++ b/src/corelib/io/qfilesystementry.cpp @@ -166,6 +166,12 @@ void QFileSystemEntry::resolveNativeFilePath() const m_nativeFilePath.remove(0,1); if (m_nativeFilePath.isEmpty()) m_nativeFilePath.append(QLatin1Char('.')); + // WinRT/MSVC2015 allows a maximum of 256 characters for a filepath + // unless //?/ is prepended which extends the rule to have a maximum + // of 256 characters in the filename plus the preprending path +#if _MSC_VER >= 1900 + m_nativeFilePath.prepend("\\\\?\\"); +#endif #endif } } @@ -283,9 +289,13 @@ bool QFileSystemEntry::isAbsolute() const bool QFileSystemEntry::isDriveRoot() const { resolveFilePath(); +#ifndef Q_OS_WINRT return (m_filePath.length() == 3 && m_filePath.at(0).isLetter() && m_filePath.at(1) == QLatin1Char(':') && m_filePath.at(2) == QLatin1Char('/')); +#else // !Q_OS_WINRT + return m_filePath == QDir::rootPath(); +#endif // !Q_OS_WINRT } #endif |