From 51f4d0c1926335977c2aa814746a61b194d2f9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 22 Jul 2009 13:39:12 +0200 Subject: Prefer mutable over const_cast. Reviewed-by: Simon Hausmann Reviewed-by: Frans Englich --- src/corelib/io/qresource_iterator.cpp | 5 ++--- src/corelib/io/qresource_iterator_p.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qresource_iterator.cpp b/src/corelib/io/qresource_iterator.cpp index 7e22600..11f4acf 100644 --- a/src/corelib/io/qresource_iterator.cpp +++ b/src/corelib/io/qresource_iterator.cpp @@ -73,9 +73,8 @@ bool QResourceFileEngineIterator::hasNext() const return false; // Initialize and move to the next entry. - QResourceFileEngineIterator *that = const_cast(this); - that->entries = resource.children(); - that->index = 0; + entries = resource.children(); + index = 0; } return index < entries.size(); diff --git a/src/corelib/io/qresource_iterator_p.h b/src/corelib/io/qresource_iterator_p.h index b5e8382..5165157 100644 --- a/src/corelib/io/qresource_iterator_p.h +++ b/src/corelib/io/qresource_iterator_p.h @@ -71,8 +71,8 @@ public: QString currentFileName() const; private: - QStringList entries; - int index; + mutable QStringList entries; + mutable int index; }; QT_END_NAMESPACE -- cgit v0.12