1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-18 20:04:00 +02:00

Fix some bugs in ze last.fm account

This commit is contained in:
Leo Franchi
2012-02-27 19:48:47 -05:00
parent f4c92793e6
commit 91546d0684
3 changed files with 9 additions and 9 deletions

View File

@@ -192,7 +192,7 @@ Account::types() const
types |= SipType; types |= SipType;
if ( m_types.contains( "ResolverType" ) ) if ( m_types.contains( "ResolverType" ) )
types |= ResolverType; types |= ResolverType;
if ( m_types.contains( "StatusPushTypeType" ) ) if ( m_types.contains( "StatusPushType" ) )
types |= StatusPushType; types |= StatusPushType;
return types; return types;

View File

@@ -175,7 +175,7 @@ LastFmAccount::password() const
void void
LastFmAccount::setPassword( const QString& password ) LastFmAccount::setPassword( const QString& password )
{ {
QVariantHash creds; QVariantHash creds = credentials();
creds[ "password" ] = password; creds[ "password" ] = password;
setCredentials( creds ); setCredentials( creds );
} }
@@ -190,7 +190,7 @@ LastFmAccount::sessionKey() const
void void
LastFmAccount::setSessionKey( const QString& sessionkey ) LastFmAccount::setSessionKey( const QString& sessionkey )
{ {
QVariantHash creds; QVariantHash creds = credentials();
creds[ "sessionkey" ] = sessionkey; creds[ "sessionkey" ] = sessionkey;
setCredentials( creds ); setCredentials( creds );
} }
@@ -206,7 +206,7 @@ LastFmAccount::username() const
void void
LastFmAccount::setUsername( const QString& username ) LastFmAccount::setUsername( const QString& username )
{ {
QVariantHash creds; QVariantHash creds = credentials();
creds[ "username" ] = username; creds[ "username" ] = username;
setCredentials( creds ); setCredentials( creds );
} }

View File

@@ -706,14 +706,14 @@ LastFmPlugin::artistImagesReturned()
void void
LastFmPlugin::settingsChanged() LastFmPlugin::settingsChanged()
{ {
if ( !m_scrobbler && m_account->enabled() ) if ( !m_scrobbler && m_account->scrobble() )
{ // can simply create the scrobbler { // can simply create the scrobbler
lastfm::ws::Username = m_account->username(); lastfm::ws::Username = m_account->username();
m_pw = m_account->password(); m_pw = m_account->password();
createScrobbler(); createScrobbler();
} }
else if ( m_scrobbler && !m_account->enabled() ) else if ( m_scrobbler && !m_account->scrobble() )
{ {
delete m_scrobbler; delete m_scrobbler;
m_scrobbler = 0; m_scrobbler = 0;
@@ -761,7 +761,7 @@ LastFmPlugin::onAuthenticated()
m_account->setSessionKey( lastfm::ws::SessionKey.toLatin1() ); m_account->setSessionKey( lastfm::ws::SessionKey.toLatin1() );
// qDebug() << "Got session key from last.fm"; // qDebug() << "Got session key from last.fm";
if ( m_account->enabled() ) if ( m_account->scrobble() )
m_scrobbler = new lastfm::Audioscrobbler( "thk" ); m_scrobbler = new lastfm::Audioscrobbler( "thk" );
} }
} }