@@ -211,6 +211,7 @@ void QgsGPSPlugin::unload()
211
211
mQGisInterface ->removePluginVectorMenu ( tr ( " &GPS" ), mQActionPointer );
212
212
mQGisInterface ->removeVectorToolBarIcon ( mQActionPointer );
213
213
delete mQActionPointer ;
214
+ mQActionPointer = 0 ;
214
215
}
215
216
216
217
void QgsGPSPlugin::loadGPXFile ( QString fileName, bool loadWaypoints, bool loadRoutes,
@@ -665,25 +666,28 @@ void QgsGPSPlugin::setCurrentTheme( QString theThemeName )
665
666
QString myCurThemePath = QgsApplication::activeThemePath () + " /plugins/gps_importer/" ;
666
667
QString myDefThemePath = QgsApplication::defaultThemePath () + " /plugins/gps_importer/" ;
667
668
QString myQrcPath = " :/" ;
668
- if ( QFile::exists ( myCurThemePath ) )
669
+ if ( mQActionPointer )
669
670
{
670
- mQActionPointer ->setIcon ( QIcon ( myCurThemePath + " import_gpx.png" ) );
671
- mCreateGPXAction ->setIcon ( QIcon ( myCurThemePath + " create_gpx.png" ) );
672
- }
673
- else if ( QFile::exists ( myDefThemePath ) )
674
- {
675
- mQActionPointer ->setIcon ( QIcon ( myDefThemePath + " import_gpx.png" ) );
676
- mCreateGPXAction ->setIcon ( QIcon ( myDefThemePath + " create_gpx.png" ) );
677
- }
678
- else if ( QFile::exists ( myQrcPath ) )
679
- {
680
- mQActionPointer ->setIcon ( QIcon ( myQrcPath + " import_gpx.png" ) );
681
- mCreateGPXAction ->setIcon ( QIcon ( myQrcPath + " create_gpx.png" ) );
682
- }
683
- else
684
- {
685
- mQActionPointer ->setIcon ( QIcon () );
686
- mCreateGPXAction ->setIcon ( QIcon () );
671
+ if ( QFile::exists ( myCurThemePath ) )
672
+ {
673
+ mQActionPointer ->setIcon ( QIcon ( myCurThemePath + " import_gpx.png" ) );
674
+ mCreateGPXAction ->setIcon ( QIcon ( myCurThemePath + " create_gpx.png" ) );
675
+ }
676
+ else if ( QFile::exists ( myDefThemePath ) )
677
+ {
678
+ mQActionPointer ->setIcon ( QIcon ( myDefThemePath + " import_gpx.png" ) );
679
+ mCreateGPXAction ->setIcon ( QIcon ( myDefThemePath + " create_gpx.png" ) );
680
+ }
681
+ else if ( QFile::exists ( myQrcPath ) )
682
+ {
683
+ mQActionPointer ->setIcon ( QIcon ( myQrcPath + " import_gpx.png" ) );
684
+ mCreateGPXAction ->setIcon ( QIcon ( myQrcPath + " create_gpx.png" ) );
685
+ }
686
+ else
687
+ {
688
+ mQActionPointer ->setIcon ( QIcon () );
689
+ mCreateGPXAction ->setIcon ( QIcon () );
690
+ }
687
691
}
688
692
}
689
693
0 commit comments