]> git.sesse.net Git - kdenlive/commitdiff
Fix timeline thumbs not reloaded on clip change:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 23 Jan 2011 16:54:23 +0000 (16:54 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 23 Jan 2011 16:54:23 +0000 (16:54 +0000)
http://kdenlive.org/mantis/view.php?id=1980

svn path=/trunk/kdenlive/; revision=5346

src/clipitem.cpp
src/customtrackview.cpp
src/customtrackview.h
src/mainwindow.cpp
src/projectlist.cpp
src/projectlist.h

index e4b759bb7cd1ab2359b400a534f23f9d47e47d9e..81768faa6c899d772f2932efe8cc62479f9c6fe4 100644 (file)
@@ -529,6 +529,7 @@ void ClipItem::refreshClip(bool checkDuration)
         QString colour = m_clip->getProperty("colour");
         colour = colour.replace(0, 2, "#");
         m_baseColor = QColor(colour.left(7));
+        update();
     } else resetThumbs(checkDuration);
 }
 
index c3906973dc56e255530da9a845240e05ad712061..74afb07db2e0267c7d5191cb528c101cfa5e9e6f 100644 (file)
@@ -4058,7 +4058,6 @@ void CustomTrackView::slotUpdateClip(const QString &clipId, bool reload)
                     emit displayMessage(i18n("Cannot update clip (time: %1, track: %2)", info.startPos.frames(m_document->fps()), info.track), ErrorMessage);
                 }
                 clip->refreshClip(true);
-                clip->update();
             }
         }
     }
@@ -6619,4 +6618,16 @@ void CustomTrackView::updateTrackDuration(int track, QUndoCommand *command)
     }
 }
 
-
+void CustomTrackView::slotRefreshThumbs(const QString &id)
+{
+    QList<QGraphicsItem *> list = scene()->items();
+    ClipItem *clip = NULL;
+    for (int i = 0; i < list.size(); ++i) {
+        if (list.at(i)->type() == AVWIDGET) {
+            clip = static_cast <ClipItem *>(list.at(i));
+            if (clip->clipProducer() == id) {
+                clip->refreshClip(true);
+            }
+        }
+    }
+}
index 11e65110a256e0a2dd4d897812af5e9493ec7d37..6f0d6e6c2a7453052e905860ccb0abf2c94bfa8a 100644 (file)
@@ -444,6 +444,8 @@ private slots:
     void slotGoToMarker(QAction *action);
     void slotResetMenuPosition();
     void slotDoResetMenuPosition();
+    /** @brief Re-create the clip thumbnails. */
+    void slotRefreshThumbs(const QString &id);
 
 signals:
     void cursorMoved(int, int);
index 34ecc812b61d0503cc81c3a026dd4aed4e90208a..fe2eb9dff73546538c27e38211330cbfa14ee882 100644 (file)
@@ -2404,11 +2404,12 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
             disconnect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
             disconnect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), m_activeTimeline->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
+            disconnect(m_projectList, SIGNAL(refreshClip(const QString &)), m_activeTimeline->projectView(), SLOT(slotRefreshThumbs(const QString &)));
             m_effectStack->clear();
         }
         //m_activeDocument->setRenderer(NULL);
         disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
-        disconnect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+        disconnect(m_projectList, SIGNAL(refreshClip(const QString &)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
         m_clipMonitor->stop();
     }
     KdenliveSettings::setCurrent_profile(doc->profilePath());
@@ -2418,7 +2419,8 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), doc->tracksList());
     m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
     connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, QPoint)));
-    connect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+    connect(m_projectList, SIGNAL(refreshClip(const QString &)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+    connect(m_projectList, SIGNAL(refreshClip(const QString &)), trackView->projectView(), SLOT(slotRefreshThumbs(const QString &)));
     connect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), trackView->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
 
     connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
index e2411e9fade74c45b7fb3f0693185efec14ec7d4..e0666e3dabf3def82db8db24add97e53dc8249b6 100644 (file)
@@ -629,9 +629,9 @@ void ProjectList::slotUpdateClipProperties(const QString &id, QMap <QString, QSt
                    properties.contains("force_aspect_den") ||
                    properties.contains("templatetext")) {
             slotRefreshClipThumbnail(item);
-            emit refreshClip();
+            emit refreshClip(id);
         } else if (properties.contains("full_luma") || properties.contains("force_colorspace")) {
-            emit refreshClip();
+            emit refreshClip(id);
         }
     }
 }
index f63191d2f0547260b11ad138e569611eceba9dc3..c21c42fafb2392e8fa727827708683b0d9b7fe04 100644 (file)
@@ -313,7 +313,9 @@ signals:
     void displayMessage(const QString, int progress);
     void clipNameChanged(const QString, const QString);
     void clipNeedsReload(const QString&, bool);
-    void refreshClip();
+    /** @brief A property affecting display was changed, so we need to update monitors and thumbnails
+     *  @param id: The clip's id string */
+    void refreshClip(const QString &id);
     void updateRenderStatus();
     void deleteProjectClips(QStringList ids, QMap <QString, QString> folderids);
     void findInTimeline(const QString &clipId);