Skip to content

Commit

Permalink
opt: remove qtextcodec dsl (#2059)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang authored Jan 3, 2025
1 parent 62e7d42 commit 3d809b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/dict/dsl_details.cc
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,7 @@ DslScanner::DslScanner( string const & fileName ):
}
}

codec = QTextCodec::codecForName( getEncodingNameFor( encoding ) );

qDebug() << "DSL encoding ->" << codec->name();
qDebug() << "DSL encoding:" << getEncodingNameFor( encoding );

if ( gzrewind( f ) ) {
gzclose( f );
Expand Down Expand Up @@ -1039,7 +1037,7 @@ bool DslScanner::readNextLine( std::u32string & out, size_t & offset, bool only_
if ( pos == -1 ) {
return false;
}
QString line = codec->toUnicode( readBufferPtr, pos );
QString line = Iconv::toQString( getEncodingNameFor( encoding ), readBufferPtr, pos );
line = Utils::rstrip( line );

if ( pos > readBufferLeft ) {
Expand Down
2 changes: 0 additions & 2 deletions src/dict/dsl_details.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <zlib.h>
#include "dictionary.hh"
#include "iconv.hh"
#include <QtCore5Compat/QTextCodec>
#include <QByteArray>
#include "text.hh"

Expand Down Expand Up @@ -102,7 +101,6 @@ class DslScanner
{
gzFile f;
Encoding encoding;
QTextCodec * codec;
std::u32string dictionaryName;
std::u32string langFrom, langTo;
std::u32string soundDictionary;
Expand Down

0 comments on commit 3d809b7

Please sign in to comment.