Commit ec4135de authored by Victorien Le Couviour--Tuffet's avatar Victorien Le Couviour--Tuffet Committed by Thomas Guillem

qt: don't add filter if already enabled

parent d6cf09e3
......@@ -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 );
......
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