Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ksnip for openSUSE:Factory checked 
in at 2024-03-27 20:42:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ksnip (Old)
 and      /work/SRC/openSUSE:Factory/.ksnip.new.1905 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ksnip"

Wed Mar 27 20:42:36 2024 rev:15 rq:1162581 version:1.10.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/ksnip/ksnip.changes      2023-03-25 
18:55:29.350705580 +0100
+++ /work/SRC/openSUSE:Factory/.ksnip.new.1905/ksnip.changes    2024-03-27 
20:43:08.118376106 +0100
@@ -1,0 +2,8 @@
+Fri Mar 15 17:45:34 UTC 2024 - Christophe Marin <christo...@krop.fr>
+
+- Add upstream fix to build with recent kcolorpicker and
+  kimageannotator versions:
+  * 0001-Fix-build-against-kImageAnnotator-and-kColorPicker-t.patch
+- Spec update
+
+-------------------------------------------------------------------

New:
----
  0001-Fix-build-against-kImageAnnotator-and-kColorPicker-t.patch

BETA DEBUG BEGIN:
  New:  kimageannotator versions:
  * 0001-Fix-build-against-kImageAnnotator-and-kColorPicker-t.patch
- Spec update
BETA DEBUG END:

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

Other differences:
------------------
++++++ ksnip.spec ++++++
--- /var/tmp/diff_new_pack.C45bHm/_old  2024-03-27 20:43:08.646395574 +0100
+++ /var/tmp/diff_new_pack.C45bHm/_new  2024-03-27 20:43:08.646395574 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package ksnip
 #
-# Copyright (c) 2023 SUSE LLC
+# Copyright (c) 2024 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -22,27 +22,30 @@
 Summary:        Screenshot tool
 License:        GPL-2.0-or-later
 Group:          Productivity/Graphics/Other
-URL:            https://github.com/DamirPorobic/ksnip
-Source:         
https://github.com/DamirPorobic/ksnip/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
+URL:            https://github.com/ksnip/ksnip
+Source:         
https://github.com/ksnip/ksnip/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM
+Patch0:         0001-Fix-build-against-kImageAnnotator-and-kColorPicker-t.patch
 BuildRequires:  cmake
 BuildRequires:  extra-cmake-modules
 BuildRequires:  gcc-c++
 BuildRequires:  hicolor-icon-theme
-BuildRequires:  kColorPicker-devel
-BuildRequires:  kImageAnnotator-devel >= 0.6.1
 BuildRequires:  pkgconfig
 BuildRequires:  update-desktop-files
 BuildRequires:  xvfb-run
+BuildRequires:  cmake(Qt5Concurrent)
+BuildRequires:  cmake(Qt5Core)
+BuildRequires:  cmake(Qt5DBus)
 BuildRequires:  cmake(Qt5LinguistTools)
-BuildRequires:  pkgconfig(Qt5Concurrent)
-BuildRequires:  pkgconfig(Qt5DBus)
-BuildRequires:  pkgconfig(Qt5Network)
-BuildRequires:  pkgconfig(Qt5PrintSupport)
-BuildRequires:  pkgconfig(Qt5Svg)
-BuildRequires:  pkgconfig(Qt5Test)
-BuildRequires:  pkgconfig(Qt5Widgets)
-BuildRequires:  pkgconfig(Qt5X11Extras)
-BuildRequires:  pkgconfig(Qt5Xml)
+BuildRequires:  cmake(Qt5Network)
+BuildRequires:  cmake(Qt5PrintSupport)
+BuildRequires:  cmake(Qt5Svg)
+BuildRequires:  cmake(Qt5Test)
+BuildRequires:  cmake(Qt5Widgets)
+BuildRequires:  cmake(Qt5X11Extras)
+BuildRequires:  cmake(Qt5Xml)
+BuildRequires:  cmake(kColorPicker-Qt5) >= 0.3.1
+BuildRequires:  cmake(kImageAnnotator-Qt5) >= 0.7.1
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(xcb-xfixes)
 

++++++ 0001-Fix-build-against-kImageAnnotator-and-kColorPicker-t.patch ++++++
>From 76f4b381971eead6ff31b8bf3bb64bb5717469c3 Mon Sep 17 00:00:00 2001
From: Damir Porobic <damir_poro...@live.com>
Date: Thu, 22 Feb 2024 12:18:14 +0100
Subject: [PATCH] Fix build against kImageAnnotator and kColorPicker that use
 qt5 and qt6

