Skip to content

Commit fd53880

Browse files
committed
avoid startup warning, do not look for empty setting value
1 parent bd6a1fa commit fd53880

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/qgscustomization.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
666666

667667
Q_FOREACH ( QObject *obj, menubar->children() )
668668
{
669-
if ( obj->inherits( "QMenu" ) )
669+
if ( obj->inherits( "QMenu" ) && !obj->objectName().isEmpty() )
670670
{
671671
QMenu *menu = qobject_cast<QMenu *>( obj );
672672
bool visible = mSettings->value( menu->objectName(), true ).toBool();
@@ -688,7 +688,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
688688
mSettings->beginGroup( QStringLiteral( "Customization/Toolbars" ) );
689689
Q_FOREACH ( QObject *obj, mw->children() )
690690
{
691-
if ( obj->inherits( "QToolBar" ) )
691+
if ( obj->inherits( "QToolBar" ) && !obj->objectName().isEmpty() )
692692
{
693693
QToolBar *tb = qobject_cast<QToolBar *>( obj );
694694
bool visible = mSettings->value( tb->objectName(), true ).toBool();
@@ -724,7 +724,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
724724
mSettings->beginGroup( QStringLiteral( "Customization/Docks" ) );
725725
Q_FOREACH ( QObject *obj, mw->children() )
726726
{
727-
if ( obj->inherits( "QDockWidget" ) )
727+
if ( obj->inherits( "QDockWidget" ) && !obj->objectName().isEmpty() )
728728
{
729729
bool visible = mSettings->value( obj->objectName(), true ).toBool();
730730
if ( !visible )
@@ -745,7 +745,7 @@ void QgsCustomization::updateMainWindow( QMenu *toolBarMenu )
745745
QgsStatusBar *sb = mw->statusBarIface();
746746
Q_FOREACH ( QObject *obj, sb->children() )
747747
{
748-
if ( obj->inherits( "QWidget" ) )
748+
if ( obj->inherits( "QWidget" ) && !obj->objectName().isEmpty() )
749749
{
750750
QWidget *widget = qobject_cast<QWidget *>( obj );
751751
if ( widget->objectName().isEmpty() )

0 commit comments

Comments
 (0)