Skip to content
Permalink
Browse files

check for existence of icon file in plugin manager

  • Loading branch information
etiennesky committed Nov 5, 2012
1 parent 61585e2 commit a4e4999e573d3eafeba6b06719a139b8f6e6959e
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/app/qgspluginmanager.cpp
@@ -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
{
@@ -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

0 comments on commit a4e4999

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