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

EffectsEngine: Emit the new effect signal with the effect name.

parent 9252c449
......@@ -81,7 +81,7 @@ EffectsEngine::loadEffect( const QString &fileName )
{
type = static_cast<Effect::Type>( typeInt );
m_effects[name] = e;
emit effectAdded( e, type );
emit effectAdded( e, name, type );
return true;
}
}
......@@ -95,7 +95,7 @@ EffectsEngine::loadEffect( const QString &fileName )
m_cache->setValue( fileName + "/type", e->type() );
name = e->name();
type = e->type();
emit effectAdded( e, type );
emit effectAdded( e, name, type );
return true;
}
......
......@@ -63,7 +63,7 @@ class EffectsEngine : public QObject, public Singleton<EffectsEngine>
QSettings *m_cache;
signals:
void effectAdded( Effect*, Effect::Type );
void effectAdded( Effect*, const QString& name, Effect::Type );
friend class Singleton<EffectsEngine>;
};
......
......@@ -11,8 +11,10 @@ EffectsListView::EffectsListView(QWidget *parent) :
QListView(parent)
{
m_model = new QStandardItemModel( this );
connect( EffectsEngine::getInstance(), SIGNAL( effectAdded( Effect*, Effect::Type ) ),
this, SLOT( effectAdded(Effect*,Effect::Type) ) );
connect( EffectsEngine::getInstance(),
SIGNAL( effectAdded( Effect*, const QString&, Effect::Type ) ),
this,
SLOT( effectAdded(Effect*, const QString&, Effect::Type) ) );
setModel( m_model );
setEditTriggers( QListView::NoEditTriggers );
setDragEnabled( true );
......@@ -20,10 +22,10 @@ EffectsListView::EffectsListView(QWidget *parent) :
}
void
EffectsListView::effectAdded( Effect *effect, Effect::Type type )
EffectsListView::effectAdded( Effect *, const QString& name, Effect::Type type )
{
if ( type == m_type )
m_model->appendRow( new QStandardItem( effect->name() ) );
m_model->appendRow( new QStandardItem( name ) );
}
void
......
......@@ -24,7 +24,8 @@ class EffectsListView : public QListView
Effect::Type m_type;
QPoint m_dragStartPos;
public slots:
void effectAdded( Effect *effect, Effect::Type type );
void effectAdded( Effect *effect, const QString& name,
Effect::Type type );
};
#endif // EFFECTLISTVIEW_H
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