Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kitinerary for openSUSE:Factory 
checked in at 2022-07-22 19:20:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kitinerary (Old)
 and      /work/SRC/openSUSE:Factory/.kitinerary.new.21925 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kitinerary"

Fri Jul 22 19:20:26 2022 rev:51 rq:990443 version:22.04.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/kitinerary/kitinerary.changes    2022-07-09 
17:01:01.308615030 +0200
+++ /work/SRC/openSUSE:Factory/.kitinerary.new.21925/kitinerary.changes 
2022-07-22 19:20:31.912589043 +0200
@@ -1,0 +2,6 @@
+Wed Jul 20 16:24:51 UTC 2022 - Fabian Vogt <fab...@ritter-vogt.de>
+
+- Add patch to fix build with ZXing 1.4.0:
+  * 0001-Support-ZXing-1.4.0.patch
+
+-------------------------------------------------------------------

New:
----
  0001-Support-ZXing-1.4.0.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kitinerary.spec ++++++
--- /var/tmp/diff_new_pack.XSoIx2/_old  2022-07-22 19:20:32.440589949 +0200
+++ /var/tmp/diff_new_pack.XSoIx2/_new  2022-07-22 19:20:32.444589956 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package kitinerary
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -29,13 +29,15 @@
 Source1:        
https://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz.sig
 Source2:        applications.keyring
 %endif
+# PATCH-FIX-UPSTREAM
+Patch1:         0001-Support-ZXing-1.4.0.patch
 BuildRequires:  extra-cmake-modules
 BuildRequires:  kf5-filesystem
 BuildRequires:  libopenssl-devel
 BuildRequires:  libpoppler-qt5-devel
+BuildRequires:  libqt5-qtdeclarative-private-headers-devel
 BuildRequires:  libxml2-devel
 BuildRequires:  zlib-devel
-BuildRequires:  libqt5-qtdeclarative-private-headers-devel
 BuildRequires:  cmake(KF5CalendarCore)
 BuildRequires:  cmake(KF5Contacts)
 BuildRequires:  cmake(KF5I18n)
@@ -69,12 +71,12 @@
 Summary:        Development files for kitinerary
 Group:          Development/Libraries/KDE
 Requires:       libKPimItinerary5 = %{version}
+Requires:       libqt5-qtdeclarative-private-headers-devel
 Requires:       cmake(KF5CalendarCore)
 Requires:       cmake(KF5Contacts)
 Requires:       cmake(KF5Mime)
 Requires:       cmake(KPimPkPass)
 Requires:       cmake(Qt5Gui)
-Requires:       libqt5-qtdeclarative-private-headers-devel
 
 %description devel
 This package contains all necessary include files and libraries needed

++++++ 0001-Support-ZXing-1.4.0.patch ++++++
>From b08fd64711165c10bf1e88e6add4e66f68e32dc5 Mon Sep 17 00:00:00 2001
From: Volker Krause <vkra...@kde.org>
Date: Fri, 8 Jul 2022 16:04:19 +0200
Subject: [PATCH] Support ZXing 1.4.0

The previous code crashes (if it builds at all) with ZXing 1.4.0, so
distributions updating to 1.4.0 would need to apply this patch on top
of 22.04.3 as well.

(cherry picked from commit e60195421aa159462353892ed32bf46ac8c57d19)
---
 src/lib/barcodedecoder.cpp | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/src/lib/barcodedecoder.cpp b/src/lib/barcodedecoder.cpp
index b38140a..40e0c64 100644
--- a/src/lib/barcodedecoder.cpp
+++ b/src/lib/barcodedecoder.cpp
@@ -15,6 +15,7 @@
 #include <QString>
 
 #ifdef HAVE_ZXING
+#define ZX_USE_UTF8 1
 #ifdef ZXING_USE_READBARCODE
 #include <ZXing/ReadBarcode.h>
 #else
@@ -244,6 +245,30 @@ void BarcodeDecoder::decodeZxing(const QImage &img, 
BarcodeDecoder::BarcodeTypes
 #endif
 
     if (res.isValid()) {
+#if ZXING_VERSION >= QT_VERSION_CHECK(1, 4, 0)
+        // detect content type
+        std::string zxUtf8Text;
+        if (res.contentType() == ZXing::ContentType::Text) {
+            result.contentType = Result::Any;
+            zxUtf8Text = res.text();
+            // check if the text is ASCII-only (in which case we allow access 
as byte array as well)
+            if (std::any_of(zxUtf8Text.begin(), zxUtf8Text.end(), [](unsigned 
char c) { return c > 0x7F; })) {
+                result.contentType &= ~Result::ByteArray;
+            }
+        } else {
+            result.contentType = Result::ByteArray;
+        }
+
+        // decode content
+        if (result.contentType & Result::ByteArray) {
+            QByteArray b;
+            b.resize(res.bytes().size());
+            std::copy(res.bytes().begin(), res.bytes().end(), b.begin());
+            result.content = b;
+        } else {
+            result.content = QString::fromStdString(zxUtf8Text);
+        }
+#else
         // detect content type
         result.contentType = Result::Any;
         if (std::any_of(res.text().begin(), res.text().end(), [](const auto c) 
{ return c > 255; })) {
@@ -262,6 +287,7 @@ void BarcodeDecoder::decodeZxing(const QImage &img, 
BarcodeDecoder::BarcodeTypes
         } else {
             result.content = QString::fromStdWString(res.text());
         }
+#endif
         result.positive |= formatToType(res.format());
     } else {
         result.negative |= format;
-- 
2.36.1

Reply via email to