1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-25 02:09:48 +01:00

Revert "Add icon() method to ViewPage api and use that and title() for sidebar items"

We can't lazy load the page when we need its members to show the sidebar
entry...

This reverts commit 1821b24391c33b2ea14fc0d094142395588075d9.
This commit is contained in:
Dominik Schmidt 2013-06-16 23:22:33 +02:00
parent 6c7bd96f30
commit 91a57c5305
4 changed files with 11 additions and 18 deletions

View File

@ -28,11 +28,6 @@ ViewPage::~ViewPage()
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
}
QIcon ViewPage::icon() const
{
return QIcon();
}
bool
ViewPage::setFilter( const QString& filter )

View File

@ -49,7 +49,6 @@ public:
virtual QWidget* widget() = 0;
virtual Tomahawk::playlistinterface_ptr playlistInterface() const = 0;
virtual QIcon icon() const;
virtual QString title() const = 0;
virtual DescriptionType descriptionType() { return TextType; }

View File

@ -348,17 +348,13 @@ SourcesModel::appendGroups()
}
void
SourcesModel::appendPageItem( const QString& pageName )
SourcesModel::appendPageItem( const QIcon& pageIcon, const QString& pageTitle, const QString& pageName )
{
QModelIndex parentIndex = indexFromItem( m_browse );
beginInsertRows( parentIndex, rowCount( parentIndex ), rowCount( parentIndex ) );
GenericPageItem* pageItem = new GenericPageItem( this,
m_browse,
ViewManager::instance()->dynamicPageWidget( pageName )->title(),
ViewManager::instance()->dynamicPageWidget( pageName )->icon(),
boost::bind( &ViewManager::showDynamicPage, ViewManager::instance(), pageName ),
boost::bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), pageName ) );
GenericPageItem* pageItem = new GenericPageItem( this, m_browse, pageTitle, pageIcon,
boost::bind( &ViewManager::showDynamicPage, ViewManager::instance(), pageName ),
boost::bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), pageName ) );
pageItem->setSortValue( rowCount( parentIndex ) );
endInsertRows();
@ -677,9 +673,9 @@ SourcesModel::onWidgetDestroyed( QWidget* w )
void
SourcesModel::onViewPageAdded( const QString& pageName )
SourcesModel::onViewPageAdded( const QString& name )
{
appendPageItem( pageName );
appendPageItem( ImageRegistry::instance()->icon( RESPATH "images/new-releases.svg" ), name, name);
}

View File

@ -103,7 +103,10 @@ public:
void appendGroups();
void appendPageItem( const QString& pageName );
/*
* pageIcon and pageTitle are visible in the source tree, pageName is the internal name in the ViewManager
*/
void appendPageItem( const QIcon& pageIcon, const QString& pageTitle, const QString& pageName );
void appendItem( const Tomahawk::source_ptr& source );
bool removeItem( const Tomahawk::source_ptr& source );
@ -148,7 +151,7 @@ private slots:
void onWidgetDestroyed( QWidget* w );
void onViewPageAdded( const QString& pageName );
void onViewPageAdded( const QString& name );
private:
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;