]> git.sesse.net Git - kdenlive/commitdiff
Ensure clip in project tree is visible after a rename:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 6 Apr 2012 03:06:51 +0000 (05:06 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 6 Apr 2012 03:06:51 +0000 (05:06 +0200)
http://kdenlive.org/mantis/view.php?id=2563

src/projectlist.cpp
src/projectlist.h

index 276a39adfb9f95bc75820147bd9847046d26e19a..b3d5f517897abde934c4e378146ca1f4ff5b005e 100644 (file)
@@ -1038,11 +1038,17 @@ void ProjectList::slotItemEdited(QTreeWidgetItem *item, int column)
                 emit projectModified();
                 EditClipCommand *command = new EditClipCommand(this, clip->clipId(), oldprops, newprops, false);
                 m_commandStack->push(command);
+               QTimer::singleShot(100, this, SLOT(slotCheckScrolling()));
             }
         }
     }
 }
 
+void ProjectList::slotCheckScrolling()
+{
+    m_listView->scrollToItem(m_listView->currentItem());
+}
+
 void ProjectList::slotContextMenu(const QPoint &pos, QTreeWidgetItem *item)
 {
     bool enable = item ? true : false;
index 25f7ae578049689fdf860ce1488550d4e0788303..cea8053802e7716a9508b3d33bfcd398f0d79074 100644 (file)
@@ -459,6 +459,8 @@ private slots:
     void slotPrepareJobsMenu();
     /** @brief Discard all jobs for current clip. */
     void slotDiscardClipJobs();
+    /** @brief Make sure current clip is visible in project tree. */
+    void slotCheckScrolling();
 
 signals:
     void clipSelected(DocClipBase *, QPoint zone = QPoint(), bool forceUpdate = false);