Skip to content

Commit

Permalink
[composer] Fix qt disconnect warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 5, 2014
1 parent 5adbaf7 commit d8c9592
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/core/composer/qgscomposerscalebar.cpp
Expand Up @@ -136,8 +136,11 @@ void QgsComposerScaleBar::setBoxContentSpace( double space )

void QgsComposerScaleBar::setComposerMap( const QgsComposerMap* map )
{
disconnect( mComposerMap, SIGNAL( extentChanged() ), this, SLOT( updateSegmentSize() ) );
disconnect( mComposerMap, SIGNAL( destroyed( QObject* ) ), this, SLOT( invalidateCurrentMap() ) );
if ( mComposerMap )
{
disconnect( mComposerMap, SIGNAL( extentChanged() ), this, SLOT( updateSegmentSize() ) );
disconnect( mComposerMap, SIGNAL( destroyed( QObject* ) ), this, SLOT( invalidateCurrentMap() ) );
}
mComposerMap = map;

if ( !map )
Expand All @@ -154,6 +157,11 @@ void QgsComposerScaleBar::setComposerMap( const QgsComposerMap* map )

void QgsComposerScaleBar::invalidateCurrentMap()
{
if ( !mComposerMap )
{
return;
}

disconnect( mComposerMap, SIGNAL( extentChanged() ), this, SLOT( updateSegmentSize() ) );
disconnect( mComposerMap, SIGNAL( destroyed( QObject* ) ), this, SLOT( invalidateCurrentMap() ) );
mComposerMap = 0;
Expand Down

0 comments on commit d8c9592

Please sign in to comment.