Skip to content

Commit 3986036

Browse files
committed
fix crash in GPS Importer plugin
1 parent 6b74227 commit 3986036

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

src/plugins/gps_importer/qgsgpsplugin.cpp

+22-18
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ void QgsGPSPlugin::unload()
211211
mQGisInterface->removePluginVectorMenu( tr( "&GPS" ), mQActionPointer );
212212
mQGisInterface->removeVectorToolBarIcon( mQActionPointer );
213213
delete mQActionPointer;
214+
mQActionPointer = 0;
214215
}
215216

216217
void QgsGPSPlugin::loadGPXFile( QString fileName, bool loadWaypoints, bool loadRoutes,
@@ -665,25 +666,28 @@ void QgsGPSPlugin::setCurrentTheme( QString theThemeName )
665666
QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/gps_importer/";
666667
QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/gps_importer/";
667668
QString myQrcPath = ":/";
668-
if ( QFile::exists( myCurThemePath ) )
669+
if ( mQActionPointer )
669670
{
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+
}
687691
}
688692
}
689693

0 commit comments

Comments
 (0)