From: Olivier Goffart Date: Wed, 21 Oct 2015 14:01:44 +0000 (+0200) Subject: SyncEngine: keep a static pointer to the codec X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1522 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cf242871eaee45a290a241535fb6c8588ced787c;p=nextcloud-desktop.git SyncEngine: keep a static pointer to the codec The QTextCodec for UTF-8 is not going to change during the application life time. So no need to look it up for every file --- diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 0588364bb..7b8f3e144 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -298,7 +298,7 @@ int SyncEngine::treewalkFile( TREE_WALK_FILE *file, bool remote ) if( ! file ) return -1; QTextCodec::ConverterState utf8State; - QTextCodec *codec = QTextCodec::codecForName("UTF-8"); + static QTextCodec *codec = QTextCodec::codecForName("UTF-8"); Q_ASSERT(codec); QString fileUtf8 = codec->toUnicode(file->path, qstrlen(file->path), &utf8State); QString renameTarget;