Skip to content

Commit

Permalink
fix for crash in projection selection
Browse files Browse the repository at this point in the history
  • Loading branch information
brushtyler committed Nov 8, 2011
1 parent 641bd67 commit 98d5a76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/gui/qgsprojectionselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions src/gui/qgsprojectionselector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 98d5a76

Please sign in to comment.