mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 08:04:25 +02:00
Porting of the rest of the non-QSharedPointer playlistinterface pointers
This commit is contained in:
@@ -34,7 +34,7 @@ LatchManager::LatchManager( QObject* parent )
|
|||||||
: QObject( parent )
|
: QObject( parent )
|
||||||
, m_state( NotLatched )
|
, m_state( NotLatched )
|
||||||
{
|
{
|
||||||
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::PlaylistInterface* ) ), this, SLOT( playlistChanged( Tomahawk::PlaylistInterface* ) ) );
|
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
LatchManager::~LatchManager()
|
LatchManager::~LatchManager()
|
||||||
@@ -62,7 +62,7 @@ LatchManager::latchRequest( const source_ptr& source )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
LatchManager::playlistChanged( PlaylistInterface* )
|
LatchManager::playlistChanged( Tomahawk::playlistinterface_ptr )
|
||||||
{
|
{
|
||||||
// If we were latched on and changed, send the listening along stop
|
// If we were latched on and changed, send the listening along stop
|
||||||
if ( m_latchedOnTo.isNull() )
|
if ( m_latchedOnTo.isNull() )
|
||||||
@@ -108,7 +108,7 @@ LatchManager::playlistChanged( PlaylistInterface* )
|
|||||||
m_latchedInterface.clear();
|
m_latchedInterface.clear();
|
||||||
|
|
||||||
// call ourselves to hit the "create latch" condition
|
// call ourselves to hit the "create latch" condition
|
||||||
playlistChanged( 0 );
|
playlistChanged( Tomahawk::playlistinterface_ptr() );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_latchedOnTo.clear();
|
m_latchedOnTo.clear();
|
||||||
|
@@ -45,8 +45,8 @@ public slots:
|
|||||||
void catchUpRequest();
|
void catchUpRequest();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void playlistChanged( Tomahawk::playlistinterface_ptr );
|
||||||
void playlistChanged( Tomahawk::PlaylistInterface* );
|
|
||||||
private:
|
private:
|
||||||
enum State {
|
enum State {
|
||||||
NotLatched = 0,
|
NotLatched = 0,
|
||||||
|
@@ -43,7 +43,7 @@ public:
|
|||||||
virtual ~ContextPage() {}
|
virtual ~ContextPage() {}
|
||||||
|
|
||||||
virtual QGraphicsWidget* widget() = 0;
|
virtual QGraphicsWidget* widget() = 0;
|
||||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const = 0;
|
virtual Tomahawk::playlistinterface_ptr playlistInterface() const = 0;
|
||||||
|
|
||||||
virtual QString title() const = 0;
|
virtual QString title() const = 0;
|
||||||
virtual QString description() const = 0;
|
virtual QString description() const = 0;
|
||||||
|
@@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
virtual QGraphicsWidget* widget() { return m_proxy; }
|
virtual QGraphicsWidget* widget() { return m_proxy; }
|
||||||
|
|
||||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
|
||||||
|
|
||||||
virtual QString title() const { return tr( "Related Artists" ); }
|
virtual QString title() const { return tr( "Related Artists" ); }
|
||||||
virtual QString description() const { return QString(); }
|
virtual QString description() const { return QString(); }
|
||||||
|
@@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
virtual QGraphicsWidget* widget() { return m_proxy; }
|
virtual QGraphicsWidget* widget() { return m_proxy; }
|
||||||
|
|
||||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
|
||||||
|
|
||||||
virtual QString title() const { return tr( "Top Hits" ); }
|
virtual QString title() const { return tr( "Top Hits" ); }
|
||||||
virtual QString description() const { return QString(); }
|
virtual QString description() const { return QString(); }
|
||||||
|
@@ -36,7 +36,7 @@ public:
|
|||||||
WikipediaContext() : WebContext() {}
|
WikipediaContext() : WebContext() {}
|
||||||
~WikipediaContext() {}
|
~WikipediaContext() {}
|
||||||
|
|
||||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
|
||||||
|
|
||||||
virtual QString title() const { return tr( "Wikipedia" ); }
|
virtual QString title() const { return tr( "Wikipedia" ); }
|
||||||
virtual QString description() const { return QString(); }
|
virtual QString description() const { return QString(); }
|
||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
LastfmContext() : WebContext() {}
|
LastfmContext() : WebContext() {}
|
||||||
~LastfmContext() {}
|
~LastfmContext() {}
|
||||||
|
|
||||||
virtual Tomahawk::PlaylistInterface* playlistInterface() const { return 0; }
|
virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return Tomahawk::playlistinterface_ptr(); }
|
||||||
|
|
||||||
virtual QString title() const { return tr( "Last.fm" ); }
|
virtual QString title() const { return tr( "Last.fm" ); }
|
||||||
virtual QString description() const { return QString(); }
|
virtual QString description() const { return QString(); }
|
||||||
|
@@ -62,8 +62,8 @@ MprisPlugin::MprisPlugin()
|
|||||||
SLOT( onVolumeChanged( int ) ) );
|
SLOT( onVolumeChanged( int ) ) );
|
||||||
|
|
||||||
// When the playlist changes, signals for several properties are sent
|
// When the playlist changes, signals for several properties are sent
|
||||||
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::PlaylistInterface* ) ),
|
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ),
|
||||||
SLOT( onPlaylistChanged( Tomahawk::PlaylistInterface* ) ) );
|
SLOT( onPlaylistChanged( Tomahawk::playlistinterface_ptr ) ) );
|
||||||
|
|
||||||
// When a track is added or removed, CanGoNext updated signal is sent
|
// When a track is added or removed, CanGoNext updated signal is sent
|
||||||
Tomahawk::playlistinterface_ptr playlist = AudioEngine::instance()->playlist();
|
Tomahawk::playlistinterface_ptr playlist = AudioEngine::instance()->playlist();
|
||||||
@@ -539,15 +539,15 @@ MprisPlugin::onVolumeChanged( int volume )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MprisPlugin::onPlaylistChanged( Tomahawk::PlaylistInterface* playlist )
|
MprisPlugin::onPlaylistChanged( Tomahawk::playlistinterface_ptr playlist )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
disconnect( this, SLOT( onTrackCountChanged( unsigned int ) ) );
|
disconnect( this, SLOT( onTrackCountChanged( unsigned int ) ) );
|
||||||
qDebug() << "disconnected";
|
qDebug() << "disconnected";
|
||||||
if( playlist )
|
if( !playlist.isNull() )
|
||||||
qDebug() << "playlist not null";
|
qDebug() << "playlist not null";
|
||||||
|
|
||||||
if( playlist )
|
if( !playlist.isNull() )
|
||||||
connect( playlist->object(), SIGNAL( trackCountChanged( unsigned int ) ),
|
connect( playlist->object(), SIGNAL( trackCountChanged( unsigned int ) ),
|
||||||
SLOT( onTrackCountChanged( unsigned int ) ) );
|
SLOT( onTrackCountChanged( unsigned int ) ) );
|
||||||
|
|
||||||
|
@@ -146,7 +146,7 @@ protected slots:
|
|||||||
private slots:
|
private slots:
|
||||||
void stateChanged( AudioState newState, AudioState oldState );
|
void stateChanged( AudioState newState, AudioState oldState );
|
||||||
void onVolumeChanged( int volume );
|
void onVolumeChanged( int volume );
|
||||||
void onPlaylistChanged( Tomahawk::PlaylistInterface* playlist);
|
void onPlaylistChanged( Tomahawk::playlistinterface_ptr );
|
||||||
void onTrackCountChanged( unsigned int tracks );
|
void onTrackCountChanged( unsigned int tracks );
|
||||||
void onSeeked( qint64 ms );
|
void onSeeked( qint64 ms );
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ DynamicWidget::DynamicWidget( const Tomahawk::dynplaylist_ptr& playlist, QWidget
|
|||||||
connect( m_controls, SIGNAL( controlsChanged( bool ) ), this, SLOT( controlsChanged( bool ) ), Qt::QueuedConnection );
|
connect( m_controls, SIGNAL( controlsChanged( bool ) ), this, SLOT( controlsChanged( bool ) ), Qt::QueuedConnection );
|
||||||
|
|
||||||
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), this, SLOT( trackStarted() ) );
|
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), this, SLOT( trackStarted() ) );
|
||||||
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::PlaylistInterface* ) ), this, SLOT( playlistChanged( Tomahawk::PlaylistInterface* ) ) );
|
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -241,9 +241,9 @@ DynamicWidget::layoutFloatingWidgets()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
DynamicWidget::playlistChanged( PlaylistInterface* pl )
|
DynamicWidget::playlistChanged( Tomahawk::playlistinterface_ptr pl )
|
||||||
{
|
{
|
||||||
if( pl == static_cast< PlaylistInterface* >( m_view->proxyModel() ) ) { // same playlist
|
if( pl == m_view->proxyModel()->getSharedPointer() ) { // same playlist
|
||||||
m_activePlaylist = true;
|
m_activePlaylist = true;
|
||||||
} else {
|
} else {
|
||||||
m_activePlaylist = false;
|
m_activePlaylist = false;
|
||||||
|
@@ -88,7 +88,7 @@ public slots:
|
|||||||
void trackStarted();
|
void trackStarted();
|
||||||
void stationFailed( const QString& );
|
void stationFailed( const QString& );
|
||||||
|
|
||||||
void playlistChanged( Tomahawk::PlaylistInterface* );
|
void playlistChanged( Tomahawk::playlistinterface_ptr );
|
||||||
void tracksAdded();
|
void tracksAdded();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@@ -105,7 +105,7 @@ ViewManager::ViewManager( QObject* parent )
|
|||||||
m_widget->layout()->setMargin( 0 );
|
m_widget->layout()->setMargin( 0 );
|
||||||
m_widget->layout()->setSpacing( 0 );
|
m_widget->layout()->setSpacing( 0 );
|
||||||
|
|
||||||
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::PlaylistInterface* ) ), this, SLOT( playlistInterfaceChanged( Tomahawk::PlaylistInterface* ) ) );
|
connect( AudioEngine::instance(), SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistInterfaceChanged( Tomahawk::playlistinterface_ptr ) ) );
|
||||||
|
|
||||||
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
|
connect( &m_filterTimer, SIGNAL( timeout() ), SLOT( applyFilter() ) );
|
||||||
connect( m_infobar, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
|
connect( m_infobar, SIGNAL( filterTextChanged( QString ) ), SLOT( setFilter( QString ) ) );
|
||||||
|
@@ -37,7 +37,7 @@ RecentlyPlayedPlaylistsModel::RecentlyPlayedPlaylistsModel( QObject* parent )
|
|||||||
|
|
||||||
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), this, SLOT( onSourceAdded( Tomahawk::source_ptr ) ), Qt::QueuedConnection );
|
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), this, SLOT( onSourceAdded( Tomahawk::source_ptr ) ), Qt::QueuedConnection );
|
||||||
connect( TomahawkSettings::instance(), SIGNAL( recentlyPlayedPlaylistAdded( Tomahawk::playlist_ptr ) ), this, SLOT( plAdded( Tomahawk::playlist_ptr ) ) );
|
connect( TomahawkSettings::instance(), SIGNAL( recentlyPlayedPlaylistAdded( Tomahawk::playlist_ptr ) ), this, SLOT( plAdded( Tomahawk::playlist_ptr ) ) );
|
||||||
connect( AudioEngine::instance(),SIGNAL( playlistChanged( Tomahawk::PlaylistInterface* ) ), this, SLOT( playlistChanged( Tomahawk::PlaylistInterface* ) ), Qt::QueuedConnection );
|
connect( AudioEngine::instance(),SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( playlistChanged( Tomahawk::playlistinterface_ptr ) ), Qt::QueuedConnection );
|
||||||
|
|
||||||
emit emptinessChanged( m_recplaylists.isEmpty() );
|
emit emptinessChanged( m_recplaylists.isEmpty() );
|
||||||
}
|
}
|
||||||
@@ -229,10 +229,13 @@ RecentlyPlayedPlaylistsModel::plAdded( const playlist_ptr& pl )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RecentlyPlayedPlaylistsModel::playlistChanged( Tomahawk::PlaylistInterface* pli )
|
RecentlyPlayedPlaylistsModel::playlistChanged( Tomahawk::playlistinterface_ptr pli )
|
||||||
{
|
{
|
||||||
// ARG
|
// ARG
|
||||||
if( Playlist* pl = dynamic_cast< Playlist* >( pli ) ) {
|
if ( pli.isNull() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( Playlist *pl = dynamic_cast< Playlist* >( pli.data() ) ) {
|
||||||
// look for it, qsharedpointer fail
|
// look for it, qsharedpointer fail
|
||||||
playlist_ptr ptr;
|
playlist_ptr ptr;
|
||||||
foreach( const playlist_ptr& test, m_recplaylists ) {
|
foreach( const playlist_ptr& test, m_recplaylists ) {
|
||||||
|
@@ -44,8 +44,11 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void emptinessChanged( bool isEmpty );
|
void emptinessChanged( bool isEmpty );
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void sourceOnline();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void playlistChanged( Tomahawk::PlaylistInterface* );
|
void playlistChanged( Tomahawk::playlistinterface_ptr );
|
||||||
void onSourceAdded( const Tomahawk::source_ptr& source );
|
void onSourceAdded( const Tomahawk::source_ptr& source );
|
||||||
void onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> );
|
void onPlaylistsRemoved( QList<Tomahawk::playlist_ptr> );
|
||||||
void loadFromSettings();
|
void loadFromSettings();
|
||||||
@@ -60,8 +63,6 @@ private:
|
|||||||
|
|
||||||
unsigned int m_maxPlaylists;
|
unsigned int m_maxPlaylists;
|
||||||
bool m_waitingForSome;
|
bool m_waitingForSome;
|
||||||
public slots:
|
|
||||||
void sourceOnline();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RECENTLYPLAYEDPLAYLISTSMODEL_H
|
#endif // RECENTLYPLAYEDPLAYLISTSMODEL_H
|
||||||
|
@@ -85,7 +85,7 @@ SocialPlaylistWidget::SocialPlaylistWidget ( QWidget* parent )
|
|||||||
connect( SourceList::instance(), SIGNAL( ready() ), SLOT( updateRecentTracks() ) );
|
connect( SourceList::instance(), SIGNAL( ready() ), SLOT( updateRecentTracks() ) );
|
||||||
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ) );
|
connect( SourceList::instance(), SIGNAL( sourceAdded( Tomahawk::source_ptr ) ), SLOT( onSourceAdded( Tomahawk::source_ptr ) ) );
|
||||||
connect( ui->playlistWidget, SIGNAL( activated( QModelIndex ) ), SLOT( onPlaylistActivated( QModelIndex ) ) );
|
connect( ui->playlistWidget, SIGNAL( activated( QModelIndex ) ), SLOT( onPlaylistActivated( QModelIndex ) ) );
|
||||||
connect( AudioEngine::instance() ,SIGNAL( playlistChanged( Tomahawk::PlaylistInterface* ) ), this, SLOT( updatePlaylists() ), Qt::QueuedConnection );
|
connect( AudioEngine::instance() ,SIGNAL( playlistChanged( Tomahawk::playlistinterface_ptr ) ), this, SLOT( updatePlaylists() ), Qt::QueuedConnection );
|
||||||
*/
|
*/
|
||||||
fetchFromDB();
|
fetchFromDB();
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
{
|
{
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
|
|
||||||
m_plInterface = new MetaPlaylistInterface( this );
|
m_plInterface = Tomahawk::playlistinterface_ptr( new MetaPlaylistInterface( this ) );
|
||||||
|
|
||||||
ui->albums->setFrameShape( QFrame::NoFrame );
|
ui->albums->setFrameShape( QFrame::NoFrame );
|
||||||
ui->albums->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
ui->albums->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
@@ -97,7 +97,6 @@ ArtistInfoWidget::ArtistInfoWidget( const Tomahawk::artist_ptr& artist, QWidget*
|
|||||||
|
|
||||||
ArtistInfoWidget::~ArtistInfoWidget()
|
ArtistInfoWidget::~ArtistInfoWidget()
|
||||||
{
|
{
|
||||||
delete m_plInterface;
|
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +104,7 @@ ArtistInfoWidget::~ArtistInfoWidget()
|
|||||||
Tomahawk::playlistinterface_ptr
|
Tomahawk::playlistinterface_ptr
|
||||||
ArtistInfoWidget::playlistInterface() const
|
ArtistInfoWidget::playlistInterface() const
|
||||||
{
|
{
|
||||||
return m_plInterface->getSharedPointer();
|
return m_plInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -107,7 +107,7 @@ private:
|
|||||||
TreeModel* m_relatedModel;
|
TreeModel* m_relatedModel;
|
||||||
TreeModel* m_albumsModel;
|
TreeModel* m_albumsModel;
|
||||||
PlaylistModel* m_topHitsModel;
|
PlaylistModel* m_topHitsModel;
|
||||||
MetaPlaylistInterface* m_plInterface;
|
Tomahawk::playlistinterface_ptr m_plInterface;
|
||||||
|
|
||||||
OverlayButton* m_button;
|
OverlayButton* m_button;
|
||||||
|
|
||||||
|
@@ -64,7 +64,7 @@ public:
|
|||||||
virtual QList< Tomahawk::query_ptr > tracks() { return QList< Tomahawk::query_ptr >(); }
|
virtual QList< Tomahawk::query_ptr > tracks() { return QList< Tomahawk::query_ptr >(); }
|
||||||
virtual int unfilteredTrackCount() const { return 0; }
|
virtual int unfilteredTrackCount() const { return 0; }
|
||||||
|
|
||||||
virtual bool hasChildInterface( PlaylistInterface* other )
|
virtual bool hasChildInterface( Tomahawk::playlistinterface_ptr other )
|
||||||
{
|
{
|
||||||
return ( m_w->ui->albums->playlistInterface() == other ) ||
|
return ( m_w->ui->albums->playlistInterface() == other ) ||
|
||||||
( m_w->ui->relatedArtists->playlistInterface() == other ) ||
|
( m_w->ui->relatedArtists->playlistInterface() == other ) ||
|
||||||
|
@@ -61,7 +61,7 @@ public:
|
|||||||
virtual QList< Tomahawk::query_ptr > tracks() { return QList< Tomahawk::query_ptr >(); }
|
virtual QList< Tomahawk::query_ptr > tracks() { return QList< Tomahawk::query_ptr >(); }
|
||||||
virtual int unfilteredTrackCount() const { return 0; }
|
virtual int unfilteredTrackCount() const { return 0; }
|
||||||
|
|
||||||
virtual bool hasChildInterface( PlaylistInterface* other )
|
virtual bool hasChildInterface( Tomahawk::playlistinterface_ptr other )
|
||||||
{
|
{
|
||||||
return m_w->ui->tracksViewLeft->playlistInterface() == other ||
|
return m_w->ui->tracksViewLeft->playlistInterface() == other ||
|
||||||
m_w->ui->artistsViewLeft->playlistInterface() == other;
|
m_w->ui->artistsViewLeft->playlistInterface() == other;
|
||||||
|
Reference in New Issue
Block a user