Skip to content

Commit

Permalink
Sort effects in dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Serrano Polo committed Jun 11, 2016
1 parent 1abbbc2 commit 467e846
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
18 changes: 18 additions & 0 deletions include/Plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ class EXPORT Plugin : public Model, public JournallingObject
return desc != NULL && name.isNull() == false;
}

QString displayName() const
{
if( desc->subPluginFeatures )
{
return QString( "%1: %2" ).arg(
desc->displayName,
name );
}
return desc->displayName;
}

const Plugin::Descriptor* desc;
QString name;
AttributeMap attributes;
Expand Down Expand Up @@ -195,4 +206,11 @@ class EXPORT Plugin : public Model, public JournallingObject
} ;


inline bool operator<( const Plugin::Descriptor::SubPluginFeatures::Key & k1,
const Plugin::Descriptor::SubPluginFeatures::Key & k2 )
{
return k1.displayName() < k2.displayName();
}


#endif
10 changes: 2 additions & 8 deletions src/gui/EffectSelectDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,13 @@ EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) :
}

m_effectKeys += subPluginEffectKeys;
qSort( m_effectKeys );

// and fill our source model
QStringList pluginNames;
for( EffectKeyList::ConstIterator it = m_effectKeys.begin(); it != m_effectKeys.end(); ++it )
{
if( ( *it ).desc->subPluginFeatures )
{
pluginNames += QString( "%1: %2" ).arg( ( *it ).desc->displayName, ( *it ).name );
}
else
{
pluginNames += ( *it ).desc->displayName;
}
pluginNames += ( *it ).displayName();
}

int row = 0;
Expand Down

0 comments on commit 467e846

Please sign in to comment.