[vlmc-devel] commit: TracksView: Removing useless method. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Tue Sep 7 21:41:56 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Sep  6 22:17:07 2010 +0200| [0a0963714372579930c684ed0ffe165f2257bee0] | committer: Hugo Beauzée-Luyssen 

TracksView: Removing useless method.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=0a0963714372579930c684ed0ffe165f2257bee0
---

 src/Gui/timeline/TracksView.cpp |   29 ++++-------------------------
 src/Gui/timeline/TracksView.h   |    6 ------
 2 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index 213b30b..2faca6f 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -654,7 +654,8 @@ TracksView::removeMediaItem( TrackWorkflow *tw, const QUuid &uuid )
     {
         AbstractGraphicsMediaItem *item =
                 dynamic_cast<AbstractGraphicsMediaItem*>( trackItems.at( i ) );
-        if ( !item || item->uuid() != uuid ) continue;
+        if ( !item || item->uuid() != uuid )
+            continue;
         removeMediaItem( item );
     }
 }
@@ -662,31 +663,9 @@ TracksView::removeMediaItem( TrackWorkflow *tw, const QUuid &uuid )
 void
 TracksView::removeMediaItem( AbstractGraphicsMediaItem *item )
 {
-    QList<AbstractGraphicsMediaItem*> items;
-    items.append( item );
-    removeMediaItem( items );
+    delete item;
     m_clipsLoaded.remove( item->clipHelper()->uuid() );
-}
-
-void
-TracksView::removeMediaItem( const QList<AbstractGraphicsMediaItem*> &items )
-{
-    bool needUpdate = false;
-    for ( int i = 0; i < items.size(); ++i )
-    {
-        GraphicsMovieItem *movieItem = qgraphicsitem_cast<GraphicsMovieItem*>( items.at( i ) );
-        if ( !movieItem )
-        {
-            //TODO add support for audio tracks
-            qWarning() << tr( "Action not supported." );
-            continue;
-        }
-
-        delete movieItem;
-        needUpdate = true;
-    }
-
-    if ( needUpdate ) updateDuration();
+    updateDuration();
 }
 
 void
diff --git a/src/Gui/timeline/TracksView.h b/src/Gui/timeline/TracksView.h
index a0dfec6..8814882 100644
--- a/src/Gui/timeline/TracksView.h
+++ b/src/Gui/timeline/TracksView.h
@@ -160,12 +160,6 @@ public:
      */
     QList<AbstractGraphicsItem*> timelineItems();
     /**
-     * \brief Remove multiple items from the timeline.
-     * \param items A QList of pointers to AbstractGraphicsMediaItem.
-     * \sa removeMediaItem( AbstractGraphicsMediaItem* )
-     */
-    void                    removeMediaItem( const QList<AbstractGraphicsMediaItem*> &items );
-    /**
      * \brief Change the currently selected tool.
      * \param button The selected tool button.
      * \sa tool, ToolButtons



More information about the Vlmc-devel mailing list