Skip to content

Commit

Permalink
fix crash in SPIT 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 86ea4f3 commit 0e976f4
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/plugins/spit/qgsspitplugin.cpp
Expand Up @@ -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
Expand All @@ -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() );
}
}
}

Expand Down

0 comments on commit 0e976f4

Please sign in to comment.