summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystementry.cpp
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-09-01 10:53:04 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2010-09-01 12:26:08 (GMT)
commit88ae6dc40e6f725a3dc15056a0b9e8f00d727c09 (patch)
tree8a578fb7dc1b164bfd417f2c101a444078cb4850 /src/corelib/io/qfilesystementry.cpp
parentd3b152ba1e3cd38dd675c801474105d518bacb44 (diff)
downloadQt-88ae6dc40e6f725a3dc15056a0b9e8f00d727c09.zip
Qt-88ae6dc40e6f725a3dc15056a0b9e8f00d727c09.tar.gz
Qt-88ae6dc40e6f725a3dc15056a0b9e8f00d727c09.tar.bz2
Breaking changes to QFileSystemEntry's constructors
Since we are using a QString for the native file path on windows, the constructors we had on other platforms didn't make sense: we can't have two constructors taking a single QString parameter, and it would be error prone to have the two argument constructor (taking two QString parameters, on Windows) change the meaning of the first argument. This patch introduces a typedef for the NativePath type being used; the constructor taking the native path now requires a dummy parameter that makes the intent expliciti; and the order of the arguments on the constructor taking both native and Qt paths had the order switched. Done-with: João Abecasis
Diffstat (limited to 'src/corelib/io/qfilesystementry.cpp')
-rw-r--r--src/corelib/io/qfilesystementry.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp
index a32e22f..c3ada48 100644
--- a/src/corelib/io/qfilesystementry.cpp
+++ b/src/corelib/io/qfilesystementry.cpp
@@ -89,8 +89,7 @@ QFileSystemEntry::QFileSystemEntry(const QString &filePath)
{
}
-#ifndef Q_OS_WIN
-QFileSystemEntry::QFileSystemEntry(const QByteArray &nativeFilePath)
+QFileSystemEntry::QFileSystemEntry(const NativePath &nativeFilePath, FromNativePath /* dummy */)
: m_nativeFilePath(nativeFilePath),
m_lastSeparator(-2),
m_firstDotInFileName(-2),
@@ -98,7 +97,7 @@ QFileSystemEntry::QFileSystemEntry(const QByteArray &nativeFilePath)
{
}
-QFileSystemEntry::QFileSystemEntry(const QByteArray &nativeFilePath, const QString &filePath)
+QFileSystemEntry::QFileSystemEntry(const QString &filePath, const NativePath &nativeFilePath)
: m_filePath(filePath),
m_nativeFilePath(nativeFilePath),
m_lastSeparator(-2),
@@ -106,7 +105,6 @@ QFileSystemEntry::QFileSystemEntry(const QByteArray &nativeFilePath, const QStri
m_lastDotInFileName(0)
{
}
-#endif
QString QFileSystemEntry::filePath() const
{
@@ -114,11 +112,7 @@ QString QFileSystemEntry::filePath() const
return m_filePath;
}
-#ifndef Q_OS_WIN
-QByteArray QFileSystemEntry::nativeFilePath() const
-#else
-QString QFileSystemEntry::nativeFilePath() const
-#endif
+QFileSystemEntry::NativePath QFileSystemEntry::nativeFilePath() const
{
resolveNativeFilePath();
return m_nativeFilePath;