@@ -34,14 +34,16 @@ const int NAME_COLUMN = 0;
34
34
const int AUTHID_COLUMN = 1 ;
35
35
const int QGIS_CRS_ID_COLUMN = 2 ;
36
36
37
- QgsProjectionSelector::QgsProjectionSelector ( QWidget* parent, const char * name, Qt::WFlags fl )
37
+ QgsProjectionSelector::QgsProjectionSelector ( QWidget* parent, const char *name, Qt::WFlags fl )
38
38
: QWidget( parent, fl )
39
39
, mProjListDone( false )
40
40
, mUserProjListDone( false )
41
+ , mRecentProjListDone( false )
41
42
, mCRSNameSelectionPending( false )
42
43
, mCRSIDSelectionPending( false )
43
44
, mAuthIDSelectionPending( false )
44
45
{
46
+ Q_UNUSED ( name );
45
47
setupUi ( this );
46
48
connect ( lstCoordinateSystems, SIGNAL ( currentItemChanged ( QTreeWidgetItem*, QTreeWidgetItem* ) ),
47
49
this , SLOT ( coordinateSystemSelected ( QTreeWidgetItem* ) ) );
@@ -168,10 +170,12 @@ void QgsProjectionSelector::showEvent( QShowEvent * theEvent )
168
170
applySelection ();
169
171
}
170
172
171
- lstRecent->clear ();
172
-
173
- for ( int i = mRecentProjections .size () - 1 ; i >= 0 ; i-- )
174
- insertRecent ( mRecentProjections .at ( i ).toLong () );
173
+ if ( !mRecentProjListDone )
174
+ {
175
+ for ( int i = mRecentProjections .size () - 1 ; i >= 0 ; i-- )
176
+ insertRecent ( mRecentProjections .at ( i ).toLong () );
177
+ mRecentProjListDone = true ;
178
+ }
175
179
176
180
// Pass up the inheritance hierarchy
177
181
QWidget::showEvent ( theEvent );
@@ -858,10 +862,9 @@ void QgsProjectionSelector::on_cbxHideDeprecated_stateChanged()
858
862
859
863
void QgsProjectionSelector::on_lstRecent_currentItemChanged ( QTreeWidgetItem *current, QTreeWidgetItem *previous )
860
864
{
865
+ Q_UNUSED ( previous );
861
866
if ( current )
862
- {
863
867
setSelectedCrsId ( current->text ( QGIS_CRS_ID_COLUMN ).toLong () );
864
- }
865
868
}
866
869
867
870
void QgsProjectionSelector::on_pbnFind_clicked ()
0 commit comments