mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-22 17:01:51 +02:00
* Reset filter correctly when switching collection / playlist.
This commit is contained in:
parent
fddefedfad
commit
ed50074887
src/libtomahawk
@ -539,7 +539,7 @@ PlaylistManager::applyFilter()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
if ( m_currentInterface )
|
||||
if ( m_currentInterface && m_currentInterface->filter() != m_filter )
|
||||
m_currentInterface->setFilter( m_filter );
|
||||
}
|
||||
|
||||
@ -585,11 +585,12 @@ PlaylistManager::linkPlaylist()
|
||||
m_interfaceHistory << m_currentInterface;
|
||||
}
|
||||
|
||||
// applyFilter();
|
||||
AudioEngine::instance()->setPlaylist( m_currentInterface );
|
||||
|
||||
if ( m_currentInterface && m_statsAvailable )
|
||||
{
|
||||
m_topbar->setFilter( m_currentInterface->filter() );
|
||||
|
||||
emit numTracksChanged( m_currentInterface->unfilteredTrackCount() );
|
||||
emit numShownChanged( m_currentInterface->trackCount() );
|
||||
emit repeatModeChanged( m_currentInterface->repeatMode() );
|
||||
@ -643,16 +644,17 @@ PlaylistManager::setShuffled( bool enabled )
|
||||
|
||||
void
|
||||
PlaylistManager::createPlaylist( const Tomahawk::source_ptr& src,
|
||||
const QVariant& contents)
|
||||
const QVariant& contents )
|
||||
{
|
||||
Tomahawk::playlist_ptr p = Tomahawk::playlist_ptr( new Tomahawk::Playlist( src ) );
|
||||
QJson::QObjectHelper::qvariant2qobject( contents.toMap(), p.data() );
|
||||
p->reportCreated( p );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistManager::createDynamicPlaylist( const Tomahawk::source_ptr& src,
|
||||
const QVariant& contents)
|
||||
const QVariant& contents )
|
||||
{
|
||||
Tomahawk::dynplaylist_ptr p = Tomahawk::dynplaylist_ptr( new Tomahawk::DynamicPlaylist( src, contents.toMap().value( "type", QString() ).toString() ) );
|
||||
QJson::QObjectHelper::qvariant2qobject( contents.toMap(), p.data() );
|
||||
@ -676,12 +678,16 @@ PlaylistManager::showCurrentTrack()
|
||||
m_currentView->scrollTo( m_currentProxyModel->currentItem(), QAbstractItemView::PositionAtCenter );*/
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistManager::onPlayClicked() {
|
||||
PlaylistManager::onPlayClicked()
|
||||
{
|
||||
emit playClicked();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PlaylistManager::onPauseClicked() {
|
||||
PlaylistManager::onPauseClicked()
|
||||
{
|
||||
emit pauseClicked();
|
||||
}
|
@ -231,3 +231,10 @@ TopBar::setModesVisible( bool b )
|
||||
{
|
||||
ui->widgetRadio->setVisible( b );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TopBar::setFilter( const QString& filter )
|
||||
{
|
||||
ui->filterEdit->setText( filter );
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ public slots:
|
||||
void addSource();
|
||||
void removeSource();
|
||||
|
||||
void setFilter( const QString& filter );
|
||||
|
||||
protected:
|
||||
void changeEvent( QEvent* e );
|
||||
void resizeEvent( QResizeEvent* e );
|
||||
|
@ -42,6 +42,7 @@ void
|
||||
TrackProxyModel::setFilter( const QString& pattern )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
PlaylistInterface::setFilter( pattern );
|
||||
setFilterRegExp( pattern );
|
||||
|
||||
emit filterChanged( pattern );
|
||||
|
@ -29,7 +29,8 @@ public:
|
||||
virtual PlaylistInterface::RepeatMode repeatMode() const = 0;
|
||||
virtual bool shuffled() const = 0;
|
||||
|
||||
virtual void setFilter( const QString& pattern ) = 0;
|
||||
virtual QString filter() const { return m_filter; }
|
||||
virtual void setFilter( const QString& pattern ) { m_filter = pattern; }
|
||||
|
||||
QWidget* widget() const { return m_widget; }
|
||||
void setWidget( QWidget* widget ) { m_widget = widget; }
|
||||
@ -49,6 +50,8 @@ signals:
|
||||
private:
|
||||
QWidget* m_widget;
|
||||
QObject* m_object;
|
||||
|
||||
QString m_filter;
|
||||
};
|
||||
|
||||
#endif // PLAYLISTINTERFACE_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user