Ajout gestion icones pixmap

This commit is contained in:
2015-08-31 12:24:55 +02:00
parent bd5d41aa88
commit 5cd3fafb5e
3 changed files with 46 additions and 15 deletions

View File

@ -36,8 +36,16 @@ module.exports = React.createClass({
_findIcon: function(iconPath) {
var self = this;
var DEFAULT_ICON = 'application-default-icon';
var theme = null;
Util.DesktopApps.findIcon(iconPath || 'application-default-icon')
Util.DesktopApps.findIcon(iconPath || DEFAULT_ICON, theme)
.then(function(iconPath) {
if( !iconPath || /\.xpm$/.test(iconPath) ) {
return Util.DesktopApps.findIcon(DEFAULT_ICON, theme);
}
return iconPath;
})
.then(function(iconPath) {
self.setState({ icon: iconPath });
})