Commit 298cbb4e authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Unbreak clip counting in the import window

parent dfd60aab
......@@ -320,8 +320,6 @@ ImportController::showClipList( const QUuid& uuid )
this, SLOT( clipSelection( const QUuid& ) ) );
connect( m_clipListController, SIGNAL( clipDeleted( const QUuid& ) ),
this, SLOT( clipDeletion( const QUuid& ) ) );
foreach ( Clip* clip, media->clips().values() )
m_clipListController->addClip( clip );
if ( !m_currentUuid.isNull() )
m_savedUuid = m_currentUuid;
m_stackNav->pushViewController( m_clipListController );
......
......@@ -190,24 +190,6 @@ void MediaCellView::setLength( qint64 length, bool mSecs )
m_ui->length->setText( duration.toString( "hh:mm:ss" ) );
}
void MediaCellView::incrementClipCount()
{
int clips = m_ui->clipCount->text().toInt();
clips += 1;
m_ui->clipCount->setText( QString::number( clips ) );
}
void MediaCellView::decrementClipCount( const int nb )
{
int clips = m_ui->clipCount->text().toInt();
clips -= nb;
if ( clips < 0 )
clips = 0;
m_ui->clipCount->setText( QString::number( clips ) );
}
void
MediaCellView::containsClip()
{
......
......@@ -52,8 +52,6 @@ public:
* \param length The media length, in ms.
*/
void setLength( qint64 length, bool mSecs = true );
void incrementClipCount();
void decrementClipCount( const int nb );
QString title() const;
void containsClip();
const QUuid& uuid() const;
......
......@@ -52,8 +52,6 @@ void MediaListViewController::newMediaLoaded( Media* media )
this, SIGNAL( clipDeleted( QUuid ) ) );
connect( cell, SIGNAL( arrowClicked( const QUuid& ) ),
this, SLOT( showClipList( const QUuid& ) ) );
connect( media, SIGNAL( clipAdded( Clip* ) ),
this, SLOT( newClipAdded(Clip*) ) );
addCell(cell);
m_cells->insert( media->baseClip()->uuid(), cell );
}
......@@ -110,28 +108,6 @@ void MediaListViewController::showClipList( const QUuid& uuid )
m_nav->pushViewController( m_clipsListView );
}
void MediaListViewController::newClipAdded( Clip* clip )
{
if ( clip->getParent() == 0 )
return ;
const QUuid& uuid = clip->getParent()->baseClip()->uuid();
if ( m_cells->contains( uuid ) )
{
MediaCellView* cell = qobject_cast<MediaCellView*>( m_cells->value( uuid, 0 ) );
if ( cell != 0 )
{
cell->incrementClipCount();
}
}
}
void
MediaListViewController::addClip( Clip *clip )
{
newClipAdded( clip );
}
void MediaListViewController::restoreContext()
{
MediaCellView* cell = qobject_cast<MediaCellView*>( m_cells->value( m_lastUuidClipListAsked, 0 ) );
......
......@@ -38,7 +38,6 @@ class MediaListViewController : public ListViewController
public:
MediaListViewController( StackViewController* nav, MediaContainer* mc );
virtual ~MediaListViewController();
void addClip( Clip* clip );
private:
StackViewController* m_nav;
......@@ -55,7 +54,6 @@ public slots:
private slots:
void restoreContext();
void newClipAdded( Clip* clip );
void mediaRemoved( const QUuid& uuid );
void newMediaLoaded( Media* media );
......
......@@ -117,6 +117,7 @@ public:
* \todo This method should not be here, as it is not generic at all.
*/
virtual Media* getMedia() = 0;
/**
* \brief Return the length in frames
* \warning The returned value may not be accurate as it depends on FPS, that
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment