diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-02-15 15:16:16 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-02-15 15:18:00 (GMT) |
commit | 7687b9dd937d8824ef8cbd69385ebe5b81b3885d (patch) | |
tree | 6d52a578a355e963b05b5a52a6205c270b0f9085 /src/corelib/codecs | |
parent | 63e201038569cfbaf95d3191ae001379ca3026bd (diff) | |
download | Qt-7687b9dd937d8824ef8cbd69385ebe5b81b3885d.zip Qt-7687b9dd937d8824ef8cbd69385ebe5b81b3885d.tar.gz Qt-7687b9dd937d8824ef8cbd69385ebe5b81b3885d.tar.bz2 |
QTextCodec::codecForName. Insert in the cache in all cases.
Reviewed-by: Gabriel
Diffstat (limited to 'src/corelib/codecs')
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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<QByteArray> aliases = cursor->aliases(); for (int y = 0; y < aliases.size(); ++y) if (nameMatch(aliases.at(y), name)) { |