@@ -114,7 +114,6 @@ void CoordinateCapture::initGui()
114
114
connect ( mpMapTool, SIGNAL ( mouseMoved ( QgsPoint ) ), this , SLOT ( mouseMoved ( QgsPoint ) ) );
115
115
connect ( mpMapTool, SIGNAL ( mouseClicked ( QgsPoint ) ), this , SLOT ( mouseClicked ( QgsPoint ) ) );
116
116
117
-
118
117
// create a little widget with x and y display to put into our dock widget
119
118
QWidget * mypWidget = new QWidget ();
120
119
QGridLayout *mypLayout = new QGridLayout ( mypWidget );
@@ -264,19 +263,26 @@ void CoordinateCapture::unload()
264
263
mQGisIface ->removeVectorToolBarIcon ( mQActionPointer );
265
264
mpMapTool->deactivate ();
266
265
delete mpMapTool;
266
+ mpMapTool = 0 ;
267
267
delete mpDockWidget;
268
+ mpDockWidget = 0 ;
268
269
delete mQActionPointer ;
270
+ mQActionPointer = 0 ;
269
271
}
270
272
271
273
// Set icons to the current theme
272
274
void CoordinateCapture::setCurrentTheme ( QString theThemeName )
273
275
{
274
276
Q_UNUSED ( theThemeName );
275
- mQActionPointer ->setIcon ( QIcon ( getIconPath ( " coordinate_capture.png" ) ) );
276
- mpTrackMouseButton->setIcon ( QIcon ( getIconPath ( " tracking.png" ) ) );
277
- mpCaptureButton->setIcon ( QIcon ( getIconPath ( " coordinate_capture.png" ) ) );
278
- mypUserCrsToolButton->setIcon ( QIcon ( getIconPath ( " geographic.png" ) ) );
279
- mypCRSLabel->setPixmap ( QPixmap ( getIconPath ( " transformed.png" ) ) );
277
+ if ( mQActionPointer )
278
+ mQActionPointer ->setIcon ( QIcon ( getIconPath ( " coordinate_capture.png" ) ) );
279
+ if ( mpDockWidget )
280
+ {
281
+ mpTrackMouseButton->setIcon ( QIcon ( getIconPath ( " tracking.png" ) ) );
282
+ mpCaptureButton->setIcon ( QIcon ( getIconPath ( " coordinate_capture.png" ) ) );
283
+ mypUserCrsToolButton->setIcon ( QIcon ( getIconPath ( " geographic.png" ) ) );
284
+ mypCRSLabel->setPixmap ( QPixmap ( getIconPath ( " transformed.png" ) ) );
285
+ }
280
286
}
281
287
282
288
// Get path to the best available icon file
0 commit comments