[neon/forks/kaidan/Neon/release] debian/patches: split the qtcode update patch

Jonathan Esk-Riddell null at kde.org
Wed Feb 22 12:42:56 GMT 2023


Git commit 9334fd7f7375b78a2dcfb8b50663e5acd72dfddf by Jonathan Esk-Riddell.
Committed on 22/02/2023 at 12:42.
Pushed by jriddell into branch 'Neon/release'.

split the qtcode update patch

M  +0    -33   debian/patches/qrcode.diff
A  +22   -0    debian/patches/qrcode2.diff
M  +1    -0    debian/patches/series

https://invent.kde.org/neon/forks/kaidan/commit/9334fd7f7375b78a2dcfb8b50663e5acd72dfddf

diff --git a/debian/patches/qrcode.diff b/debian/patches/qrcode.diff
index 51d0aac..4b3cf4a 100644
--- a/debian/patches/qrcode.diff
+++ b/debian/patches/qrcode.diff
@@ -31,36 +31,3 @@ index b9c8743..1338308 100644
  		const ZXing::BitMatrix &bitMatrix = writer.encode(text.toStdWString(), edgePixelCount, edgePixelCount);
  		return toImage(bitMatrix);
  	} catch (const std::invalid_argument &e) {
-commit dc41a3f3850308d5204134ae08e66f20a58195f9
-Author: Melvin Keskin <melvo at olomono.de>
-Date:   Sun Mar 13 13:03:16 2022 +0100
-
-    QrCodeGenerator: Replace deprecated 'BarcodeFormat::QR_CODE' with 'BarcodeFormat::QRCode'
-
-diff --git a/src/QrCodeGenerator.cpp b/src/QrCodeGenerator.cpp
-index b9c8743..1338308 100644
---- a/src/QrCodeGenerator.cpp
-+++ b/src/QrCodeGenerator.cpp
-@@ -33,6 +33,10 @@
- #include <QImage>
- #include <QRgb>
- 
-+#include <ZXing/ZXVersion.h>
-+#define ZXING_VERSION \
-+	QT_VERSION_CHECK(ZXING_VERSION_MAJOR, ZXING_VERSION_MINOR, ZXING_VERSION_PATCH)
-+
- #include <ZXing/BarcodeFormat.h>
- #include <ZXing/MultiFormatWriter.h>
- 
-@@ -74,7 +78,11 @@ QImage QrCodeGenerator::generateBareJidQrCode(int edgePixelCount, const QString
- QImage QrCodeGenerator::generateQrCode(int edgePixelCount, const QString &text)
- {
- 	try {
-+#if ZXING_VERSION >= QT_VERSION_CHECK(1, 1, 1)
-+		ZXing::MultiFormatWriter writer(ZXing::BarcodeFormat::QRCode);
-+#else
- 		ZXing::MultiFormatWriter writer(ZXing::BarcodeFormat::QR_CODE);
-+#endif
- 		const ZXing::BitMatrix &bitMatrix = writer.encode(text.toStdWString(), edgePixelCount, edgePixelCount);
- 		return toImage(bitMatrix);
- 	} catch (const std::invalid_argument &e) {
diff --git a/debian/patches/qrcode2.diff b/debian/patches/qrcode2.diff
new file mode 100644
index 0000000..6cc1323
--- /dev/null
+++ b/debian/patches/qrcode2.diff
@@ -0,0 +1,22 @@
+commit 9a2f88779064b46ae097a354c97d657901f47d01
+Author: Melvin Keskin <melvo at olomono.de>
+Date:   Fri Feb 18 10:48:46 2022 +0100
+
+    QrCodeDecoder: Replace deprecated 'BarcodeFormat::QR_CODE' with 'BarcodeFormat::QRCode'
+
+diff --git a/src/QrCodeDecoder.cpp b/src/QrCodeDecoder.cpp
+index a84978f..a7b0cf5 100644
+--- a/src/QrCodeDecoder.cpp
++++ b/src/QrCodeDecoder.cpp
+@@ -60,7 +60,11 @@ void QrCodeDecoder::decodeImage(const QImage &image)
+ {
+ 	// Advise the decoder to check for QR codes and to try decoding rotated versions of the image.
+ #if ZXING_VERSION >= QT_VERSION_CHECK(1, 1, 0)
++# if ZXING_VERSION >= QT_VERSION_CHECK(1, 1, 1)
++	const auto decodeHints = DecodeHints().setFormats(BarcodeFormat::QRCode);
++# else
+ 	const auto decodeHints = DecodeHints().setFormats(BarcodeFormat::QR_CODE);
++# endif
+ 	const auto result = ReadBarcode({image.bits(), image.width(), image.height(), ZXing::ImageFormat::Lum, image.bytesPerLine()}, decodeHints);
+ #else
+ 	const auto decodeHints =
diff --git a/debian/patches/series b/debian/patches/series
index b76d443..d4cbe40 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 qrcode.diff
+qrcode2.diff


More information about the Neon-commits mailing list