Commit 6b9f4f71 authored by Geoffroy Lacarriere's avatar Geoffroy Lacarriere

Import: Bugfix of the filter type file

parent 159802e6
......@@ -56,6 +56,7 @@ ImportController::ImportController(QWidget *parent) :
m_filesModel->sort( 0, Qt::AscendingOrder );
m_filesModel->setNameFilters( filters );
m_model->setFilter( filters );
m_ui->treeView->setModel( m_filesModel );
m_ui->treeView->setRootIndex( m_filesModel->index( QDir::rootPath() ) );
m_ui->treeView->setCurrentIndex( m_filesModel->index( QDir::homePath() ) );
......@@ -185,6 +186,7 @@ void ImportController::treeViewDoubleClicked( const QModelIndex& index )
void ImportController::reject()
{
m_preview->stop();
done( Rejected );
}
void ImportController::accept()
......
......@@ -105,17 +105,11 @@ void ImportModel::loadFile( const QFileInfo& fileInfo )
else
{
QDir dir = QDir( fileInfo.filePath() );
for( uint i = 0; i < dir.count() ; i++)
{
QFileInfo info = QFileInfo(dir.filePath( dir[i] ) );
if ( info.isDir() )
continue ;
if ( !mediaAlreadyLoaded( info ) )
{
media = new Media( info.filePath() );
loadMedia( media );
}
}
QFileInfoList list = dir.entryInfoList( m_filters );
QFileInfo file;
foreach( file, list )
loadFile( file );
}
}
......
......@@ -26,6 +26,8 @@
#include <QObject>
#include <QHash>
#include <QFileSystemModel>
#include <QDirModel>
#include "Media.h"
#include "Clip.h"
......@@ -47,6 +49,7 @@ public:
void removeMedia( const QUuid& mediaId );
void removeClip( const QUuid& mediaId, const QUuid& clipId );
QHash<QUuid, Media*>* getMedias() const { return m_medias; }
void setFilter( const QStringList& filter ) { m_filters = filter; }
signals:
void newMediaLoaded( Media* media );
......@@ -55,6 +58,7 @@ signals:
private:
QHash<QUuid, Media*>* m_medias;
MetaDataWorker* m_metaDataWorker;
QStringList m_filters;
void loadMedia( Media* media );
bool mediaAlreadyLoaded( const QFileInfo& fileInfo );
......
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