---
 CMakeLists.txt                                | 18 +++++++++++++-----
 src/CMakeLists.txt                            |  2 +-
 src/gui/operations/CopyAsDataUriOperation.cpp |  9 ++++-----
 tests/CMakeLists.txt                          |  2 +-
 4 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2613ac42..f8088dd7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,6 +44,14 @@ endif ()
 set(QT_COMPONENTS Core Widgets Network Xml PrintSupport DBus Svg)
 set(QT_MIN_VERSION 5.9.4)
 
+option(BUILD_WITH_QT6 "Build against Qt6" OFF)
+
+if (BUILD_WITH_QT6)
+       set(QT_MAJOR_VERSION 6)
+else()
+       set(QT_MAJOR_VERSION 5)
+endif()
+
 if (UNIX AND NOT APPLE)
        list(APPEND QT_COMPONENTS Concurrent)
 endif()
@@ -58,13 +66,13 @@ if (BUILD_TESTS)
        list(APPEND QT_COMPONENTS Test)
 endif()
 
-find_package(Qt5 ${QT_MIN_VERSION} REQUIRED ${QT_COMPONENTS})
+find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED ${QT_COMPONENTS})
 
-set(KIMAGEANNOTATOR_MIN_VERSION 0.6.1)
-find_package(kImageAnnotator ${KIMAGEANNOTATOR_MIN_VERSION} REQUIRED)
+set(KIMAGEANNOTATOR_MIN_VERSION 0.7.0)
+find_package(kImageAnnotator-Qt${QT_MAJOR_VERSION} 
${KIMAGEANNOTATOR_MIN_VERSION} REQUIRED)
 
-set(KCOLORPICKER_MIN_VERSION 0.2.0)
-find_package(kColorPicker ${KCOLORPICKER_MIN_VERSION} REQUIRED)
+set(KCOLORPICKER_MIN_VERSION 0.3.0)
+find_package(kColorPicker-Qt${QT_MAJOR_VERSION} ${KCOLORPICKER_MIN_VERSION} 
REQUIRED)
 
 set(BASEPATH "${CMAKE_SOURCE_DIR}")
 include_directories("${BASEPATH}")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e60d4bba..5a637411 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -293,7 +293,7 @@ elseif (UNIX)
 elseif (WIN32)
         list(APPEND DEPENDENCY_LIBRARIES
                 Qt5::WinExtras
-                kImageAnnotator
+                               kImageAnnotator::kImageAnnotator
                 kColorPicker
                 Dwmapi
                 )
diff --git a/src/gui/operations/CopyAsDataUriOperation.cpp 
b/src/gui/operations/CopyAsDataUriOperation.cpp
index 7c9b6eef..100aa4fd 100644
--- a/src/gui/operations/CopyAsDataUriOperation.cpp
+++ b/src/gui/operations/CopyAsDataUriOperation.cpp
@@ -34,14 +34,13 @@ CopyAsDataUriOperation::CopyAsDataUriOperation(
 bool CopyAsDataUriOperation::execute()
 {
        QByteArray byteArray;
-
        QBuffer buffer(&byteArray);
        buffer.open(QIODevice::WriteOnly);
-       auto saved = mImage.save(&buffer, "PNG");
+       auto isSaved = mImage.save(&buffer, mConfig->saveFormat().toLatin1());
        buffer.close();
 
-       if (saved) {
-               QByteArray output = "data:image/png;base64,";
+       if (isSaved) {
+               QByteArray output = "data:image/" + 
mConfig->saveFormat().toLatin1() +";base64,";
                output.append(byteArray.toBase64());
                mClipboardService->setText(output);
                notifySuccess();
@@ -49,7 +48,7 @@ bool CopyAsDataUriOperation::execute()
                notifyFailure();
        }
 
-       return saved;
+       return isSaved;
 }
 
 void CopyAsDataUriOperation::notifyFailure() const
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index f4a49ffd..da19ce93 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -73,6 +73,6 @@ endif ()
 foreach (UnitTest ${UNITTEST_SRC})
        get_filename_component(UnitTestName ${UnitTest} NAME_WE)
        add_executable(${UnitTestName} ${UnitTest} ${TESTUTILS_SRC})
-       target_link_libraries(${UnitTestName} KSNIP_STATIC GTest::gmock 
Qt5::Test)
+       target_link_libraries(${UnitTestName} KSNIP_STATIC GTest::gmock 
Qt${QT_MAJOR_VERSION}::Test)
        add_test(${UnitTestName} ${UnitTestName})
 endforeach (UnitTest)
-- 
2.44.0

Reply via email to