Skip to content

Commit

Permalink
fix crash in Dxf2Shp plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa authored and timlinux committed Sep 6, 2013
1 parent 4357f28 commit 75fa352
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/plugins/dxf2shp_converter/dxf2shpconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void dxf2shpConverter::unload()
mQGisIface->removePluginVectorMenu( tr( "&Dxf2Shp" ), mQActionPointer );
mQGisIface->removeVectorToolBarIcon( mQActionPointer );
delete mQActionPointer;
mQActionPointer = 0;
}

void dxf2shpConverter::addMyLayer( QString myfname, QString mytitle )
Expand All @@ -129,21 +130,24 @@ void dxf2shpConverter::setCurrentTheme( QString theThemeName )
QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/dxf2shp_converter.png";
QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/dxf2shp_converter.png";
QString myQrcPath = ":/dxf2shp_converter.png";
if ( QFile::exists( myCurThemePath ) )
if ( mQActionPointer )
{
mQActionPointer->setIcon( QIcon( myCurThemePath ) );
}
else if ( QFile::exists( myDefThemePath ) )
{
mQActionPointer->setIcon( QIcon( myDefThemePath ) );
}
else if ( QFile::exists( myQrcPath ) )
{
mQActionPointer->setIcon( QIcon( myQrcPath ) );
}
else
{
mQActionPointer->setIcon( QIcon() );
if ( QFile::exists( myCurThemePath ) )
{
mQActionPointer->setIcon( QIcon( myCurThemePath ) );
}
else if ( QFile::exists( myDefThemePath ) )
{
mQActionPointer->setIcon( QIcon( myDefThemePath ) );
}
else if ( QFile::exists( myQrcPath ) )
{
mQActionPointer->setIcon( QIcon( myQrcPath ) );
}
else
{
mQActionPointer->setIcon( QIcon() );
}
}
}

Expand Down

0 comments on commit 75fa352

Please sign in to comment.