From 948a438ff275d157706ccbce4049016c06026747 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Fri, 30 Mar 2012 15:00:53 -0400 Subject: [PATCH] Remove autoconnect hidden toggle --- src/libtomahawk/accounts/Account.cpp | 4 ---- src/libtomahawk/accounts/Account.h | 3 --- src/libtomahawk/accounts/AccountManager.cpp | 2 +- src/utils/guihelpers.cpp | 1 - 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/libtomahawk/accounts/Account.cpp b/src/libtomahawk/accounts/Account.cpp index 7450a96a4..e8a293c2e 100644 --- a/src/libtomahawk/accounts/Account.cpp +++ b/src/libtomahawk/accounts/Account.cpp @@ -46,7 +46,6 @@ accountTypeToString( AccountType type ) Account::Account( const QString& accountId ) : QObject() , m_enabled( false ) - , m_autoConnect( false ) , m_accountId( accountId ) { connect( this, SIGNAL( error( int, QString ) ), this, SLOT( onError( int,QString ) ) ); @@ -126,7 +125,6 @@ Account::syncConfig() s->beginGroup( "accounts/" + m_accountId ); s->setValue( "accountfriendlyname", m_accountFriendlyName ); s->setValue( "enabled", m_enabled ); - s->setValue( "autoconnect", m_autoConnect ); s->setValue( "credentials", m_credentials ); s->setValue( "configuration", m_configuration ); s->setValue( "acl", m_acl ); @@ -144,7 +142,6 @@ Account::loadFromConfig( const QString& accountId ) s->beginGroup( "accounts/" + m_accountId ); m_accountFriendlyName = s->value( "accountfriendlyname", QString() ).toString(); m_enabled = s->value( "enabled", false ).toBool(); - m_autoConnect = s->value( "autoconnect", false ).toBool(); m_credentials = s->value( "credentials", QVariantHash() ).toHash(); m_configuration = s->value( "configuration", QVariantHash() ).toHash(); m_acl = s->value( "acl", QVariantMap() ).toMap(); @@ -160,7 +157,6 @@ Account::removeFromConfig() s->beginGroup( "accounts/" + m_accountId ); s->remove( "accountfriendlyname" ); s->remove( "enabled" ); - s->remove( "autoconnect" ); s->remove( "credentials" ); s->remove( "configuration" ); s->remove( "acl" ); diff --git a/src/libtomahawk/accounts/Account.h b/src/libtomahawk/accounts/Account.h index f2e297241..43e98ff67 100644 --- a/src/libtomahawk/accounts/Account.h +++ b/src/libtomahawk/accounts/Account.h @@ -78,7 +78,6 @@ public: QString accountServiceName() const { QMutexLocker locker( &m_mutex ); return m_accountServiceName; } // e.g. "Twitter", "Last.fm" QString accountFriendlyName() const { QMutexLocker locker( &m_mutex ); return m_accountFriendlyName; } // e.g. screen name on the service, JID, etc. bool enabled() const { QMutexLocker locker( &m_mutex ); return m_enabled; } - bool autoConnect() const { QMutexLocker locker( &m_mutex ); return m_autoConnect; } QString accountId() const { QMutexLocker locker( &m_mutex ); return m_accountId; } QVariantHash configuration() const { QMutexLocker locker( &m_mutex ); return m_configuration; } @@ -109,7 +108,6 @@ public: void setAccountServiceName( const QString &serviceName ) { QMutexLocker locker( &m_mutex ); m_accountServiceName = serviceName; } void setAccountFriendlyName( const QString &friendlyName ) { QMutexLocker locker( &m_mutex ); m_accountFriendlyName = friendlyName; } void setEnabled( bool enabled ) { QMutexLocker locker( &m_mutex ); m_enabled = enabled; } - void setAutoConnect( bool autoConnect ) { QMutexLocker locker( &m_mutex ); m_autoConnect = autoConnect; } void setAccountId( const QString &accountId ) { QMutexLocker locker( &m_mutex ); m_accountId = accountId; } void setCredentials( const QVariantHash &credentialHash ) { QMutexLocker locker( &m_mutex ); m_credentials = credentialHash; } void setConfiguration( const QVariantHash &configuration ) { QMutexLocker locker( &m_mutex ); m_configuration = configuration; } @@ -148,7 +146,6 @@ private: QString m_accountFriendlyName; QString m_cachedError; bool m_enabled; - bool m_autoConnect; QString m_accountId; QVariantHash m_credentials; QVariantHash m_configuration; diff --git a/src/libtomahawk/accounts/AccountManager.cpp b/src/libtomahawk/accounts/AccountManager.cpp index 1683485e7..eb1f7b43d 100644 --- a/src/libtomahawk/accounts/AccountManager.cpp +++ b/src/libtomahawk/accounts/AccountManager.cpp @@ -374,7 +374,7 @@ AccountManager::hookupAndEnable( Account* account, bool startup ) if ( p ) SipHandler::instance()->hookUpPlugin( p ); - if ( account->enabled() && ( !startup || account->autoConnect() ) ) + if ( account->enabled() ) { account->authenticate(); m_enabledAccounts << account; diff --git a/src/utils/guihelpers.cpp b/src/utils/guihelpers.cpp index e7345e4f2..fd1bfe8a1 100644 --- a/src/utils/guihelpers.cpp +++ b/src/utils/guihelpers.cpp @@ -33,7 +33,6 @@ handleAccountAdded( Tomahawk::Accounts::Account* account, bool added ) if ( added ) { account->setEnabled( true ); - account->setAutoConnect( true ); account->saveConfig(); TomahawkSettings::instance()->addAccount( account->accountId() );