From dd1a227963654f4e3af97c5949e0e03e9e24ef90 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 23 Feb 2014 17:34:40 +0100 Subject: [PATCH] EffectSelectDialog: sort effect keys instead of plugin names Commit 360bfe5089c9fd13847b9b982011305fd63daf3f broke mapping between displayed and internal effect list. Fix this by sorting the effect key list itself. --- src/gui/EffectSelectDialog.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gui/EffectSelectDialog.cpp b/src/gui/EffectSelectDialog.cpp index 7bca583ea..321100f4d 100644 --- a/src/gui/EffectSelectDialog.cpp +++ b/src/gui/EffectSelectDialog.cpp @@ -44,6 +44,8 @@ EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : // query effects Plugin::getDescriptorsOfAvailPlugins( m_pluginDescriptors ); + EffectKeyList subPluginEffectKeys; + for( Plugin::DescriptorList::ConstIterator it = m_pluginDescriptors.begin(); it != m_pluginDescriptors.end(); ++it ) { @@ -60,7 +62,7 @@ EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : // so we're on the safe side and the compiler // likely will reduce that to just "it" &( *it ), - m_effectKeys ); + subPluginEffectKeys ); } else { @@ -69,14 +71,15 @@ EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : } } + m_effectKeys += subPluginEffectKeys; + // and fill our source model QStringList pluginNames; - QStringList subPluginNames; for( EffectKeyList::ConstIterator it = m_effectKeys.begin(); it != m_effectKeys.end(); ++it ) { if( ( *it ).desc->subPluginFeatures ) { - subPluginNames += QString( "%1: %2" ).arg( ( *it ).desc->displayName, ( *it ).name ); + pluginNames += QString( "%1: %2" ).arg( ( *it ).desc->displayName, ( *it ).name ); } else { @@ -84,11 +87,6 @@ EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : } } - qSort( pluginNames ); - qSort( subPluginNames ); - - pluginNames += subPluginNames; - int row = 0; for( QStringList::ConstIterator it = pluginNames.begin(); it != pluginNames.end(); ++it )