From b30fec053bea9ecd3cf4e6098baa39b4c379b843e4614a0fd6650693157f3a19 Mon Sep 17 00:00:00 2001 From: Christophe Marin Date: Thu, 9 Feb 2023 08:22:04 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/KDE:Extra/kaidan?expand=0&rev=20 --- ...Replace-deprecated-BarcodeFormat-QR_.patch | 40 +++++++++++++++++++ kaidan.changes | 1 + kaidan.spec | 4 +- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 0001-QrCodeGenerator-Replace-deprecated-BarcodeFormat-QR_.patch diff --git a/0001-QrCodeGenerator-Replace-deprecated-BarcodeFormat-QR_.patch b/0001-QrCodeGenerator-Replace-deprecated-BarcodeFormat-QR_.patch new file mode 100644 index 0000000..668b8c6 --- /dev/null +++ b/0001-QrCodeGenerator-Replace-deprecated-BarcodeFormat-QR_.patch @@ -0,0 +1,40 @@ +From dc41a3f3850308d5204134ae08e66f20a58195f9 Mon Sep 17 00:00:00 2001 +From: Melvin Keskin +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 + #include + ++#include ++#define ZXING_VERSION \ ++ QT_VERSION_CHECK(ZXING_VERSION_MAJOR, ZXING_VERSION_MINOR, ZXING_VERSION_PATCH) ++ + #include + #include + +@@ -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 + diff --git a/kaidan.changes b/kaidan.changes index 38ea595..dcf9d36 100644 --- a/kaidan.changes +++ b/kaidan.changes @@ -3,6 +3,7 @@ Thu Feb 9 08:09:58 UTC 2023 - Christophe Marin - Add patches to fix build with ZXing >= 2.0: * 0001-QrCodeDecoder-Replace-deprecated-BarcodeFormat-QR_CO.patch + * 0001-QrCodeGenerator-Replace-deprecated-BarcodeFormat-QR_.patch * 0001-Support-ZXing-2.0.patch ------------------------------------------------------------------- diff --git a/kaidan.spec b/kaidan.spec index aa3c6ee..f5da475 100644 --- a/kaidan.spec +++ b/kaidan.spec @@ -28,7 +28,9 @@ Source2: kaidan.keyring # PATCH-FIX-UPSTREAM Patch0: 0001-QrCodeDecoder-Replace-deprecated-BarcodeFormat-QR_CO.patch # 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: extra-cmake-modules >= 5.40.0 BuildRequires: update-desktop-files