mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
Use TR1 in GenericPageItem
Conflicts: src/tomahawk/sourcetree/SourcesModel.cpp
This commit is contained in:
@@ -331,8 +331,8 @@ SourcesModel::appendPageItem( const QString& name, ViewPage* page, int sortValue
|
|||||||
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, m_browse, page->title(), page->pixmap(),
|
GenericPageItem* pageItem = new GenericPageItem( this, m_browse, page->title(), page->pixmap(),
|
||||||
boost::bind( &ViewManager::showDynamicPage, ViewManager::instance(), name ),
|
bind( &ViewManager::showDynamicPage, ViewManager::instance(), name ),
|
||||||
boost::bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), name ) );
|
bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), name ) );
|
||||||
pageItem->setDeletable( page->isDeletable() );
|
pageItem->setDeletable( page->isDeletable() );
|
||||||
|
|
||||||
if ( sortValue )
|
if ( sortValue )
|
||||||
|
@@ -27,7 +27,7 @@ using namespace Tomahawk;
|
|||||||
|
|
||||||
|
|
||||||
/// Generic page item
|
/// Generic page item
|
||||||
GenericPageItem::GenericPageItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, const QIcon& icon, boost::function< ViewPage* () > show, boost::function< ViewPage* () > get )
|
GenericPageItem::GenericPageItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, const QIcon& icon, function< ViewPage* () > show, function< ViewPage* () > get )
|
||||||
: SourceTreeItem( model, parent, SourcesModel::GenericPage )
|
: SourceTreeItem( model, parent, SourcesModel::GenericPage )
|
||||||
, m_icon( icon )
|
, m_icon( icon )
|
||||||
, m_text( text )
|
, m_text( text )
|
||||||
|
@@ -20,9 +20,7 @@
|
|||||||
#define GENERIC_PAGE_ITEM_H
|
#define GENERIC_PAGE_ITEM_H
|
||||||
|
|
||||||
#include "SourceTreeItem.h"
|
#include "SourceTreeItem.h"
|
||||||
|
#include "utils/tr1-functional.h"
|
||||||
#include "boost/function.hpp"
|
|
||||||
#include "boost/bind.hpp"
|
|
||||||
|
|
||||||
// generic item that has some name, some text, and calls a certain slot when activated. badabing!
|
// generic item that has some name, some text, and calls a certain slot when activated. badabing!
|
||||||
class GenericPageItem : public SourceTreeItem
|
class GenericPageItem : public SourceTreeItem
|
||||||
@@ -30,7 +28,7 @@ class GenericPageItem : public SourceTreeItem
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
// takes 2 function pointers: show: called when wanting to show the desired view page. get: called to get the view page from ViewManager if it exists
|
// takes 2 function pointers: show: called when wanting to show the desired view page. get: called to get the view page from ViewManager if it exists
|
||||||
GenericPageItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, const QIcon& icon, boost::function<Tomahawk::ViewPage*()> show, boost::function<Tomahawk::ViewPage*()> get );
|
GenericPageItem( SourcesModel* model, SourceTreeItem* parent, const QString& text, const QIcon& icon, function<Tomahawk::ViewPage*()> show, function<Tomahawk::ViewPage*()> get );
|
||||||
virtual ~GenericPageItem();
|
virtual ~GenericPageItem();
|
||||||
|
|
||||||
virtual QString text() const;
|
virtual QString text() const;
|
||||||
@@ -55,8 +53,8 @@ private:
|
|||||||
QIcon m_icon;
|
QIcon m_icon;
|
||||||
QString m_text;
|
QString m_text;
|
||||||
int m_sortValue;
|
int m_sortValue;
|
||||||
boost::function< Tomahawk::ViewPage*() > m_show;
|
function< Tomahawk::ViewPage*() > m_show;
|
||||||
boost::function< Tomahawk::ViewPage*() > m_get;
|
function< Tomahawk::ViewPage*() > m_get;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -22,9 +22,6 @@
|
|||||||
|
|
||||||
#include "SourceTreeItem.h"
|
#include "SourceTreeItem.h"
|
||||||
|
|
||||||
#include "boost/function.hpp"
|
|
||||||
#include "boost/bind.hpp"
|
|
||||||
|
|
||||||
class GroupItem : public SourceTreeItem
|
class GroupItem : public SourceTreeItem
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@@ -74,16 +74,16 @@ SourceItem::SourceItem( SourcesModel* mdl, SourceTreeItem* parent, const Tomahaw
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* m_sourceInfoItem = new GenericPageItem( model(), this, tr( "New Additions" ), QIcon( RESPATH "images/new-additions.png" ),
|
/* m_sourceInfoItem = new GenericPageItem( model(), this, tr( "New Additions" ), QIcon( RESPATH "images/new-additions.png" ),
|
||||||
boost::bind( &SourceItem::sourceInfoClicked, this ),
|
bind( &SourceItem::sourceInfoClicked, this ),
|
||||||
boost::bind( &SourceItem::getSourceInfoPage, this ) );*/
|
bind( &SourceItem::getSourceInfoPage, this ) );*/
|
||||||
|
|
||||||
m_latestAdditionsItem = new GenericPageItem( model(), this, tr( "Latest Additions" ), ImageRegistry::instance()->icon( RESPATH "images/new-additions.svg" ),
|
m_latestAdditionsItem = new GenericPageItem( model(), this, tr( "Latest Additions" ), ImageRegistry::instance()->icon( RESPATH "images/new-additions.svg" ),
|
||||||
boost::bind( &SourceItem::latestAdditionsClicked, this ),
|
bind( &SourceItem::latestAdditionsClicked, this ),
|
||||||
boost::bind( &SourceItem::getLatestAdditionsPage, this ) );
|
bind( &SourceItem::getLatestAdditionsPage, this ) );
|
||||||
|
|
||||||
m_recentPlaysItem = new GenericPageItem( model(), this, tr( "History" ), ImageRegistry::instance()->icon( RESPATH "images/recently-played.svg" ),
|
m_recentPlaysItem = new GenericPageItem( model(), this, tr( "History" ), ImageRegistry::instance()->icon( RESPATH "images/recently-played.svg" ),
|
||||||
boost::bind( &SourceItem::recentPlaysClicked, this ),
|
bind( &SourceItem::recentPlaysClicked, this ),
|
||||||
boost::bind( &SourceItem::getRecentPlaysPage, this ) );
|
bind( &SourceItem::getRecentPlaysPage, this ) );
|
||||||
|
|
||||||
new LovedTracksItem( model(), this );
|
new LovedTracksItem( model(), this );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user