Commit 054f9c58 authored by Geoffroy Lacarriere's avatar Geoffroy Lacarriere

[Import]: Refactor:

Importing medias is available again
parent cafe9d50
#include "ImportController.h"
#include "ui_ImportController.h"
#include "ClipRenderer.h"
#include "Library.h"
ImportController::ImportController(QWidget *parent) :
QDialog(parent),
......@@ -73,8 +74,8 @@ void ImportController::changeEvent( QEvent *e )
void ImportController::newMediaLoaded( Media* media )
{
Q_UNUSED( media );
qDebug() << media->getFileName();
m_mediaListController->addMedia( media );
}
void ImportController::updateMediaRequested( Media* media )
......@@ -103,3 +104,14 @@ void ImportController::treeViewDoubleClicked( const QModelIndex& index )
if ( !m_filesModel->isDir( index ) )
forwardButtonClicked();
}
void ImportController::accept()
{
QUuid id;
foreach( id, m_model->getMedias()->keys() )
{
Media* media = m_model->getMedias()->value( id );
Library::getInstance()->addMedia( media );
}
done( Accepted );
}
......@@ -41,6 +41,7 @@ private:
public slots:
void newMediaLoaded( Media* media );
void updateMediaRequested( Media* media );
void accept();
private slots:
void forwardButtonClicked();
......
......@@ -21,6 +21,11 @@ const Media* ImportModel::getMedia( const QUuid& mediaId ) const
return m_medias->value( mediaId );
}
const QHash<QUuid, Media*>* ImportModel::getMedias() const
{
return m_medias;
}
const Clip* ImportModel::getClip( const QUuid& mediaId, const QUuid& clipId ) const
{
Media* media = m_medias->value( mediaId );
......
......@@ -17,6 +17,7 @@ public:
~ImportModel();
const Media* getMedia( const QUuid& mediaId ) const;
const QHash<QUuid, Media*>* getMedias() const;
const Clip* getClip( const QUuid& mediaId, const QUuid& clipId ) const;
void cutMedia( const QUuid& mediaId, int frame );
void cutClip( const QUuid& mediaId, const QUuid& clipId, int frame );
......
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