[vlc-commits] qt: don't add filter if already enabled
Victorien Le Couviour--Tuffet
git at videolan.org
Sat Jul 1 18:25:16 CEST 2017
vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Mon Jun 26 16:17:01 2017 +0200| [ec4135def15d4bb8829f6f8f6211eaf1da35f093] | committer: Thomas Guillem
qt: don't add filter if already enabled
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ec4135def15d4bb8829f6f8f6211eaf1da35f093
---
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 );
More information about the vlc-commits
mailing list