From 5dfcf2c6778e6852b3d1a2f9c6cc4c9e7c8a5d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 30 Aug 2010 11:36:05 +0200 Subject: 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 --- src/corelib/io/qfilesystementry.cpp | 7 +++++++ 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 -- cgit v0.12