Skip to content

Commit 7286c55

Browse files
author
marco
committedSep 18, 2011
Prevent Qt assert when using Qt debug compiled
1 parent 8905274 commit 7286c55

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎src/app/qgscustomization.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,10 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )
668668
// hide individual toolbar actions
669669
foreach( QAction* action, tb->actions() )
670670
{
671+
if ( action->objectName().isEmpty() )
672+
{
673+
continue;
674+
}
671675
visible = mSettings.value( action->objectName(), true ).toBool();
672676
if ( !visible )
673677
tb->removeAction( action );
@@ -708,6 +712,10 @@ void QgsCustomization::updateMainWindow( QMenu * theToolBarMenu )
708712
if ( obj->inherits( "QWidget" ) )
709713
{
710714
QWidget* widget = qobject_cast<QWidget*>( obj );
715+
if ( widget->objectName().isEmpty() )
716+
{
717+
continue;
718+
}
711719
bool visible = mSettings.value( widget->objectName(), true ).toBool();
712720
if ( !visible )
713721
{
@@ -732,6 +740,10 @@ void QgsCustomization::updateMenu( QMenu* menu, QSettings& settings )
732740
foreach( QAction* action, menu->actions() )
733741
{
734742
QString objName = ( action->menu() ? action->menu()->objectName() : action->objectName() );
743+
if ( objName.isEmpty() )
744+
{
745+
continue;
746+
}
735747
bool visible = settings.value( objName, true ).toBool();
736748
if ( !visible )
737749
menu->removeAction( action );

0 commit comments

Comments
 (0)
Please sign in to comment.