diff --git a/src/accounts/spotify/SpotifyAccount.cpp b/src/accounts/spotify/SpotifyAccount.cpp index 3cd14625f..d0cc7a72f 100644 --- a/src/accounts/spotify/SpotifyAccount.cpp +++ b/src/accounts/spotify/SpotifyAccount.cpp @@ -509,6 +509,12 @@ SpotifyAccount::saveConfig() } } sync(); + + if ( !m_configWidget.data()->loggedInManually() && !m_configWidget.data()->username().isEmpty() && !m_configWidget.data()->password().isEmpty() ) + { + // If the user never pressed log in, he might have just pressed ok or hit enter. So log in anyway + login( m_configWidget.data()->username(), m_configWidget.data()->password() ); + } } diff --git a/src/accounts/spotify/SpotifyAccountConfig.cpp b/src/accounts/spotify/SpotifyAccountConfig.cpp index 0754ce8a2..2d475bad2 100644 --- a/src/accounts/spotify/SpotifyAccountConfig.cpp +++ b/src/accounts/spotify/SpotifyAccountConfig.cpp @@ -34,6 +34,7 @@ SpotifyAccountConfig::SpotifyAccountConfig( SpotifyAccount *account ) , m_ui( new Ui::SpotifyConfig ) , m_account( account ) , m_playlistsLoading( 0 ) + , m_loggedInManually( false ) { m_ui->setupUi( this ); @@ -51,6 +52,7 @@ void SpotifyAccountConfig::showEvent( QShowEvent *event ) { loadFromConfig(); + m_loggedInManually = false; } @@ -132,6 +134,7 @@ SpotifyAccountConfig::doLogin() m_ui->loginButton->setEnabled( false ); m_playlistsLoading->fadeIn(); + m_loggedInManually = true; emit login( username(), password() ); } diff --git a/src/accounts/spotify/SpotifyAccountConfig.h b/src/accounts/spotify/SpotifyAccountConfig.h index 9aa5fe1d0..56d3ff748 100644 --- a/src/accounts/spotify/SpotifyAccountConfig.h +++ b/src/accounts/spotify/SpotifyAccountConfig.h @@ -56,6 +56,8 @@ public: void saveSettings(); void loginResponse( bool success, const QString& msg ); + + bool loggedInManually() const { return m_loggedInManually; } signals: void login( const QString& username, const QString& pw ); @@ -73,6 +75,7 @@ private: Ui::SpotifyConfig* m_ui; SpotifyAccount* m_account; LoadingSpinner* m_playlistsLoading; + bool m_loggedInManually; }; }