]> git.sesse.net Git - kdenlive/commitdiff
Fix compilation with KDE < 4.5
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 20 Jun 2011 21:08:09 +0000 (21:08 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 20 Jun 2011 21:08:09 +0000 (21:08 +0000)
svn path=/trunk/kdenlive/; revision=5725

src/clipitem.cpp
src/customtrackview.cpp
src/customtrackview.h

index f366ab6304b81e54bf2bfb84413aaec33b29d0ab..32d720e10bf10712fd92e9b3f223efd1b840ec9e 100644 (file)
@@ -1722,10 +1722,17 @@ void ClipItem::doGetIntraThumbs(QPainter *painter, const QPointF startPos, int o
     }
     QPixmap p;
     for (int i = start; i <= end; i++) {
+#if KDE_IS_VERSION(4,5,0)
         if (!view->m_pixmapCache->findPixmap(m_clip->fileURL().path() + "%" + QString::number(i), &p)) {
             p = m_clip->thumbProducer()->extractImage(i, twidth, theight);
             view->m_pixmapCache->insertPixmap(m_clip->fileURL().path() + "%" + QString::number(i), p);
         }
+#else
+        if (!view->m_pixmapCache->find(m_clip->fileURL().path() + "%" + QString::number(i), p)) {
+            p = m_clip->thumbProducer()->extractImage(i, twidth, theight);
+            view->m_pixmapCache->insert(m_clip->fileURL().path() + "%" + QString::number(i), p);
+        }
+#endif
         painter->drawPixmap(startPos + QPointF(twidth *(i - offset), 0), p);
     }
 }
index 23d85c7b131a5521632f9426c9f23423abc656dc..844a171e64ffaa0b6934f91aff7236b851163218 100644 (file)
@@ -142,7 +142,11 @@ CustomTrackView::CustomTrackView(KdenliveDoc *doc, CustomTrackScene* projectscen
 
     m_activeTrackBrush = KStatefulBrush(KColorScheme::View, KColorScheme::ActiveBackground, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
 
+#if KDE_IS_VERSION(4,5,0)
     m_pixmapCache = new KImageCache("kdenlive-thumbs", 1000000);
+#else
+    m_pixmapCache = new KPixmapCache("kdenlive-thumbs");
+#endif
 
     m_animationTimer = new QTimeLine(800);
     m_animationTimer->setFrameRange(0, 5);
index 99482e9ec0e0d167e0b230dc39d02095d67be16d..a88286fe51c29dbba64169bff99aa94c01f30f9f 100644 (file)
 #ifndef CUSTOMTRACKVIEW_H
 #define CUSTOMTRACKVIEW_H
 
+#include <kdeversion.h>
+#if KDE_IS_VERSION(4,5,0)
 #include <KImageCache>
+#else
+#include <KPixmapCache>
+#endif
+
 #include <KColorScheme>
 
 #include <QGraphicsView>
@@ -178,7 +184,11 @@ public:
     void clearSelection();
     void editItemDuration();
     void buildGuidesMenu(QMenu *goMenu) const;
+#if KDE_IS_VERSION(4,5,0)
     KImageCache* m_pixmapCache;
+#else
+    KPixmapCache* m_pixmapCache;
+#endif
     /** update the timeline objects when palette changes */
     void updatePalette();
     /** @brief Returns true if a track has audio data on it.