Skip to content
Permalink
Browse files
[composer] Fix qt disconnect warnings
  • Loading branch information
nyalldawson committed Feb 5, 2014
1 parent 5adbaf7 commit d8c9592687770e70ed634896fe8a2b9ca4a87f65
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/core/composer/qgscomposerscalebar.cpp
@@ -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 )
@@ -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;

0 comments on commit d8c9592

Please sign in to comment.