Skip to content

Commit

Permalink
fix crash in coordinate capture plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 4, 2013
1 parent e9ca0bb commit 7030b1a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/plugins/coordinate_capture/coordinatecapture.cpp
Expand Up @@ -114,7 +114,6 @@ void CoordinateCapture::initGui()
connect( mpMapTool, SIGNAL( mouseMoved( QgsPoint ) ), this, SLOT( mouseMoved( QgsPoint ) ) );
connect( mpMapTool, SIGNAL( mouseClicked( QgsPoint ) ), this, SLOT( mouseClicked( QgsPoint ) ) );


// create a little widget with x and y display to put into our dock widget
QWidget * mypWidget = new QWidget();
QGridLayout *mypLayout = new QGridLayout( mypWidget );
Expand Down Expand Up @@ -264,19 +263,26 @@ void CoordinateCapture::unload()
mQGisIface->removeVectorToolBarIcon( mQActionPointer );
mpMapTool->deactivate();
delete mpMapTool;
mpMapTool = 0;
delete mpDockWidget;
mpDockWidget = 0;
delete mQActionPointer;
mQActionPointer = 0;
}

// Set icons to the current theme
void CoordinateCapture::setCurrentTheme( QString theThemeName )
{
Q_UNUSED( theThemeName );
mQActionPointer->setIcon( QIcon( getIconPath( "coordinate_capture.png" ) ) );
mpTrackMouseButton->setIcon( QIcon( getIconPath( "tracking.png" ) ) );
mpCaptureButton->setIcon( QIcon( getIconPath( "coordinate_capture.png" ) ) );
mypUserCrsToolButton->setIcon( QIcon( getIconPath( "geographic.png" ) ) );
mypCRSLabel->setPixmap( QPixmap( getIconPath( "transformed.png" ) ) );
if ( mQActionPointer )
mQActionPointer->setIcon( QIcon( getIconPath( "coordinate_capture.png" ) ) );
if ( mpDockWidget )
{
mpTrackMouseButton->setIcon( QIcon( getIconPath( "tracking.png" ) ) );
mpCaptureButton->setIcon( QIcon( getIconPath( "coordinate_capture.png" ) ) );
mypUserCrsToolButton->setIcon( QIcon( getIconPath( "geographic.png" ) ) );
mypCRSLabel->setPixmap( QPixmap( getIconPath( "transformed.png" ) ) );
}
}

// Get path to the best available icon file
Expand Down

0 comments on commit 7030b1a

Please sign in to comment.