[vlmc-devel] commit: EffectsEngine: Emit the new effect signal with the effect name. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Wed Jul 28 00:22:09 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Jul 27 23:21:53 2010 +0200| [d72e196cb352267fc0ae0b4136cffc7d948fbf91] | committer: Hugo Beauzée-Luyssen 

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

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=d72e196cb352267fc0ae0b4136cffc7d948fbf91
---

 src/EffectsEngine/EffectsEngine.cpp       |    4 ++--
 src/EffectsEngine/EffectsEngine.h         |    2 +-
 src/Gui/effectsengine/EffectsListView.cpp |   10 ++++++----
 src/Gui/effectsengine/EffectsListView.h   |    3 ++-
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/EffectsEngine/EffectsEngine.cpp b/src/EffectsEngine/EffectsEngine.cpp
index d8cf2ec..d159683 100644
--- a/src/EffectsEngine/EffectsEngine.cpp
+++ b/src/EffectsEngine/EffectsEngine.cpp
@@ -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;
 }
 
diff --git a/src/EffectsEngine/EffectsEngine.h b/src/EffectsEngine/EffectsEngine.h
index fb8d886..839a55f 100644
--- a/src/EffectsEngine/EffectsEngine.h
+++ b/src/EffectsEngine/EffectsEngine.h
@@ -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>;
 };
 
diff --git a/src/Gui/effectsengine/EffectsListView.cpp b/src/Gui/effectsengine/EffectsListView.cpp
index 82935d9..1b04862 100644
--- a/src/Gui/effectsengine/EffectsListView.cpp
+++ b/src/Gui/effectsengine/EffectsListView.cpp
@@ -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
diff --git a/src/Gui/effectsengine/EffectsListView.h b/src/Gui/effectsengine/EffectsListView.h
index c455324..3c22109 100644
--- a/src/Gui/effectsengine/EffectsListView.h
+++ b/src/Gui/effectsengine/EffectsListView.h
@@ -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



More information about the Vlmc-devel mailing list