Skip to content
Permalink
Browse files

fix crash in SPIT plugin

  • Loading branch information
slarosa authored and timlinux committed Sep 4, 2013
1 parent 86ea4f3 commit 0e976f4266280ae779f3d17cce1357e603011736
Showing with 18 additions and 14 deletions.
  1. +18 −14 src/plugins/spit/qgsspitplugin.cpp
@@ -93,6 +93,7 @@ void QgsSpitPlugin::unload()
qI->removeDatabaseToolBarIcon( spitAction );
qI->removePluginDatabaseMenu( tr( "&Spit" ), spitAction );
delete spitAction;
spitAction = 0;
}

//! Set icons to the current theme
@@ -102,21 +103,24 @@ void QgsSpitPlugin::setCurrentTheme( QString theThemeName )
QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/spit.png";
QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/spit.png";
QString myQrcPath = ":/spit.png";
if ( QFile::exists( myCurThemePath ) )
if ( spitAction )
{
spitAction->setIcon( QIcon( myCurThemePath ) );
}
else if ( QFile::exists( myDefThemePath ) )
{
spitAction->setIcon( QIcon( myDefThemePath ) );
}
else if ( QFile::exists( myQrcPath ) )
{
spitAction->setIcon( QIcon( myQrcPath ) );
}
else
{
spitAction->setIcon( QIcon() );
if ( QFile::exists( myCurThemePath ) )
{
spitAction->setIcon( QIcon( myCurThemePath ) );
}
else if ( QFile::exists( myDefThemePath ) )
{
spitAction->setIcon( QIcon( myDefThemePath ) );
}
else if ( QFile::exists( myQrcPath ) )
{
spitAction->setIcon( QIcon( myQrcPath ) );
}
else
{
spitAction->setIcon( QIcon() );
}
}
}

0 comments on commit 0e976f4

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