Blob Blame History Raw
From f4bfce4f73e9990ba984dd5a4f55fc2b62edc661 Mon Sep 17 00:00:00 2001
From: Nicolas Fella <nicolas.fella@gmx.de>
Date: Tue, 9 Jan 2024 21:48:21 +0100
Subject: [PATCH] Re-enable kimageannotator integration

---
 CMakeLists.txt          | 14 ++++----------
 app/CMakeLists.txt      |  2 +-
 app/main.cpp            |  4 ----
 config-gwenview.h.cmake |  3 +--
 lib/CMakeLists.txt      |  4 ++--
 5 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d8bff11a..2175c2446 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,16 +178,10 @@ if(NOT WITHOUT_X11)
     endif()
 endif()
 
-if (QT_MAJOR_VERSION STREQUAL "5")
-    find_package(kImageAnnotator)
-    set_package_properties(kImageAnnotator PROPERTIES URL "https://github.com/ksnip/kImageAnnotator" DESCRIPTION "The kImageAnnotator library provides tools to annotate" TYPE REQUIRED)
-    if(kImageAnnotator_FOUND)
-        set(KIMAGEANNOTATOR_FOUND 1)
-        find_package(kColorPicker REQUIRED)
-        if(NOT kImageAnnotator_VERSION VERSION_LESS 0.5.0)
-            set(KIMAGEANNOTATOR_CAN_LOAD_TRANSLATIONS 1)
-        endif()
-    endif()
+find_package(kImageAnnotator-Qt6)
+set_package_properties(kImageAnnotator-Qt6 PROPERTIES URL "https://github.com/ksnip/kImageAnnotator" DESCRIPTION "The kImageAnnotator library provides tools to annotate" TYPE REQUIRED)
+if(kImageAnnotator-Qt6_FOUND)
+    set(KIMAGEANNOTATOR_FOUND 1)
 endif()
 
 configure_file(config-gwenview.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-gwenview.h)
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 5b6f60fe3..451734ba0 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -161,6 +161,6 @@ target_link_libraries(slideshowfileitemaction
     KF6::KIOWidgets
     KF6::Notifications)
 
-if(kImageAnnotator_FOUND)
+if(kImageAnnotator-Qt6_FOUND)
     target_link_libraries(gwenview kImageAnnotator::kImageAnnotator)
 endif()
diff --git a/app/main.cpp b/app/main.cpp
index d053a7208..943adac8c 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -75,9 +75,7 @@ static void handleTiffError(const char *mod, const char *fmt, va_list ap)
 // To enable AVIF/HEIF/JPEG-XL metadata support in Exiv2
 #include <exiv2/exiv2.hpp>
 
-#ifdef KIMAGEANNOTATOR_CAN_LOAD_TRANSLATIONS
 #include <kImageAnnotator/KImageAnnotator.h>
-#endif
 
 class StartHelper
 {
@@ -202,9 +200,7 @@ int main(int argc, char *argv[])
     // to be async rather than using exec().
     qApp->sendPostedEvents(nullptr, QEvent::DeferredDelete);
 
-#ifdef KIMAGEANNOTATOR_CAN_LOAD_TRANSLATIONS
     kImageAnnotator::loadTranslations();
-#endif
 
     return app.exec();
 }
diff --git a/config-gwenview.h.cmake b/config-gwenview.h.cmake
index 253cbd852..35f3776b2 100644
--- a/config-gwenview.h.cmake
+++ b/config-gwenview.h.cmake
@@ -8,6 +8,5 @@
 #cmakedefine01 HAVE_KACTIVITIES
 #cmakedefine01 HAVE_PURPOSE
 #cmakedefine HAVE_TIFF 1
-#cmakedefine KIMAGEANNOTATOR_CAN_LOAD_TRANSLATIONS ${KIMAGEANNOTATOR_CAN_LOAD_TRANSLATIONS}
-#cmakedefine KIMAGEANNOTATOR_FOUND ${KIMAGEANNOTATOR_FOUND}
+#cmakedefine KIMAGEANNOTATOR_FOUND ${KIMAGEANNOTATOR-Qt6_FOUND}
 #cmakedefine GWENVIEW_NO_WAYLAND_GESTURES 1
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 29754757e..cb26d4304 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -157,7 +157,7 @@ set(gwenviewlib_SRCS
     touch/touch_helper.cpp
     ${GV_JPEG_DIR}/transupp.c
     )
-if (kImageAnnotator_FOUND)
+if (kImageAnnotator-Qt6_FOUND)
     set(gwenviewlib_SRCS ${gwenviewlib_SRCS}
         annotate/annotatedialog.cpp
         annotate/annotateoperation.cpp
@@ -340,7 +340,7 @@ if (GWENVIEW_SEMANTICINFO_BACKEND_BALOO)
         )
 endif()
 
-if(kImageAnnotator_FOUND)
+if(kImageAnnotator-Qt6_FOUND)
     target_link_libraries(gwenviewlib kImageAnnotator::kImageAnnotator)
 endif()
 
-- 
GitLab