[vlc-devel] [PATCH 7/8] qt: don't add filter if already enabled

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Tue Jun 27 17:38:47 CEST 2017


---
 modules/gui/qt/components/extended_panels.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/extended_panels.cpp b/modules/gui/qt/components/extended_panels.cpp
index 504aa257fa..e5eee3a2b1 100644
--- a/modules/gui/qt/components/extended_panels.cpp
+++ b/modules/gui/qt/components/extended_panels.cpp
@@ -293,8 +293,10 @@ static QString ChangeFiltersString( struct intf_thread_t *p_intf, const char *ps
     QString const chain = QString( psz_chain ? psz_chain : "" );
     QStringList list = chain.split( ':', QString::SplitBehavior::SkipEmptyParts );
 
-    if( b_add ) list << psz_name;
-    else        list.removeAll( psz_name );
+    if( b_add && std::find(list.begin(), list.end(), psz_name) == list.end() )
+        list << psz_name;
+    else if (!b_add)
+        list.removeAll( psz_name );
 
     free( psz_chain );
 
-- 
2.13.1



More information about the vlc-devel mailing list