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
This commit is contained in:
Olivier Goffart 2015-10-21 16:01:44 +02:00
parent 597d36dcf2
commit cf242871ea

View file

@ -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;