Skip to content
Permalink
Browse files

fix crash in GPS Importer plugin

  • Loading branch information
slarosa authored and timlinux committed Sep 4, 2013
1 parent 0e976f4 commit 914cf887840881b387a24e067e7b5e851670ce88
Showing with 22 additions and 18 deletions.
  1. +22 −18 src/plugins/gps_importer/qgsgpsplugin.cpp
@@ -211,6 +211,7 @@ void QgsGPSPlugin::unload()
mQGisInterface->removePluginVectorMenu( tr( "&GPS" ), mQActionPointer );
mQGisInterface->removeVectorToolBarIcon( mQActionPointer );
delete mQActionPointer;
mQActionPointer = 0;
}

void QgsGPSPlugin::loadGPXFile( QString fileName, bool loadWaypoints, bool loadRoutes,
@@ -665,25 +666,28 @@ void QgsGPSPlugin::setCurrentTheme( QString theThemeName )
QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/gps_importer/";
QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/gps_importer/";
QString myQrcPath = ":/";
if ( QFile::exists( myCurThemePath ) )
if ( mQActionPointer )
{
mQActionPointer->setIcon( QIcon( myCurThemePath + "import_gpx.png" ) );
mCreateGPXAction->setIcon( QIcon( myCurThemePath + "create_gpx.png" ) );
}
else if ( QFile::exists( myDefThemePath ) )
{
mQActionPointer->setIcon( QIcon( myDefThemePath + "import_gpx.png" ) );
mCreateGPXAction->setIcon( QIcon( myDefThemePath + "create_gpx.png" ) );
}
else if ( QFile::exists( myQrcPath ) )
{
mQActionPointer->setIcon( QIcon( myQrcPath + "import_gpx.png" ) );
mCreateGPXAction->setIcon( QIcon( myQrcPath + "create_gpx.png" ) );
}
else
{
mQActionPointer->setIcon( QIcon() );
mCreateGPXAction->setIcon( QIcon() );
if ( QFile::exists( myCurThemePath ) )
{
mQActionPointer->setIcon( QIcon( myCurThemePath + "import_gpx.png" ) );
mCreateGPXAction->setIcon( QIcon( myCurThemePath + "create_gpx.png" ) );
}
else if ( QFile::exists( myDefThemePath ) )
{
mQActionPointer->setIcon( QIcon( myDefThemePath + "import_gpx.png" ) );
mCreateGPXAction->setIcon( QIcon( myDefThemePath + "create_gpx.png" ) );
}
else if ( QFile::exists( myQrcPath ) )
{
mQActionPointer->setIcon( QIcon( myQrcPath + "import_gpx.png" ) );
mCreateGPXAction->setIcon( QIcon( myQrcPath + "create_gpx.png" ) );
}
else
{
mQActionPointer->setIcon( QIcon() );
mCreateGPXAction->setIcon( QIcon() );
}
}
}

0 comments on commit 914cf88

Please sign in to comment.
You can’t perform that action at this time.