From a965fca0b9a3deacef0a359d9329f2fa0a58e2a0 Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Mon, 28 May 2012 22:50:28 +0200 Subject: [PATCH] fix #5030 --- src/gui/qgsprojectionselector.cpp | 9 +++++++++ src/gui/qgsprojectionselector.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/gui/qgsprojectionselector.cpp b/src/gui/qgsprojectionselector.cpp index 99da9616683..6488f24eb39 100644 --- a/src/gui/qgsprojectionselector.cpp +++ b/src/gui/qgsprojectionselector.cpp @@ -32,6 +32,7 @@ QgsProjectionSelector::QgsProjectionSelector( QWidget* parent, const char *name, , mUserProjListDone( false ) , mRecentProjListDone( false ) , mSearchColumn( NONE ) + , mSkipFirstRecent( true ) { Q_UNUSED( name ); setupUi( this ); @@ -548,6 +549,7 @@ void QgsProjectionSelector::loadUserCrsList( QSet *crsFilter ) // newItem->setText( EPSG_COLUMN, QString::fromUtf8(( char * )sqlite3_column_text( stmt, 2 ) ) ); // display the qgis srs_id (field 1) in the third column of the list view newItem->setText( QGIS_CRS_ID_COLUMN, QString::fromUtf8(( char * )sqlite3_column_text( stmt, 1 ) ) ); + newItem->setText( AUTHID_COLUMN, QString( "USER:%1" ).arg( QString::fromUtf8(( char * )sqlite3_column_text( stmt, 1 ) ).toInt() ) ); } } // close the sqlite3 statement @@ -738,6 +740,7 @@ void QgsProjectionSelector::on_lstCoordinateSystems_currentItemChanged( QTreeWid { QgsDebugMsg( QString( "srs %1 not recent" ).arg( current->text( QGIS_CRS_ID_COLUMN ) ) ); lstRecent->clearSelection(); + lstCoordinateSystems->setFocus( Qt::OtherFocusReason ); } } else @@ -753,6 +756,12 @@ void QgsProjectionSelector::on_lstRecent_currentItemChanged( QTreeWidgetItem *cu { QgsDebugMsg( "Entered." ); + if ( mSkipFirstRecent ) + { + mSkipFirstRecent = true; + return; + } + if ( !current ) { QgsDebugMsg( "no current item" ); diff --git a/src/gui/qgsprojectionselector.h b/src/gui/qgsprojectionselector.h index 66803f9b6d6..d9f47edfd10 100644 --- a/src/gui/qgsprojectionselector.h +++ b/src/gui/qgsprojectionselector.h @@ -184,6 +184,8 @@ class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProjectio //! Has the User Projection List been populated? bool mUserProjListDone; + bool mSkipFirstRecent; + //! Has the Recent Projection List been populated? bool mRecentProjListDone;