Skip to content

Commit

Permalink
Generic icon for raster layers in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Oct 19, 2011
1 parent c3f6dff commit 5b89a32
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/core/qgsdataitem.cpp
Expand Up @@ -76,6 +76,16 @@ const QIcon &QgsLayerItem::iconTable()
return icon;
}

const QIcon &QgsLayerItem::iconRaster()
{
static QIcon icon;

if ( icon.isNull() )
icon = QIcon( getThemePixmap( "/mIconRaster.png" ) );

return icon;
}

const QIcon &QgsLayerItem::iconDefault()
{
static QIcon icon;
Expand Down Expand Up @@ -277,6 +287,7 @@ QgsLayerItem::QgsLayerItem( QgsDataItem* parent, QString name, QString path, QSt
case Line: mIcon = iconLine(); break;
case Polygon: mIcon = iconPolygon(); break;
case TableLayer: mIcon = iconTable(); break;
case Raster: mIcon = iconRaster(); break;
default: mIcon = iconDefault(); break;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsdataitem.h
Expand Up @@ -184,6 +184,7 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
static const QIcon &iconLine();
static const QIcon &iconPolygon();
static const QIcon &iconTable();
static const QIcon &iconRaster();
static const QIcon &iconDefault();
};

Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsdataitems.cpp
Expand Up @@ -124,7 +124,7 @@ QgsWMSLayerItem::QgsWMSLayerItem( QgsDataItem* parent, QString name, QString pat

if ( mChildren.size() == 0 )
{
mIcon = QIcon( getThemePixmap( "mIconRaster.png" ) );
mIcon = iconRaster();
}
mPopulated = true;
}
Expand Down

0 comments on commit 5b89a32

Please sign in to comment.