Skip to content
Permalink
Browse files

Fix #7835, opening WMS layer properties causes crash

  • Loading branch information
dakcarto committed May 17, 2013
1 parent ec6a64f commit ce49b66673c66c5c4aab84a62e7b471e85fedf71
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/gui/qgsoptionsdialogbase.cpp
@@ -96,9 +96,9 @@ void QgsOptionsDialogBase::restoreOptionsBaseUi()
mOptSplitter->restoreState( settings.value( QString( "/Windows/%1/splitState" ).arg( mOptsKey ) ).toByteArray() );
int curIndx = settings.value( QString( "/Windows/%1/tab" ).arg( mOptsKey ), 0 ).toInt();

// if the last used tab is not enabled, or is missing, display the first enabled one
if ( !mOptStackedWidget->widget( curIndx )->isEnabled()
|| mOptStackedWidget->count() < ( curIndx + 1 ) )
// if the last used tab is out of range or not enabled display the first enabled one
if ( mOptStackedWidget->count() < ( curIndx + 1 )
|| !mOptStackedWidget->widget( curIndx )->isEnabled() )
{
curIndx = 0;
for ( int i = 0; i < mOptStackedWidget->count(); i++ )
@@ -109,11 +109,13 @@ void QgsOptionsDialogBase::restoreOptionsBaseUi()
break;
}
}
curIndx = -1; // default fallback
}

mOptStackedWidget->setCurrentIndex( curIndx );
mOptListWidget->setCurrentRow( curIndx );
if ( mOptStackedWidget->count() != 0 && mOptListWidget->count() != 0 )
{
mOptStackedWidget->setCurrentIndex( curIndx );
mOptListWidget->setCurrentRow( curIndx );
}

// get rid of annoying outer focus rect on Mac
mOptListWidget->setAttribute( Qt::WA_MacShowFocusRect, false );

0 comments on commit ce49b66

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