Skip to content

Commit

Permalink
Fix: 2022-01-16
Browse files Browse the repository at this point in the history
  • Loading branch information
horsicq committed Jan 15, 2022
1 parent 2a78b79 commit dad7293
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions xbinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2131,13 +2131,15 @@ QList<XBinary::MS_RECORD> XBinary::multiSearch_allStrings(qint64 nOffset,qint64
bool bANSICodec=false;

// TODO Check Qt6
#if (QT_VERSION_MAJOR<6)
QTextCodec *pCodec=nullptr;

if(ssOptions.sANSICodec!="")
{
bANSICodec=true;
pCodec=QTextCodec::codecForName(ssOptions.sANSICodec.toLatin1().data());
}
#endif

qint64 _nSize=nSize;
qint64 _nOffset=nOffset;
Expand Down Expand Up @@ -2320,7 +2322,11 @@ QList<XBinary::MS_RECORD> XBinary::multiSearch_allStrings(qint64 nOffset,qint64
{
// TODO Check Qt6
QByteArray baString=QByteArray(pAnsiBuffer,nCurrentAnsiSize);
#if (QT_VERSION_MAJOR<6)
sString=pCodec->toUnicode(baString);
#else
sString=QString::fromLatin1(baString); // TODO
#endif
}

bool bAdd=true;
Expand Down
2 changes: 2 additions & 0 deletions xbinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
#include <QtEndian>
#if (QT_VERSION_MAJOR<6)
#include <QTextCodec> // Qt5 Compat
#endif
#if (QT_VERSION_MAJOR<5) // TODO Check
#include <QRegExp>
#else
Expand Down
2 changes: 1 addition & 1 deletion xbinary.pri
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
#greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat

INCLUDEPATH += $$PWD
DEPENDPATH += $$PWD
Expand Down

0 comments on commit dad7293

Please sign in to comment.