mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02: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:
@@ -28,11 +28,6 @@ ViewPage::~ViewPage()
|
|||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon ViewPage::icon() const
|
|
||||||
{
|
|
||||||
return QIcon();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ViewPage::setFilter( const QString& filter )
|
ViewPage::setFilter( const QString& filter )
|
||||||
|
@@ -49,7 +49,6 @@ public:
|
|||||||
virtual QWidget* widget() = 0;
|
virtual QWidget* widget() = 0;
|
||||||
virtual Tomahawk::playlistinterface_ptr playlistInterface() const = 0;
|
virtual Tomahawk::playlistinterface_ptr playlistInterface() const = 0;
|
||||||
|
|
||||||
virtual QIcon icon() const;
|
|
||||||
virtual QString title() const = 0;
|
virtual QString title() const = 0;
|
||||||
|
|
||||||
virtual DescriptionType descriptionType() { return TextType; }
|
virtual DescriptionType descriptionType() { return TextType; }
|
||||||
|
@@ -348,17 +348,13 @@ SourcesModel::appendGroups()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SourcesModel::appendPageItem( const QString& pageName )
|
SourcesModel::appendPageItem( const QIcon& pageIcon, const QString& pageTitle, const QString& pageName )
|
||||||
{
|
{
|
||||||
QModelIndex parentIndex = indexFromItem( m_browse );
|
QModelIndex parentIndex = indexFromItem( m_browse );
|
||||||
beginInsertRows( parentIndex, rowCount( parentIndex ), rowCount( parentIndex ) );
|
beginInsertRows( parentIndex, rowCount( parentIndex ), rowCount( parentIndex ) );
|
||||||
GenericPageItem* pageItem = new GenericPageItem( this,
|
GenericPageItem* pageItem = new GenericPageItem( this, m_browse, pageTitle, pageIcon,
|
||||||
m_browse,
|
boost::bind( &ViewManager::showDynamicPage, ViewManager::instance(), pageName ),
|
||||||
ViewManager::instance()->dynamicPageWidget( pageName )->title(),
|
boost::bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), pageName ) );
|
||||||
ViewManager::instance()->dynamicPageWidget( pageName )->icon(),
|
|
||||||
boost::bind( &ViewManager::showDynamicPage, ViewManager::instance(), pageName ),
|
|
||||||
boost::bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), pageName ) );
|
|
||||||
|
|
||||||
pageItem->setSortValue( rowCount( parentIndex ) );
|
pageItem->setSortValue( rowCount( parentIndex ) );
|
||||||
|
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
@@ -677,9 +673,9 @@ SourcesModel::onWidgetDestroyed( QWidget* w )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SourcesModel::onViewPageAdded( const QString& pageName )
|
SourcesModel::onViewPageAdded( const QString& name )
|
||||||
{
|
{
|
||||||
appendPageItem( pageName );
|
appendPageItem( ImageRegistry::instance()->icon( RESPATH "images/new-releases.svg" ), name, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -103,7 +103,10 @@ public:
|
|||||||
|
|
||||||
void appendGroups();
|
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 );
|
void appendItem( const Tomahawk::source_ptr& source );
|
||||||
bool removeItem( const Tomahawk::source_ptr& source );
|
bool removeItem( const Tomahawk::source_ptr& source );
|
||||||
@@ -148,7 +151,7 @@ private slots:
|
|||||||
|
|
||||||
void onWidgetDestroyed( QWidget* w );
|
void onWidgetDestroyed( QWidget* w );
|
||||||
|
|
||||||
void onViewPageAdded( const QString& pageName );
|
void onViewPageAdded( const QString& name );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;
|
SourceTreeItem* itemFromIndex( const QModelIndex& idx ) const;
|
||||||
|
Reference in New Issue
Block a user