summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio D'Urso <fabiodurso@hotmail.it>2014-08-23 18:55:12 (GMT)
committerFabio D'Urso <fabiodurso@hotmail.it>2014-08-23 19:49:25 (GMT)
commite395735820dedcd8bb704a01981057a747656784 (patch)
treeab5bccfc460ea9013318b2365e27c37a2f038022
parent1fc4c747a69375d2335911b30361028e55c20d21 (diff)
Port the kimgio generator
Note that the libkexiv2 "framework" branch is still work in progress and does not work out of the box yet (it doesn't install some headers).
-rw-r--r--generators/CMakeLists.txt8
-rw-r--r--generators/kimgio/CMakeLists.txt13
-rw-r--r--generators/kimgio/generator_kimgio.cpp10
3 files changed, 13 insertions, 18 deletions
diff --git a/generators/CMakeLists.txt b/generators/CMakeLists.txt
index d1144db..7c29ef8 100644
--- a/generators/CMakeLists.txt
+++ b/generators/CMakeLists.txt
@@ -14,7 +14,7 @@ set_package_properties("libspectre" PROPERTIES
TYPE RECOMMENDED
PURPOSE "Support for PS files in okular.")
-find_package(Kexiv2)
+find_package(KF5KExiv2)
set_package_properties("LibKExiv2" PROPERTIES
DESCRIPTION "Wrapper around Exiv2 library"
URL "http://www.digikam.org/sharedlibs"
@@ -88,9 +88,9 @@ endif(POPPLER_FOUND)
# add_subdirectory(spectre)
#endif(LIBSPECTRE_FOUND)
-#if(KEXIV2_FOUND)
-# add_subdirectory( kimgio )
-#endif(KEXIV2_FOUND)
+if(KF5KExiv2_FOUND)
+ add_subdirectory( kimgio )
+endif(KF5KExiv2_FOUND)
if(CHM_FOUND)
add_subdirectory( chm )
diff --git a/generators/kimgio/CMakeLists.txt b/generators/kimgio/CMakeLists.txt
index ef79738..920c14e 100644
--- a/generators/kimgio/CMakeLists.txt
+++ b/generators/kimgio/CMakeLists.txt
@@ -1,25 +1,20 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../..
${CMAKE_BINARY_DIR}
- ${QIMAGEBLITZ_INCLUDES}
- ${KEXIV2_INCLUDE_DIR}
)
########### next target ###############
set(okularGenerator_kimgio_PART_SRCS generator_kimgio.cpp )
-
-
-kde4_add_plugin(okularGenerator_kimgio ${okularGenerator_kimgio_PART_SRCS})
-target_link_libraries(okularGenerator_kimgio okularcore ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QT_QTXML_LIBRARY} ${KEXIV2_LIBRARIES} )
+add_library(okularGenerator_kimgio MODULE ${okularGenerator_kimgio_PART_SRCS})
+target_link_libraries(okularGenerator_kimgio okularcore KF5::Kexiv2)
install(TARGETS okularGenerator_kimgio DESTINATION ${PLUGIN_INSTALL_DIR})
+add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
set( kimgiotest_SRCS tests/kimgiotest.cpp ${CMAKE_SOURCE_DIR}/ui/pagepainter.cpp ${CMAKE_SOURCE_DIR}/ui/guiutils.cpp )
kconfig_add_kcfg_files( kimgiotest_SRCS ${CMAKE_SOURCE_DIR}/conf/settings.kcfgc )
-kde4_add_unit_test( kimgiotest ${kimgiotest_SRCS} )
-target_link_libraries( kimgiotest ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${QIMAGEBLITZ_LIBRARIES} okularcore )
-
+ecm_add_test(${kimgiotest_SRCS} TEST_NAME "kimgiotest" LINK_LIBRARIES okularcore Qt5::Svg Qt5::Test)
########### install files ###############
diff --git a/generators/kimgio/generator_kimgio.cpp b/generators/kimgio/generator_kimgio.cpp
index b2e5f8d..5e0a314 100644
--- a/generators/kimgio/generator_kimgio.cpp
+++ b/generators/kimgio/generator_kimgio.cpp
@@ -16,26 +16,26 @@
#include <QtGui/QPainter>
#include <QtGui/QPrinter>
-#include <kaboutdata.h>
+#include <k4aboutdata.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <kicon.h>
#include <kimageio.h>
#include <klocale.h>
-#include <libkexiv2/kexiv2.h>
+#include <kexiv2/kexiv2.h>
#include <core/page.h>
-static KAboutData createAboutData()
+static K4AboutData createAboutData()
{
- KAboutData aboutData(
+ K4AboutData aboutData(
"okular_kimgio",
"okular_kimgio",
ki18n( "Image Backend" ),
"0.1.2",
ki18n( "A simple image backend" ),
- KAboutData::License_GPL,
+ K4AboutData::License_GPL,
ki18n( "© 2005, 2009 Albert Astals Cid\n"
"© 2006-2007 Pino Toscano\n"
"© 2006-2007 Tobias Koenig" )