mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-13 20:39:57 +01:00
Differentiate between setting subscribed and changing status
This commit is contained in:
parent
c1a1452c2f
commit
3d1b7ac4cf
@ -679,7 +679,7 @@ SpotifyAccount::setSubscribedForPlaylist( const playlist_ptr& playlist, bool sub
|
||||
sendMessage( msg, this );
|
||||
|
||||
updater->setSync( subscribed );
|
||||
updater->setSubscribed( subscribed );
|
||||
updater->setSubscribedStatus( subscribed );
|
||||
}
|
||||
|
||||
|
||||
@ -733,7 +733,7 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
QObject* receiver = m_qidToSlotMap[ qid ].first;
|
||||
QString slot = m_qidToSlotMap[ qid ].second;
|
||||
m_qidToSlotMap.remove( qid );
|
||||
|
||||
|
||||
QVariant extraData;
|
||||
if ( m_qidToExtraData.contains( qid ) )
|
||||
extraData = m_qidToExtraData.take( qid );
|
||||
@ -1214,7 +1214,7 @@ SpotifyAccount::sendMessage( const QVariantMap &m, QObject* obj, const QString&
|
||||
}
|
||||
|
||||
m_qidToExtraData[ qid ] = extraData;
|
||||
|
||||
|
||||
m_spotifyResolver.data()->sendMessage( msg );
|
||||
|
||||
return qid;
|
||||
@ -1312,7 +1312,7 @@ SpotifyAccount::setSyncForPlaylist( const QString& spotifyPlaylistId, bool sync
|
||||
|
||||
if ( info )
|
||||
info->sync = sync;
|
||||
|
||||
|
||||
|
||||
if ( !m_configWidget.isNull() )
|
||||
m_configWidget.data()->setPlaylists( m_allSpotifyPlaylists.values() );
|
||||
|
@ -65,7 +65,7 @@ SpotifyUpdaterFactory::create( const Tomahawk::playlist_ptr& pl, const QVariantH
|
||||
SpotifyPlaylistUpdater* updater = new SpotifyPlaylistUpdater( m_account.data(), latestRev, spotifyId, pl );
|
||||
updater->setSync( sync );
|
||||
updater->setCanSubscribe( canSubscribe );
|
||||
updater->setSubscribed( isSubscribed );
|
||||
updater->setSubscribedStatus( isSubscribed );
|
||||
m_account.data()->registerUpdaterForPlaylist( spotifyId, updater );
|
||||
|
||||
return updater;
|
||||
@ -242,8 +242,9 @@ SpotifyPlaylistUpdater::sync() const
|
||||
return m_sync;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SpotifyPlaylistUpdater::setSubscribed( bool subscribed )
|
||||
SpotifyPlaylistUpdater::setSubscribedStatus( bool subscribed )
|
||||
{
|
||||
if ( m_subscribed == subscribed )
|
||||
return;
|
||||
@ -255,6 +256,16 @@ SpotifyPlaylistUpdater::setSubscribed( bool subscribed )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SpotifyPlaylistUpdater::setSubscribed( bool subscribed )
|
||||
{
|
||||
if ( !m_spotify.isNull() )
|
||||
m_spotify.data()->setSubscribedForPlaylist( playlist(), subscribed );
|
||||
|
||||
// Spotify account will in turn call setSUbscribedStatus
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SpotifyPlaylistUpdater::subscribed() const
|
||||
{
|
||||
|
@ -55,7 +55,10 @@ public:
|
||||
bool sync() const;
|
||||
void setSync( bool sync );
|
||||
bool subscribed() const;
|
||||
// actually change the subscribed value in spotify
|
||||
void setSubscribed( bool subscribed );
|
||||
// Just set the subscribed flag
|
||||
void setSubscribedStatus( bool subscribed );
|
||||
bool canSubscribe() const;
|
||||
void setCanSubscribe( bool canSub );
|
||||
QString spotifyId() const { return m_spotifyId; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user