summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystementry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qfilesystementry.cpp')
-rw-r--r--src/corelib/io/qfilesystementry.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index bf63e72a79..21c6fd89a9 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -172,6 +172,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
}
}
@@ -289,9 +295,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