Skip to content

Commit

Permalink
fix #5494
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 16, 2012
1 parent c64f5cd commit fd17247
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/gui/qgsprojectionselector.cpp
Expand Up @@ -802,14 +802,18 @@ void QgsProjectionSelector::on_cbxHideDeprecated_stateChanged()


void QgsProjectionSelector::on_leSearch_textChanged( const QString & theFilterTxt ) void QgsProjectionSelector::on_leSearch_textChanged( const QString & theFilterTxt )
{ {
QString filterTxt = theFilterTxt;
filterTxt.replace( QRegExp( "\\s+" ), ".*" );
QRegExp re( filterTxt, Qt::CaseInsensitive );

// filter recent crs's // filter recent crs's
QTreeWidgetItemIterator itr( lstRecent ); QTreeWidgetItemIterator itr( lstRecent );
while ( *itr ) while ( *itr )
{ {
if (( *itr )->childCount() == 0 ) // it's an end node aka a projection if (( *itr )->childCount() == 0 ) // it's an end node aka a projection
{ {
if (( *itr )->text( NAME_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive ) if (( *itr )->text( NAME_COLUMN ).contains( re )
|| ( *itr )->text( AUTHID_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive ) || ( *itr )->text( AUTHID_COLUMN ).contains( re )
) )
{ {
( *itr )->setHidden( false ); ( *itr )->setHidden( false );
Expand Down Expand Up @@ -839,8 +843,8 @@ void QgsProjectionSelector::on_leSearch_textChanged( const QString & theFilterTx
{ {
if (( *it )->childCount() == 0 ) // it's an end node aka a projection if (( *it )->childCount() == 0 ) // it's an end node aka a projection
{ {
if (( *it )->text( NAME_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive ) if (( *it )->text( NAME_COLUMN ).contains( re )
|| ( *it )->text( AUTHID_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive ) || ( *it )->text( AUTHID_COLUMN ).contains( re )
) )
{ {
( *it )->setHidden( false ); ( *it )->setHidden( false );
Expand Down

0 comments on commit fd17247

Please sign in to comment.