From 7687b9dd937d8824ef8cbd69385ebe5b81b3885d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 15 Feb 2010 16:16:16 +0100 Subject: QTextCodec::codecForName. Insert in the cache in all cases. Reviewed-by: Gabriel --- src/corelib/codecs/qtextcodec.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index ef7528d..c0aa342 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -975,8 +975,10 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name) for (int i = 0; i < all->size(); ++i) { QTextCodec *cursor = all->at(i); - if (nameMatch(cursor->name(), name)) + if (nameMatch(cursor->name(), name)) { + cache.insert(name, cursor); return cursor; + } QList aliases = cursor->aliases(); for (int y = 0; y < aliases.size(); ++y) if (nameMatch(aliases.at(y), name)) { -- cgit v0.12