Skip to content
Permalink
Browse files

avoid startup warning, do not look for empty setting value

  • Loading branch information
nirvn committed Jan 26, 2018
1 parent bd6a1fa commit fd5388074b77184f131e63a6dbe612a47d8248b3
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/app/qgscustomization.cpp
@@ -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();
@@ -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();
@@ -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 )
@@ -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() )

0 comments on commit fd53880

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