kaidan/0001-Support-ZXing-2.0.patch

32 lines
1.1 KiB
Diff

From c92fe3125c08e61b454b41f151b435a6a9e6da4b Mon Sep 17 00:00:00 2001
From: Volker Krause <vkrause@kde.org>
Date: Wed, 4 Jan 2023 17:28:31 +0100
Subject: [PATCH] Support ZXing 2.0
An alternative approach going forward might be replacing the entire direct
ZXing use and video stream processing by KF::Prison. Avoids duplicated
maintenance, but adds a new dependency.
---
src/QrCodeDecoder.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/QrCodeDecoder.cpp b/src/QrCodeDecoder.cpp
index a7b0cf5..86d1e7b 100644
--- a/src/QrCodeDecoder.cpp
+++ b/src/QrCodeDecoder.cpp
@@ -90,7 +90,11 @@ void QrCodeDecoder::decodeImage(const QImage &image)
// If a QR code could be found and decoded, emit a signal with the decoded string.
// Otherwise, emit a signal for failed decoding.
if (result.isValid())
+#if ZXING_VERSION < QT_VERSION_CHECK(2, 0, 0)
emit decodingSucceeded(QString::fromStdString(TextUtfEncoding::ToUtf8(result.text())));
+#else
+ emit decodingSucceeded(QString::fromStdString(result.text()));
+#endif
else
emit decodingFailed();
}
--
2.39.1