summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qiconvcodec_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-07-20 20:49:13 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-31 11:12:00 +0200
commit46e3aa29081e0c043d745e590b9d3b9220f8d471 (patch)
treed5f5adf56ec334b88a02be5afcc7eda85c588fcd /src/corelib/codecs/qiconvcodec_p.h
parentd4510d0d31759a7b5993d3b9e710642a9d340f53 (diff)
Lazily initialize iconv in the iconv codec
Avoid dlopen'ing libiconv and initializing it's members until the codec gets used for the first time. This avoids some memory and startup time overhead in case we can use the utf8 codec instead of iconv. It also removes a circular dependency between codec initialization during app startup. Change-Id: I119c010c288dc59ab32279d8a213ae1f4347cace Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/codecs/qiconvcodec_p.h')
-rw-r--r--src/corelib/codecs/qiconvcodec_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/codecs/qiconvcodec_p.h b/src/corelib/codecs/qiconvcodec_p.h
index efe3b4b5f7..4b8bc68603 100644
--- a/src/corelib/codecs/qiconvcodec_p.h
+++ b/src/corelib/codecs/qiconvcodec_p.h
@@ -80,7 +80,8 @@ public:
QByteArray name() const;
int mibEnum() const;
- static iconv_t createIconv_t(const char *to, const char *from);
+ void init() const;
+ iconv_t createIconv_t(const char *to, const char *from) const;
class IconvState
{