mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 08:34:34 +02:00
* Added setFilter methods to proxy models.
This commit is contained in:
@@ -578,3 +578,14 @@ PlayableProxyModel::updateDetailedInfo( const QModelIndex& index )
|
|||||||
item->query()->loadSocialActions();
|
item->query()->loadSocialActions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
PlayableProxyModel::setFilter( const QString& pattern )
|
||||||
|
{
|
||||||
|
if ( pattern != filterRegExp().pattern() )
|
||||||
|
{
|
||||||
|
setFilterRegExp( pattern );
|
||||||
|
emit filterChanged( pattern );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -66,8 +66,6 @@ public:
|
|||||||
virtual int maxVisibleItems() const { return m_maxVisibleItems; }
|
virtual int maxVisibleItems() const { return m_maxVisibleItems; }
|
||||||
virtual void setMaxVisibleItems( int items );
|
virtual void setMaxVisibleItems( int items );
|
||||||
|
|
||||||
virtual void emitFilterChanged( const QString &pattern ) { emit filterChanged( pattern ); }
|
|
||||||
|
|
||||||
virtual PlayableItem* itemFromIndex( const QModelIndex& index ) const { return sourceModel()->itemFromIndex( index ); }
|
virtual PlayableItem* itemFromIndex( const QModelIndex& index ) const { return sourceModel()->itemFromIndex( index ); }
|
||||||
|
|
||||||
virtual Tomahawk::playlistinterface_ptr playlistInterface();
|
virtual Tomahawk::playlistinterface_ptr playlistInterface();
|
||||||
@@ -78,7 +76,8 @@ public:
|
|||||||
virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
|
virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
|
||||||
virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
|
virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
|
||||||
|
|
||||||
void updateDetailedInfo( const QModelIndex& index );
|
virtual void setFilter( const QString& pattern );
|
||||||
|
virtual void updateDetailedInfo( const QModelIndex& index );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void filterChanged( const QString& filter );
|
void filterChanged( const QString& filter );
|
||||||
|
@@ -92,7 +92,7 @@ TreeProxyModel::onModelReset()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TreeProxyModel::newFilterFromPlaylistInterface( const QString& pattern )
|
TreeProxyModel::setFilter( const QString& pattern )
|
||||||
{
|
{
|
||||||
emit filteringStarted();
|
emit filteringStarted();
|
||||||
|
|
||||||
@@ -170,16 +170,8 @@ TreeProxyModel::filterFinished()
|
|||||||
{
|
{
|
||||||
m_artistsFilterCmd = 0;
|
m_artistsFilterCmd = 0;
|
||||||
|
|
||||||
if ( qobject_cast< Tomahawk::TreeProxyModelPlaylistInterface* >( m_playlistInterface.data() )->vanillaFilter() != m_filter )
|
|
||||||
{
|
|
||||||
emit filterChanged( m_filter );
|
|
||||||
}
|
|
||||||
|
|
||||||
qobject_cast< Tomahawk::TreeProxyModelPlaylistInterface* >( m_playlistInterface )->setVanillaFilter( m_filter );
|
|
||||||
setFilterRegExp( m_filter );
|
setFilterRegExp( m_filter );
|
||||||
|
emit filterChanged( m_filter );
|
||||||
qobject_cast< Tomahawk::TreeProxyModelPlaylistInterface* >( m_playlistInterface )->sendTrackCount();
|
|
||||||
|
|
||||||
emit filteringFinished();
|
emit filteringFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -42,11 +42,10 @@ public:
|
|||||||
virtual ~TreeProxyModel() {}
|
virtual ~TreeProxyModel() {}
|
||||||
|
|
||||||
virtual void setSourcePlayableModel( TreeModel* model );
|
virtual void setSourcePlayableModel( TreeModel* model );
|
||||||
|
|
||||||
virtual void newFilterFromPlaylistInterface( const QString& pattern );
|
|
||||||
|
|
||||||
virtual Tomahawk::playlistinterface_ptr playlistInterface();
|
virtual Tomahawk::playlistinterface_ptr playlistInterface();
|
||||||
|
|
||||||
|
virtual void setFilter( const QString& pattern );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Reference in New Issue
Block a user