Skip to content

Commit fd17247

Browse files
committed
fix #5494
1 parent c64f5cd commit fd17247

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/gui/qgsprojectionselector.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -802,14 +802,18 @@ void QgsProjectionSelector::on_cbxHideDeprecated_stateChanged()
802802

803803
void QgsProjectionSelector::on_leSearch_textChanged( const QString & theFilterTxt )
804804
{
805+
QString filterTxt = theFilterTxt;
806+
filterTxt.replace( QRegExp( "\\s+" ), ".*" );
807+
QRegExp re( filterTxt, Qt::CaseInsensitive );
808+
805809
// filter recent crs's
806810
QTreeWidgetItemIterator itr( lstRecent );
807811
while ( *itr )
808812
{
809813
if (( *itr )->childCount() == 0 ) // it's an end node aka a projection
810814
{
811-
if (( *itr )->text( NAME_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive )
812-
|| ( *itr )->text( AUTHID_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive )
815+
if (( *itr )->text( NAME_COLUMN ).contains( re )
816+
|| ( *itr )->text( AUTHID_COLUMN ).contains( re )
813817
)
814818
{
815819
( *itr )->setHidden( false );
@@ -839,8 +843,8 @@ void QgsProjectionSelector::on_leSearch_textChanged( const QString & theFilterTx
839843
{
840844
if (( *it )->childCount() == 0 ) // it's an end node aka a projection
841845
{
842-
if (( *it )->text( NAME_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive )
843-
|| ( *it )->text( AUTHID_COLUMN ).contains( theFilterTxt, Qt::CaseInsensitive )
846+
if (( *it )->text( NAME_COLUMN ).contains( re )
847+
|| ( *it )->text( AUTHID_COLUMN ).contains( re )
844848
)
845849
{
846850
( *it )->setHidden( false );

0 commit comments

Comments
 (0)