[vlmc-devel] [PATCH 1/2] Clip: Use mediaContainer() instead of getChilds()

Yikai Lu luyikei.qmltu at gmail.com
Sun Apr 10 06:23:48 CEST 2016


---
 src/Gui/library/MediaCellView.cpp | 12 ++++++------
 src/Gui/library/MediaListView.cpp |  4 ++--
 src/Library/MediaContainer.cpp    |  2 +-
 src/Media/Clip.cpp                |  4 ++--
 src/Media/Clip.h                  |  4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/Gui/library/MediaCellView.cpp b/src/Gui/library/MediaCellView.cpp
index bee1308..37aff3b 100644
--- a/src/Gui/library/MediaCellView.cpp
+++ b/src/Gui/library/MediaCellView.cpp
@@ -54,12 +54,12 @@ MediaCellView::MediaCellView( Clip* clip, QWidget *parent ) :
     connect( m_ui->arrow,
              SIGNAL( clicked( QWidget*, QMouseEvent* ) ),
              SLOT( arrowButtonClicked( QWidget*, QMouseEvent* ) ) );
-    m_ui->clipCount->setText( QString::number( clip->getChilds()->count() ) );
-    connect( clip->getChilds(), SIGNAL( newClipLoaded( Clip* ) ),
+    m_ui->clipCount->setText( QString::number( clip->mediaContainer()->count() ) );
+    connect( clip->mediaContainer(), SIGNAL( newClipLoaded( Clip* ) ),
              this, SLOT( nbClipUpdated() ) );
-    connect( clip->getChilds(), SIGNAL( clipRemoved( const QUuid& ) ),
+    connect( clip->mediaContainer(), SIGNAL( clipRemoved( const QUuid& ) ),
              this, SLOT( nbClipUpdated() ) );
-    if ( clip->getChilds()->count() == 0 )
+    if ( clip->mediaContainer()->count() == 0 )
     {
         m_ui->clipCount->hide();
         m_ui->clipCountLabel->hide();
@@ -145,9 +145,9 @@ MediaCellView::nbClipUpdated()
     quint32     nbClips;
 
     if ( m_clip->isRootClip() == true )
-        nbClips = m_clip->getChilds()->count();
+        nbClips = m_clip->mediaContainer()->count();
     else
-        nbClips = m_clip->getParent()->getChilds()->count();
+        nbClips = m_clip->getParent()->mediaContainer()->count();
 
     if ( nbClips == 0 )
     {
diff --git a/src/Gui/library/MediaListView.cpp b/src/Gui/library/MediaListView.cpp
index 6cbe303..a98d3ce 100644
--- a/src/Gui/library/MediaListView.cpp
+++ b/src/Gui/library/MediaListView.cpp
@@ -111,8 +111,8 @@ MediaListView::showSubClips( const QUuid &uuid )
 {
     Clip    *clip = m_mediaContainer->clip( uuid );
     MediaListView* view = new MediaListView( m_nav );
-    view->setMediaContainer( clip->getChilds() );
-    clip->getChilds()->reloadAllClips();
+    view->setMediaContainer( clip->mediaContainer() );
+    clip->mediaContainer()->reloadAllClips();
     m_nav->pushViewController( view );
 }
 
diff --git a/src/Library/MediaContainer.cpp b/src/Library/MediaContainer.cpp
index bfcde64..cb00d33 100644
--- a/src/Library/MediaContainer.cpp
+++ b/src/Library/MediaContainer.cpp
@@ -60,7 +60,7 @@ MediaContainer::clip( const QString &uuid )
             return clip;
         else
         {
-            auto c = clip->getChilds()->clip( uuid );
+            auto c = clip->mediaContainer()->clip( uuid );
             if ( c != nullptr )
                 return c;
         }
diff --git a/src/Media/Clip.cpp b/src/Media/Clip.cpp
index 3750466..7be0ba5 100644
--- a/src/Media/Clip.cpp
+++ b/src/Media/Clip.cpp
@@ -195,13 +195,13 @@ Clip::getParent() const
 }
 
 MediaContainer*
-Clip::getChilds()
+Clip::mediaContainer()
 {
     return m_childs;
 }
 
 const MediaContainer*
-Clip::getChilds() const
+Clip::mediaContainer() const
 {
     return m_childs;
 }
diff --git a/src/Media/Clip.h b/src/Media/Clip.h
index ce635af..b1fd525 100644
--- a/src/Media/Clip.h
+++ b/src/Media/Clip.h
@@ -98,8 +98,8 @@ class   Clip : public QObject
 
         Clip                *getParent();
         const Clip          *getParent() const;
-        MediaContainer*     getChilds();
-        const MediaContainer*     getChilds() const;
+        MediaContainer*     mediaContainer();
+        const MediaContainer*     mediaContainer() const;
 
         /**
             \brief          Returns an unique Uuid for this clip (which is NOT the
-- 
1.9.1



More information about the Vlmc-devel mailing list