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