Commit eb276da5 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

EffectsEngine: Loading the effect when starting up.

This uses a hardcoded path, this is wrong, and should be removed.
parent c7b3ed5e
......@@ -24,6 +24,8 @@
#include "Effect.h"
#include <QDir>
EffectsEngine::EffectsEngine()
{
Effect *e = new Effect("libbw0r");
......@@ -61,3 +63,15 @@ EffectsEngine::loadEffect( const QString &fileName )
emit effectAdded( e, e->type() );
return true;
}
void
EffectsEngine::browseDirectory( const QString &path )
{
QDir dir( path );
const QStringList& files = dir.entryList( QDir::Files | QDir::NoDotAndDotDot |
QDir::Readable | QDir::Executable );
foreach ( const QString& file, files )
{
loadEffect( path + '/' + file );
}
}
......@@ -38,6 +38,7 @@ class EffectsEngine : public QObject, public Singleton<EffectsEngine>
void initAll( quint32 width, quint32 height );
Effect* effect( qint32 idx );
bool loadEffect( const QString& fileName );
void browseDirectory( const QString& path );
private:
EffectsEngine();
~EffectsEngine();
......
......@@ -38,6 +38,7 @@
#include "About.h"
#include "VlmcDebug.h"
#include "EffectsEngine/EffectsEngine.h"
#include "MainWorkflow.h"
#include "export/RendererSettings.h"
#include "export/ShareOnYoutube.h"
......@@ -458,6 +459,8 @@ MainWindow::initializeDockWidgets( void )
QT_TRANSLATE_NOOP( "DockWidgetManager", "Effects List" ),
Qt::AllDockWidgetAreas, QDockWidget::AllDockWidgetFeatures,
Qt::LeftDockWidgetArea );
//FIXME !!!
EffectsEngine::getInstance()->browseDirectory( "/usr/lib/frei0r-1" );
QDockWidget* dock = dockManager->addDockedWidget( UndoStack::getInstance( this ),
QT_TRANSLATE_NOOP( "DockWidgetManager", "History" ),
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include "EffectsList.h"
#include "EffectsEngine/EffectsEngine.h"
#include "ui_EffectsList.h"
#include <QStandardItemModel>
......@@ -35,6 +36,8 @@ EffectsList::EffectsList(QWidget *parent) :
m_ui->filterList->setModel( m_filtersModel );
m_ui->effectsList->setModel( m_effectsModel );
connect( EffectsEngine::getInstance(), SIGNAL( effectAdded( Effect*, Effect::Type ) ),
this, SLOT( effectAdded(Effect*,Effect::Type) ) );
}
EffectsList::~EffectsList()
......
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