Hello:

  I've reworked(simplified) commit d3190e8a47e12db282363829d4e5f733451e4a13 on 
master and backported to 2.6 branch. This avoids build failure when 
phononexperimental is not available.

  Simplification consists of removing the section that tries to find Phonon yet 
again, since it should have been already searched for.

  HTH,

-- 
     Raúl Sánchez Siles
----->Proud Debian user<-----
Linux registered user #416098
Based on:
# HG changeset patch
# User Gopalakrishna Bhat A <gopalakb...@gmail.com>
# Date 1351766730 -19800
# Node ID 9a1b2b03020be7c2d07d7e3670ca731fd1eaff37
# Parent  404f391e74438e27f31390e4d44861fd93cade80
Build videoshape with thumbnails only when the phononexperimental is present

Simplified to avoid Phonon re-include in CMakeLists.txt

--- a/plugins/videoshape/CMakeLists.txt
+++ b/plugins/videoshape/CMakeLists.txt
@@ -1,5 +1,13 @@
 include_directories( ${PHONON_INCLUDE_DIR} )
 
+if(PHONON_FOUND_EXPERIMENTAL)
+   set(SHOULD_BUILD_THUMBNAIL TRUE)
+   add_definitions( -DSHOULD_BUILD_THUMBNAIL )
+else(PHONON_FOUND_EXPERIMENTAL)
+    set(SHOULD_BUILD_THUMBNAIL FALSE)
+endif(PHONON_FOUND_EXPERIMENTAL)
+
+
 ########### Flake Plugin library ###############
 
 SET (videoshape_LIB_SRCS
@@ -15,16 +23,20 @@
     VideoToolFactory.cpp
     ChangeVideoCommand.cpp
     SelectVideoWidget.cpp
-    VideoThumbnailer.cpp
 )
 
+if(SHOULD_BUILD_THUMBNAIL)
+    set(videoshape_LIB_SRCS ${videoshape_LIB_SRCS} VideoThumbnailer.cpp)
+endif(SHOULD_BUILD_THUMBNAIL)
+
 kde4_add_ui_files(videoshape_LIB_SRCS forms/VideoToolWidget.ui)
 kde4_add_plugin(videoshape ${videoshape_LIB_SRCS})
 
-target_link_libraries(videoshape komain phononexperimental
+target_link_libraries(videoshape komain
     ${KDE4_KFILE_LIBRARY}
-    ${KDE4_PHONON_LIBRARY}
+    ${PHONON_LIBS}
 )
+
 install(TARGETS videoshape DESTINATION ${PLUGIN_INSTALL_DIR})
 
 ########### install files ###############
--- a/plugins/videoshape/VideoShape.cpp
+++ b/plugins/videoshape/VideoShape.cpp
@@ -27,7 +27,9 @@
 #include <VideoEventAction.h>
 #include <VideoCollection.h>
 #include <VideoData.h>
+#ifdef SHOULD_BUILD_THUMBNAIL
 #include <VideoThumbnailer.h>
+#endif
 #include <KoShapeLoadingContext.h>
 #include <KoOdfLoadingContext.h>
 #include <KoShapeSavingContext.h>
@@ -47,7 +49,9 @@
     , m_videoEventAction(new VideoEventAction(this))
     , m_icon(koIconName("video-x-generic"))
     , m_oldVideoData(0)
+#ifdef SHOULD_BUILD_THUMBNAIL
     , m_thumbnailer(new VideoThumbnailer())
+#endif
 {
     setKeepAspectRatio(true);
     addEventAction(m_videoEventAction);
@@ -55,7 +59,9 @@
 
 VideoShape::~VideoShape()
 {
+#ifdef SHOULD_BUILD_THUMBNAIL
     delete m_thumbnailer;
+#endif
 }
 
 void VideoShape::paint(QPainter &painter, const KoViewConverter &converter, KoShapePaintingContext &)
@@ -63,7 +69,7 @@
     QRectF pixelsF = converter.documentToView(QRectF(QPointF(0,0), size()));
 
     VideoData *currentVideoData = videoData();
-
+#ifdef SHOULD_BUILD_THUMBNAIL
     if (currentVideoData && currentVideoData != m_oldVideoData) {
         //generate thumbnails
         m_oldVideoData = currentVideoData;
@@ -79,6 +85,13 @@
     } else {
         painter.drawImage(pixelsF, thumnailImage);
     }
+#else
+    painter.fillRect(pixelsF, QColor(Qt::gray));
+    painter.setPen(QPen());
+    painter.drawRect(pixelsF);
+
+    m_icon.paint(&painter, pixelsF.toRect());
+#endif
 }
 
 void VideoShape::saveOdf(KoShapeSavingContext &context) const
--- a/plugins/videoshape/VideoShape.h
+++ b/plugins/videoshape/VideoShape.h
@@ -33,7 +33,9 @@
 class VideoCollection;
 class VideoEventAction;
 class VideoData;
+#ifdef SHOULD_BUILD_THUMBNAIL
 class VideoThumbnailer;
+#endif
 
 class QImage;
 
@@ -76,7 +78,9 @@
 private:
     VideoCollection *m_videoCollection;
     VideoEventAction *m_videoEventAction;
+#ifdef SHOULD_BUILD_THUMBNAIL
     VideoThumbnailer *m_thumbnailer;
+#endif
     VideoData *m_oldVideoData;
     KIcon m_icon;
     QRectF m_playIconArea;

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel

Reply via email to