Skip to content

Commit

Permalink
Add a default icon for data collections
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Oct 19, 2011
1 parent b1e5038 commit bfb4d0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/qgsdataitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ const QIcon &QgsLayerItem::iconDefault()
return icon;
}

const QIcon &QgsDataCollectionItem::iconDataCollection()
{
static QIcon icon;

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

return icon;
}

const QIcon &QgsDataCollectionItem::iconDir()
{
static QIcon icon;
Expand Down Expand Up @@ -315,6 +325,7 @@ bool QgsLayerItem::equal( const QgsDataItem *other )
QgsDataCollectionItem::QgsDataCollectionItem( QgsDataItem* parent, QString name, QString path )
: QgsDataItem( Collection, parent, name, path )
{
mIcon = iconDataCollection();
}

QgsDataCollectionItem::~QgsDataCollectionItem()
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsdataitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class CORE_EXPORT QgsDataCollectionItem : public QgsDataItem
void addChild( QgsDataItem *item ) { mChildren.append( item ); }

static const QIcon &iconDir(); // shared icon: open/closed directory
static const QIcon &iconDataCollection(); // default icon for data collection
};

/** A directory: contains subdirectories and layers */
Expand Down

0 comments on commit bfb4d0f

Please sign in to comment.