[Pkg-owncloud-commits] [owncloud-client] 120/484: SyncEngine: keep a static pointer to the codec

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit cf242871eaee45a290a241535fb6c8588ced787c
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Oct 21 16:01:44 2015 +0200

    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
---
 src/libsync/syncengine.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index 0588364..7b8f3e1 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list