Skip to content
Permalink
Browse files

Merge pull request #9323 from m-kuhn/messagebar-cleanup

Some cleanup in QgsMessageBar
  • Loading branch information
m-kuhn committed Mar 1, 2019
2 parents 819f275 + 6c6833d commit 92b735673467ab9f4905f322c781aa764750d5ee
Showing with 6 additions and 10 deletions.
  1. +6 −10 src/gui/qgsmessagebar.cpp
@@ -133,15 +133,11 @@ void QgsMessageBar::popItem( QgsMessageBarItem *item )

if ( item == mCurrentItem )
{
if ( mCurrentItem )
{
QWidget *widget = mCurrentItem;
mLayout->removeWidget( widget );
mCurrentItem->hide();
disconnect( mCurrentItem, &QgsMessageBarItem::styleChanged, this, &QWidget::setStyleSheet );
mCurrentItem->deleteLater();
mCurrentItem = nullptr;
}
mLayout->removeWidget( mCurrentItem );
mCurrentItem->hide();
disconnect( mCurrentItem, &QgsMessageBarItem::styleChanged, this, &QWidget::setStyleSheet );
mCurrentItem->deleteLater();
mCurrentItem = nullptr;

if ( !mItems.isEmpty() )
{
@@ -171,7 +167,7 @@ bool QgsMessageBar::popWidget( QgsMessageBarItem *item )
return true;
}

Q_FOREACH ( QgsMessageBarItem *existingItem, mItems )
for ( QgsMessageBarItem *existingItem : qgis::as_const( mItems ) )
{
if ( existingItem == item )
{

0 comments on commit 92b7356

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