Skip to content

Commit

Permalink
avoid startup warning, do not look for empty setting value
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jan 26, 2018
1 parent bd6a1fa commit fd53880
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/qgscustomization.cpp
Expand Up @@ -666,7 +666,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )

Q_FOREACH ( QObject *obj, menubar->children() )
{
if ( obj->inherits( "QMenu" ) )
if ( obj->inherits( "QMenu" ) && !obj->objectName().isEmpty() )
{
QMenu *menu = qobject_cast<QMenu *>( obj );
bool visible = mSettings->value( menu->objectName(), true ).toBool();
Expand All @@ -688,7 +688,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
mSettings->beginGroup( QStringLiteral( "Customization/Toolbars" ) );
Q_FOREACH ( QObject *obj, mw->children() )
{
if ( obj->inherits( "QToolBar" ) )
if ( obj->inherits( "QToolBar" ) && !obj->objectName().isEmpty() )
{
QToolBar *tb = qobject_cast<QToolBar *>( obj );
bool visible = mSettings->value( tb->objectName(), true ).toBool();
Expand Down Expand Up @@ -724,7 +724,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
mSettings->beginGroup( QStringLiteral( "Customization/Docks" ) );
Q_FOREACH ( QObject *obj, mw->children() )
{
if ( obj->inherits( "QDockWidget" ) )
if ( obj->inherits( "QDockWidget" ) && !obj->objectName().isEmpty() )
{
bool visible = mSettings->value( obj->objectName(), true ).toBool();
if ( !visible )
Expand All @@ -745,7 +745,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
QgsStatusBar *sb = mw->statusBarIface();
Q_FOREACH ( QObject *obj, sb->children() )
{
if ( obj->inherits( "QWidget" ) )
if ( obj->inherits( "QWidget" ) && !obj->objectName().isEmpty() )
{
QWidget *widget = qobject_cast<QWidget *>( obj );
if ( widget->objectName().isEmpty() )
Expand Down

0 comments on commit fd53880

Please sign in to comment.