From 49b1665ed1ea71ed23019e50423060e66daa25f0 Mon Sep 17 00:00:00 2001 From: HFTrader Date: Wed, 3 Mar 2021 19:17:19 -0600 Subject: [PATCH] Changed QChar.toAscii() to QChar.toLatin1() so the code to works with Qt 5 --- cpp/diff_match_patch.cpp | 4 ++-- cpp/diff_match_patch_test.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/diff_match_patch.cpp b/cpp/diff_match_patch.cpp index 64f270c..2dc0f10 100644 --- a/cpp/diff_match_patch.cpp +++ b/cpp/diff_match_patch.cpp @@ -1383,7 +1383,7 @@ QList diff_match_patch::diff_fromDelta(const QString &text1, // Each token begins with a one character parameter which specifies the // operation of this token (delete, insert, equality). QString param = safeMid(token, 1); - switch (token[0].toAscii()) { + switch (token[0].toLatin1()) { case '+': param = QUrl::fromPercentEncoding(qPrintable(param)); diffs.append(Diff(INSERT, param)); @@ -2074,7 +2074,7 @@ QList diff_match_patch::patch_fromText(const QString &textline) { text.removeFirst(); continue; } - sign = text.front()[0].toAscii(); + sign = text.front()[0].toLatin1(); line = safeMid(text.front(), 1); line = line.replace("+", "%2B"); // decode would change all "+" to " " line = QUrl::fromPercentEncoding(qPrintable(line)); diff --git a/cpp/diff_match_patch_test.cpp b/cpp/diff_match_patch_test.cpp index f75b1cd..1e4a75d 100644 --- a/cpp/diff_match_patch_test.cpp +++ b/cpp/diff_match_patch_test.cpp @@ -16,7 +16,7 @@ * limitations under the License. */ -// Code known to compile and run with Qt 4.3 through Qt 4.7. +// Code known to compile and run with Qt 5 #include #include "diff_match_patch.h" #include "diff_match_patch_test.h" @@ -1055,7 +1055,7 @@ void diff_match_patch_test::assertEquals(const QString &strCase, const QMap