Script 'mail_helper' called by obssrc
Hello community,

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

Package is "prison-qt5"

Fri Jul 22 19:20:27 2022 rev:70 rq:990444 version:5.96.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/prison-qt5/prison-qt5.changes    2022-07-11 
19:10:48.187731125 +0200
+++ /work/SRC/openSUSE:Factory/.prison-qt5.new.21925/prison-qt5.changes 
2022-07-22 19:20:32.620590258 +0200
@@ -1,0 +2,6 @@
+Wed Jul 20 16:24:17 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:
------------------
++++++ prison-qt5.spec ++++++
--- /var/tmp/diff_new_pack.aGwtGM/_old  2022-07-22 19:20:33.068591027 +0200
+++ /var/tmp/diff_new_pack.aGwtGM/_new  2022-07-22 19:20:33.072591035 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package prison-qt5
 #
-# 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
@@ -38,6 +38,8 @@
 Source1:        %{rname}-%{version}.tar.xz.sig
 Source2:        frameworks.keyring
 %endif
+# PATCH-FIX-UPSTREAM
+Patch1:         0001-Support-ZXing-1.4.0.patch
 BuildRequires:  extra-cmake-modules >= %{_kf5_bugfix_version}
 BuildRequires:  fdupes
 BuildRequires:  kf5-filesystem

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

The previous code doesn't build (and when made to build, crashes) with
ZXing 1.4.0.
---
 src/scanner/CMakeLists.txt             |  2 ++
 src/scanner/config-prison-scanner.h.in | 14 ++++++++++++++
 src/scanner/videoscannerworker.cpp     | 17 +++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 src/scanner/config-prison-scanner.h.in

diff --git a/src/scanner/CMakeLists.txt b/src/scanner/CMakeLists.txt
index d5b9cf5..ef690c5 100644
--- a/src/scanner/CMakeLists.txt
+++ b/src/scanner/CMakeLists.txt
@@ -1,6 +1,8 @@
 # SPDX-FileCopyrightText: 2022 Volker Krause <vkra...@kde.org>
 # SPDX-License-Identifier: BSD-3-Clause
 
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-prison-scanner.h.in 
${CMAKE_CURRENT_BINARY_DIR}/config-prison-scanner.h)
+
 add_library(KF5PrisonScanner)
 add_library(KF5::PrisonScanner ALIAS KF5PrisonScanner)
 
diff --git a/src/scanner/config-prison-scanner.h.in 
b/src/scanner/config-prison-scanner.h.in
new file mode 100644
index 0000000..d80ceaf
--- /dev/null
+++ b/src/scanner/config-prison-scanner.h.in
@@ -0,0 +1,14 @@
+/*
+   SPDX-FileCopyrightText: 2022 Volker Krause <vkra...@kde.org>
+   SPDX-License-Identifier: LGPL-2.0-or-later
+*/
+
+#ifndef CONFIG_PRISON_SCANNER_H
+#define CONFIG_PRISON_SCANNER_H
+
+#define ZXING_VERSION_MAJOR @ZXing_VERSION_MAJOR@
+#define ZXING_VERSION_MINOR @ZXing_VERSION_MINOR@
+#define ZXING_VERSION_PATCH @ZXing_VERSION_PATCH@
+#define ZXING_VERSION 
((@ZXing_VERSION_MAJOR@<<16)|(@ZXing_VERSION_MINOR@<<8)|(@ZXing_VERSION_PATCH@))
+
+#endif // CONFIG_PRISON_SCANNER_H
diff --git a/src/scanner/videoscannerworker.cpp 
b/src/scanner/videoscannerworker.cpp
index 45792dc..947367c 100644
--- a/src/scanner/videoscannerworker.cpp
+++ b/src/scanner/videoscannerworker.cpp
@@ -3,6 +3,7 @@
     SPDX-License-Identifier: MIT
 */
 
+#include "config-prison-scanner.h"
 #include "format_p.h"
 #include "scanresult_p.h"
 #include "videoscannerframe_p.h"
@@ -12,6 +13,7 @@
 #include <QImage>
 #include <QTransform>
 
+#define ZX_USE_UTF8 1
 #include <ZXing/ReadBarcode.h>
 #include <ZXing/TextUtfEncoding.h>
 
@@ -25,7 +27,11 @@ VideoScannerWorker::VideoScannerWorker(QObject *parent)
 
 void VideoScannerWorker::slotScanFrame(VideoScannerFrame frame)
 {
+#if ZXING_VERSION < QT_VERSION_CHECK(1, 4, 0)
     ZXing::Result zxRes(ZXing::DecodeStatus::FormatError);
+#else
+    ZXing::Result zxRes;
+#endif
     ZXing::DecodeHints hints;
     hints.setFormats(frame.formats() == Format::NoFormat ? 
ZXing::BarcodeFormats::all() : Format::toZXing(frame.formats()));
 
@@ -173,6 +179,7 @@ void VideoScannerWorker::slotScanFrame(VideoScannerFrame 
frame)
     if (zxRes.isValid()) {
         auto res = ScanResultPrivate::get(scanResult);
 
+#if ZXING_VERSION < QT_VERSION_CHECK(1, 4, 0)
         // distinguish between binary and text content
         const auto hasWideChars = std::any_of(zxRes.text().begin(), 
zxRes.text().end(), [](auto c) {
             return c > 255;
@@ -188,6 +195,16 @@ void VideoScannerWorker::slotScanFrame(VideoScannerFrame 
frame)
             std::copy(zxRes.text().begin(), zxRes.text().end(), b.begin());
             res->content = b;
         }
+#else
+        if (zxRes.contentType() == ZXing::ContentType::Text) {
+            res->content = QString::fromStdString(zxRes.text());
+        } else {
+            QByteArray b;
+            b.resize(zxRes.bytes().size());
+            std::copy(zxRes.bytes().begin(), zxRes.bytes().end(), b.begin());
+            res->content = b;
+        }
+#endif
 
         // determine the bounding rect
         // the cooridinates we get from ZXing are a polygon, we need to 
determine the
-- 
2.36.1

Reply via email to