[vlmc-devel] MLTService: Always connect to the filter when attaching

Yikai Lu git at videolan.org
Tue Jun 28 10:39:45 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Jun 28 15:53:45 2016 +0900| [10eddac86a338385ce3e331ea7bb03554911aa03] | committer: Yikai Lu

MLTService: Always connect to the filter when attaching

> https://code.videolan.org/videolan/vlmc/commit/10eddac86a338385ce3e331ea7bb03554911aa03
---

 src/Backend/MLT/MLTService.cpp                    | 4 +++-
 src/Commands/Commands.cpp                         | 1 -
 src/EffectsEngine/EffectHelper.cpp                | 2 --
 src/Gui/effectsengine/EffectInstanceListModel.cpp | 1 -
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/Backend/MLT/MLTService.cpp b/src/Backend/MLT/MLTService.cpp
index 8642da8..44473b3 100644
--- a/src/Backend/MLT/MLTService.cpp
+++ b/src/Backend/MLT/MLTService.cpp
@@ -77,7 +77,9 @@ MLTService::attach( Backend::IFilter& filter )
 {
     MLTFilter* mltFilter = dynamic_cast<MLTFilter*>( &filter );
     assert( mltFilter );
-    return m_service->attach( *mltFilter->m_filter );
+    auto ret = m_service->attach( *mltFilter->m_filter );
+    mltFilter->connect( *this );
+    return ret;
 }
 
 bool
diff --git a/src/Commands/Commands.cpp b/src/Commands/Commands.cpp
index 5c82577..d25ca93 100644
--- a/src/Commands/Commands.cpp
+++ b/src/Commands/Commands.cpp
@@ -289,7 +289,6 @@ void
 Commands::Effect::Add::internalRedo()
 {
     m_target->attach( *m_helper->filter() );
-    m_helper->filter()->connect( *m_target );
 }
 
 void
diff --git a/src/EffectsEngine/EffectHelper.cpp b/src/EffectsEngine/EffectHelper.cpp
index 1703f69..1abe828 100644
--- a/src/EffectsEngine/EffectHelper.cpp
+++ b/src/EffectsEngine/EffectHelper.cpp
@@ -219,7 +219,6 @@ EffectHelper::loadFromVariant( const QVariant& variant, Backend::IService* servi
     {
         EffectHelper helper( var );
         service->attach( *helper.filter() );
-        helper.filter()->connect( *helper.filter() );
     }
 }
 
@@ -272,7 +271,6 @@ EffectHelper::setTarget( Backend::IService* service )
         m_service->detach( *m_filter );
     m_service = service;
     m_service->attach( *m_filter );
-    m_filter->connect( *m_service );
 }
 
 Backend::IService*
diff --git a/src/Gui/effectsengine/EffectInstanceListModel.cpp b/src/Gui/effectsengine/EffectInstanceListModel.cpp
index c5fdb67..9c6b62c 100644
--- a/src/Gui/effectsengine/EffectInstanceListModel.cpp
+++ b/src/Gui/effectsengine/EffectInstanceListModel.cpp
@@ -116,7 +116,6 @@ EffectInstanceListModel::add( const QString &effectName )
         return nullptr;
     }
     m_service->attach( *helper->filter() );
-    helper->filter()->connect( *m_service );
     endInsertRows();
     return helper;
 }



More information about the Vlmc-devel mailing list