Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
check for existence of icon file in plugin manager
  • Loading branch information
etiennesky committed Nov 5, 2012
1 parent 61585e2 commit a4e4999
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/qgspluginmanager.cpp
Expand Up @@ -210,7 +210,8 @@ void QgsPluginManager::getPythonPluginDescriptions()
myData.setCheckable( true );
myData.setRenderAsWidget( false );
myData.setChecked( false ); //start off assuming false
if ( iconName == "__error__" )

if ( iconName == "__error__" or iconName.isEmpty() )
myData.setIcon( QPixmap( QgsApplication::defaultThemePath() + "/plugin.png" ) );
else
{
Expand All @@ -221,7 +222,14 @@ void QgsPluginManager::getPythonPluginDescriptions()
mPythonUtils->evalString( QString( "qgis.utils.pluginDirectory('%1')" ).arg( packageName ), pluginDir );
iconName = pluginDir + "/" + iconName;
}
myData.setIcon( QPixmap( iconName ) );
if ( QFileInfo( iconName ).isFile() )
{
myData.setIcon( QPixmap( iconName ) );
}
else
{
myData.setIcon( QPixmap( QgsApplication::defaultThemePath() + "/plugin.png" ) );
}
}

// check to see if the plugin is loaded and set the checkbox accordingly
Expand Down

0 comments on commit a4e4999

Please sign in to comment.