diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2010-10-14 13:06:20 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2010-10-20 13:35:05 (GMT) |
commit | 4bdf081da0276f55662de826568441ca0e85e877 (patch) | |
tree | b632860ecbc420d322497d029d4a3c61235ce270 /src/corelib/io/qfsfileengine.cpp | |
parent | 366d2ed09ebf5aa27171a46d723497e5aaa5dd06 (diff) | |
download | Qt-4bdf081da0276f55662de826568441ca0e85e877.zip Qt-4bdf081da0276f55662de826568441ca0e85e877.tar.gz Qt-4bdf081da0276f55662de826568441ca0e85e877.tar.bz2 |
Move QDir::fromNativeSeparators call to the QFileSystemEntry constructor
The m_filePath should always have / as the separator, while m_nativeFilePath
should always have the native separator.
Almost every place the constructor is used, the path could be one passed
into an API from code outside our control.
So it's easier to do the path conversion in the constructor than to have to
remember to call fromNativeSeparators in every place a QFileSystemEntry is
constructed (especially since unix tests won't reveal any error)
Reviewed-By: joao
Diffstat (limited to 'src/corelib/io/qfsfileengine.cpp')
-rw-r--r-- | src/corelib/io/qfsfileengine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 9c8df39..5491caf 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -140,7 +140,7 @@ QFSFileEngine::QFSFileEngine(const QString &file) : QAbstractFileEngine(*new QFSFileEnginePrivate) { Q_D(QFSFileEngine); - d->fileEntry = QFileSystemEntry(QDir::fromNativeSeparators(file)); + d->fileEntry = QFileSystemEntry(file); } /*! @@ -189,7 +189,7 @@ void QFSFileEngine::setFileName(const QString &file) { Q_D(QFSFileEngine); d->init(); - d->fileEntry = QFileSystemEntry(QDir::fromNativeSeparators(file)); + d->fileEntry = QFileSystemEntry(file); } /*! |