Skip to content

Commit

Permalink
message log: fix crash on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 25, 2012
1 parent b8bf86b commit d208b29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/qgsmessagelogviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ QgsMessageLogViewer::QgsMessageLogViewer( QStatusBar *statusBar, QWidget *parent
mButton->setCheckable( true );
mButton->hide();
connect( mButton, SIGNAL( toggled( bool ) ), this, SLOT( buttonToggled( bool ) ) );
connect( mButton, SIGNAL( destroyed() ), this, SLOT( buttonDestroyed() ) );
statusBar->addPermanentWidget( mButton, 0 );
}

Expand Down Expand Up @@ -100,6 +101,11 @@ void QgsMessageLogViewer::buttonToggled( bool checked )
w->hide();
}

void QgsMessageLogViewer::buttonDestroyed()
{
mButton = 0;
}

void QgsMessageLogViewer::logMessage( QString message, QString tag, int level )
{
mButton->setToolTip( tr( "%1 message(s) logged." ).arg( mCount++ ) );
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsmessagelogviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessageLogV
private slots:
void closeTab( int index );
void buttonToggled( bool checked );
void buttonDestroyed();
};

#endif

0 comments on commit d208b29

Please sign in to comment.