Skip to content
Permalink
Browse files

fix for crash in projection selection

  • Loading branch information
brushtyler committed Nov 8, 2011
1 parent 641bd67 commit 98d5a7665ce75bc2f406e89f4efc755995d30a73
Showing with 12 additions and 5 deletions.
  1. +9 −5 src/gui/qgsprojectionselector.cpp
  2. +3 −0 src/gui/qgsprojectionselector.h
@@ -37,6 +37,7 @@ QgsProjectionSelector::QgsProjectionSelector( QWidget* parent, const char *name,
: QWidget( parent, fl )
, mProjListDone( false )
, mUserProjListDone( false )
, mRecentProjListDone( false )
, mCRSNameSelectionPending( false )
, mCRSIDSelectionPending( false )
, mAuthIDSelectionPending( false )
@@ -168,10 +169,12 @@ void QgsProjectionSelector::showEvent( QShowEvent * theEvent )
applySelection();
}

lstRecent->clear();

for ( int i = mRecentProjections.size() - 1; i >= 0; i-- )
insertRecent( mRecentProjections.at( i ).toLong() );
if ( !mRecentProjListDone )
{
for ( int i = mRecentProjections.size() - 1; i >= 0; i-- )
insertRecent( mRecentProjections.at( i ).toLong() );
mRecentProjListDone = true;
}

// Pass up the inheritance hierarchy
QWidget::showEvent( theEvent );
@@ -859,7 +862,8 @@ void QgsProjectionSelector::on_cbxHideDeprecated_stateChanged()
void QgsProjectionSelector::on_lstRecent_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous )
{
Q_UNUSED( previous );
setSelectedCrsId( current->text( QGIS_CRS_ID_COLUMN ).toLong() );
if ( current )
setSelectedCrsId( current->text( QGIS_CRS_ID_COLUMN ).toLong() );
}

void QgsProjectionSelector::on_pbnFind_clicked()
@@ -187,6 +187,9 @@ class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProjectio
//! Has the User Projection List been populated?
bool mUserProjListDone;

//! Has the Recent Projection List been populated?
bool mRecentProjListDone;

//! Is there a pending selection to be made by CRS Name?
bool mCRSNameSelectionPending;

0 comments on commit 98d5a76

Please sign in to comment.
You can’t perform that action at this time.