This commit is contained in:
parent
c1c42a8c6c
commit
b30fec053b
@ -0,0 +1,40 @@
|
|||||||
|
From dc41a3f3850308d5204134ae08e66f20a58195f9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Melvin Keskin <melvo@olomono.de>
|
||||||
|
Date: Sun, 13 Mar 2022 13:03:16 +0100
|
||||||
|
Subject: [PATCH] QrCodeGenerator: Replace deprecated 'BarcodeFormat::QR_CODE'
|
||||||
|
with 'BarcodeFormat::QRCode'
|
||||||
|
|
||||||
|
---
|
||||||
|
src/QrCodeGenerator.cpp | 8 ++++++++
|
||||||
|
1 file changed, 8 insertions(+)
|
||||||
|
|
||||||
|
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) {
|
||||||
|
--
|
||||||
|
2.39.1
|
||||||
|
|
@ -3,6 +3,7 @@ Thu Feb 9 08:09:58 UTC 2023 - Christophe Marin <christophe@krop.fr>
|
|||||||
|
|
||||||
- Add patches to fix build with ZXing >= 2.0:
|
- Add patches to fix build with ZXing >= 2.0:
|
||||||
* 0001-QrCodeDecoder-Replace-deprecated-BarcodeFormat-QR_CO.patch
|
* 0001-QrCodeDecoder-Replace-deprecated-BarcodeFormat-QR_CO.patch
|
||||||
|
* 0001-QrCodeGenerator-Replace-deprecated-BarcodeFormat-QR_.patch
|
||||||
* 0001-Support-ZXing-2.0.patch
|
* 0001-Support-ZXing-2.0.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
@ -28,7 +28,9 @@ Source2: kaidan.keyring
|
|||||||
# PATCH-FIX-UPSTREAM
|
# PATCH-FIX-UPSTREAM
|
||||||
Patch0: 0001-QrCodeDecoder-Replace-deprecated-BarcodeFormat-QR_CO.patch
|
Patch0: 0001-QrCodeDecoder-Replace-deprecated-BarcodeFormat-QR_CO.patch
|
||||||
# PATCH-FIX-UPSTREAM
|
# PATCH-FIX-UPSTREAM
|
||||||
Patch1: 0001-Support-ZXing-2.0.patch
|
Patch1: 0001-QrCodeGenerator-Replace-deprecated-BarcodeFormat-QR_.patch
|
||||||
|
# PATCH-FIX-UPSTREAM
|
||||||
|
Patch2: 0001-Support-ZXing-2.0.patch
|
||||||
BuildRequires: cmake >= 3.3
|
BuildRequires: cmake >= 3.3
|
||||||
BuildRequires: extra-cmake-modules >= 5.40.0
|
BuildRequires: extra-cmake-modules >= 5.40.0
|
||||||
BuildRequires: update-desktop-files
|
BuildRequires: update-desktop-files
|
||||||
|
Loading…
x
Reference in New Issue
Block a user