mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-21 00:09:47 +01:00
Use TR1 in GenericPageItem
Conflicts: src/tomahawk/sourcetree/SourcesModel.cpp
This commit is contained in:
parent
b288b3eebf
commit
61a00a909c
@ -331,8 +331,8 @@ SourcesModel::appendPageItem( const QString& name, ViewPage* page, int sortValue
|
||||
QModelIndex parentIndex = indexFromItem( m_browse );
|
||||
beginInsertRows( parentIndex, rowCount( parentIndex ), rowCount( parentIndex ) );
|
||||
GenericPageItem* pageItem = new GenericPageItem( this, m_browse, page->title(), page->pixmap(),
|
||||
boost::bind( &ViewManager::showDynamicPage, ViewManager::instance(), name ),
|
||||
boost::bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), name ) );
|
||||
bind( &ViewManager::showDynamicPage, ViewManager::instance(), name ),
|
||||
bind( &ViewManager::dynamicPageWidget, ViewManager::instance(), name ) );
|
||||
pageItem->setDeletable( page->isDeletable() );
|
||||
|
||||
if ( sortValue )
|
||||
|
@ -27,7 +27,7 @@ using namespace Tomahawk;
|
||||
|
||||
|
||||
/// 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 )
|
||||
, m_icon( icon )
|
||||
, m_text( text )
|
||||
|
@ -20,9 +20,7 @@
|
||||
#define GENERIC_PAGE_ITEM_H
|
||||
|
||||
#include "SourceTreeItem.h"
|
||||
|
||||
#include "boost/function.hpp"
|
||||
#include "boost/bind.hpp"
|
||||
#include "utils/tr1-functional.h"
|
||||
|
||||
// generic item that has some name, some text, and calls a certain slot when activated. badabing!
|
||||
class GenericPageItem : public SourceTreeItem
|
||||
@ -30,7 +28,7 @@ class GenericPageItem : public SourceTreeItem
|
||||
Q_OBJECT
|
||||
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
|
||||
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 QString text() const;
|
||||
@ -55,8 +53,8 @@ private:
|
||||
QIcon m_icon;
|
||||
QString m_text;
|
||||
int m_sortValue;
|
||||
boost::function< Tomahawk::ViewPage*() > m_show;
|
||||
boost::function< Tomahawk::ViewPage*() > m_get;
|
||||
function< Tomahawk::ViewPage*() > m_show;
|
||||
function< Tomahawk::ViewPage*() > m_get;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -22,9 +22,6 @@
|
||||
|
||||
#include "SourceTreeItem.h"
|
||||
|
||||
#include "boost/function.hpp"
|
||||
#include "boost/bind.hpp"
|
||||
|
||||
class GroupItem : public SourceTreeItem
|
||||
{
|
||||
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" ),
|
||||
boost::bind( &SourceItem::sourceInfoClicked, this ),
|
||||
boost::bind( &SourceItem::getSourceInfoPage, this ) );*/
|
||||
bind( &SourceItem::sourceInfoClicked, this ),
|
||||
bind( &SourceItem::getSourceInfoPage, this ) );*/
|
||||
|
||||
m_latestAdditionsItem = new GenericPageItem( model(), this, tr( "Latest Additions" ), ImageRegistry::instance()->icon( RESPATH "images/new-additions.svg" ),
|
||||
boost::bind( &SourceItem::latestAdditionsClicked, this ),
|
||||
boost::bind( &SourceItem::getLatestAdditionsPage, this ) );
|
||||
bind( &SourceItem::latestAdditionsClicked, this ),
|
||||
bind( &SourceItem::getLatestAdditionsPage, this ) );
|
||||
|
||||
m_recentPlaysItem = new GenericPageItem( model(), this, tr( "History" ), ImageRegistry::instance()->icon( RESPATH "images/recently-played.svg" ),
|
||||
boost::bind( &SourceItem::recentPlaysClicked, this ),
|
||||
boost::bind( &SourceItem::getRecentPlaysPage, this ) );
|
||||
bind( &SourceItem::recentPlaysClicked, this ),
|
||||
bind( &SourceItem::getRecentPlaysPage, this ) );
|
||||
|
||||
new LovedTracksItem( model(), this );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user