diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2010-08-30 09:36:05 (GMT) |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2010-08-30 12:00:10 (GMT) |
commit | 5dfcf2c6778e6852b3d1a2f9c6cc4c9e7c8a5d3b (patch) | |
tree | 219cb71c87025ef6e945ee41add1e178fb6c393f | |
parent | b56fad9c12615ac135a36a468c020906f383a0d1 (diff) | |
download | Qt-5dfcf2c6778e6852b3d1a2f9c6cc4c9e7c8a5d3b.zip Qt-5dfcf2c6778e6852b3d1a2f9c6cc4c9e7c8a5d3b.tar.gz Qt-5dfcf2c6778e6852b3d1a2f9c6cc4c9e7c8a5d3b.tar.bz2 |
Small changes to QFileSystemEntry
* Added default constructor.
* Made single-argument constructors explicit
* Converted bit-field data to "proper" variables - the bit-fields may
have been premature optimization and it may even turn out to not
relevant to keep this cache.
Reviewed-by: Thomas Zander
-rw-r--r-- | src/corelib/io/qfilesystementry.cpp | 7 | ||||
-rw-r--r-- | src/corelib/io/qfilesystementry_p.h | 11 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/corelib/io/qfilesystementry.cpp b/src/corelib/io/qfilesystementry.cpp index 5858ab3..04ad388 100644 --- a/src/corelib/io/qfilesystementry.cpp +++ b/src/corelib/io/qfilesystementry.cpp @@ -45,6 +45,13 @@ QT_BEGIN_NAMESPACE +QFileSystemEntry::QFileSystemEntry() + : m_lastSeparator(0), + m_firstDotInFileName(0), + m_lastDotInFileName(0) +{ +} + QFileSystemEntry::QFileSystemEntry(const QString &filePath) : m_filePath(filePath), m_lastSeparator(-2), diff --git a/src/corelib/io/qfilesystementry_p.h b/src/corelib/io/qfilesystementry_p.h index 68af24d..ae2071a 100644 --- a/src/corelib/io/qfilesystementry_p.h +++ b/src/corelib/io/qfilesystementry_p.h @@ -61,8 +61,9 @@ QT_BEGIN_NAMESPACE class QFileSystemEntry { public: - QFileSystemEntry(const QString &filePath); - QFileSystemEntry(const QByteArray &nativeFilePath); + QFileSystemEntry(); + explicit QFileSystemEntry(const QString &filePath); + explicit QFileSystemEntry(const QByteArray &nativeFilePath); QFileSystemEntry(const QByteArray &nativeFilePath, const QString &filePath); QString filePath() const; @@ -88,9 +89,9 @@ private: mutable QString m_filePath; // always has slashes as separator mutable QByteArray m_nativeFilePath; // native encoding and separators - mutable int m_lastSeparator : 16; // index in m_filePath of last separator - mutable int m_firstDotInFileName : 11; // index after m_filePath for first dot (.) - mutable int m_lastDotInFileName : 5; // index after m_firstDotInFileName for last dot (.) + mutable qint16 m_lastSeparator; // index in m_filePath of last separator + mutable qint16 m_firstDotInFileName; // index after m_filePath for first dot (.) + mutable qint16 m_lastDotInFileName; // index after m_firstDotInFileName for last dot (.) }; QT_END_NAMESPACE |