1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 05:37:29 +02:00

Cache icon and text for Inbox item.

This commit is contained in:
Teo Mrnjavac
2013-04-23 10:08:26 +02:00
parent 024a1f74b3
commit f7ad8cb799
2 changed files with 8 additions and 3 deletions

View File

@@ -31,7 +31,10 @@
InboxItem::InboxItem( SourcesModel* model, SourceTreeItem* parent ) InboxItem::InboxItem( SourcesModel* model, SourceTreeItem* parent )
: SourceTreeItem( model, parent, SourcesModel::Inbox ) : SourceTreeItem( model, parent, SourcesModel::Inbox )
, m_sortValue( -150 ) , m_sortValue( -150 )
{} {
m_text = tr( "Inbox" );
m_icon = ImageRegistry::instance()->icon( RESPATH "images/inbox.svg" );
}
InboxItem::~InboxItem() InboxItem::~InboxItem()
@@ -41,14 +44,14 @@ InboxItem::~InboxItem()
QString QString
InboxItem::text() const InboxItem::text() const
{ {
return tr( "Inbox" ); return m_text;
} }
QIcon QIcon
InboxItem::icon() const InboxItem::icon() const
{ {
return ImageRegistry::instance()->icon( RESPATH "images/inbox.svg" ); return m_icon;
} }

View File

@@ -41,6 +41,8 @@ public slots:
private: private:
int m_sortValue; int m_sortValue;
QIcon m_icon;
QString m_text;
}; };
#endif // INBOXITEM_H #endif // INBOXITEM_H