mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
Remove autoconnect hidden toggle
This commit is contained in:
@@ -46,7 +46,6 @@ accountTypeToString( AccountType type )
|
|||||||
Account::Account( const QString& accountId )
|
Account::Account( const QString& accountId )
|
||||||
: QObject()
|
: QObject()
|
||||||
, m_enabled( false )
|
, m_enabled( false )
|
||||||
, m_autoConnect( false )
|
|
||||||
, m_accountId( accountId )
|
, m_accountId( accountId )
|
||||||
{
|
{
|
||||||
connect( this, SIGNAL( error( int, QString ) ), this, SLOT( onError( int,QString ) ) );
|
connect( this, SIGNAL( error( int, QString ) ), this, SLOT( onError( int,QString ) ) );
|
||||||
@@ -126,7 +125,6 @@ Account::syncConfig()
|
|||||||
s->beginGroup( "accounts/" + m_accountId );
|
s->beginGroup( "accounts/" + m_accountId );
|
||||||
s->setValue( "accountfriendlyname", m_accountFriendlyName );
|
s->setValue( "accountfriendlyname", m_accountFriendlyName );
|
||||||
s->setValue( "enabled", m_enabled );
|
s->setValue( "enabled", m_enabled );
|
||||||
s->setValue( "autoconnect", m_autoConnect );
|
|
||||||
s->setValue( "credentials", m_credentials );
|
s->setValue( "credentials", m_credentials );
|
||||||
s->setValue( "configuration", m_configuration );
|
s->setValue( "configuration", m_configuration );
|
||||||
s->setValue( "acl", m_acl );
|
s->setValue( "acl", m_acl );
|
||||||
@@ -144,7 +142,6 @@ Account::loadFromConfig( const QString& accountId )
|
|||||||
s->beginGroup( "accounts/" + m_accountId );
|
s->beginGroup( "accounts/" + m_accountId );
|
||||||
m_accountFriendlyName = s->value( "accountfriendlyname", QString() ).toString();
|
m_accountFriendlyName = s->value( "accountfriendlyname", QString() ).toString();
|
||||||
m_enabled = s->value( "enabled", false ).toBool();
|
m_enabled = s->value( "enabled", false ).toBool();
|
||||||
m_autoConnect = s->value( "autoconnect", false ).toBool();
|
|
||||||
m_credentials = s->value( "credentials", QVariantHash() ).toHash();
|
m_credentials = s->value( "credentials", QVariantHash() ).toHash();
|
||||||
m_configuration = s->value( "configuration", QVariantHash() ).toHash();
|
m_configuration = s->value( "configuration", QVariantHash() ).toHash();
|
||||||
m_acl = s->value( "acl", QVariantMap() ).toMap();
|
m_acl = s->value( "acl", QVariantMap() ).toMap();
|
||||||
@@ -160,7 +157,6 @@ Account::removeFromConfig()
|
|||||||
s->beginGroup( "accounts/" + m_accountId );
|
s->beginGroup( "accounts/" + m_accountId );
|
||||||
s->remove( "accountfriendlyname" );
|
s->remove( "accountfriendlyname" );
|
||||||
s->remove( "enabled" );
|
s->remove( "enabled" );
|
||||||
s->remove( "autoconnect" );
|
|
||||||
s->remove( "credentials" );
|
s->remove( "credentials" );
|
||||||
s->remove( "configuration" );
|
s->remove( "configuration" );
|
||||||
s->remove( "acl" );
|
s->remove( "acl" );
|
||||||
|
@@ -78,7 +78,6 @@ public:
|
|||||||
QString accountServiceName() const { QMutexLocker locker( &m_mutex ); return m_accountServiceName; } // e.g. "Twitter", "Last.fm"
|
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.
|
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 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; }
|
QString accountId() const { QMutexLocker locker( &m_mutex ); return m_accountId; }
|
||||||
|
|
||||||
QVariantHash configuration() const { QMutexLocker locker( &m_mutex ); return m_configuration; }
|
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 setAccountServiceName( const QString &serviceName ) { QMutexLocker locker( &m_mutex ); m_accountServiceName = serviceName; }
|
||||||
void setAccountFriendlyName( const QString &friendlyName ) { QMutexLocker locker( &m_mutex ); m_accountFriendlyName = friendlyName; }
|
void setAccountFriendlyName( const QString &friendlyName ) { QMutexLocker locker( &m_mutex ); m_accountFriendlyName = friendlyName; }
|
||||||
void setEnabled( bool enabled ) { QMutexLocker locker( &m_mutex ); m_enabled = enabled; }
|
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 setAccountId( const QString &accountId ) { QMutexLocker locker( &m_mutex ); m_accountId = accountId; }
|
||||||
void setCredentials( const QVariantHash &credentialHash ) { QMutexLocker locker( &m_mutex ); m_credentials = credentialHash; }
|
void setCredentials( const QVariantHash &credentialHash ) { QMutexLocker locker( &m_mutex ); m_credentials = credentialHash; }
|
||||||
void setConfiguration( const QVariantHash &configuration ) { QMutexLocker locker( &m_mutex ); m_configuration = configuration; }
|
void setConfiguration( const QVariantHash &configuration ) { QMutexLocker locker( &m_mutex ); m_configuration = configuration; }
|
||||||
@@ -148,7 +146,6 @@ private:
|
|||||||
QString m_accountFriendlyName;
|
QString m_accountFriendlyName;
|
||||||
QString m_cachedError;
|
QString m_cachedError;
|
||||||
bool m_enabled;
|
bool m_enabled;
|
||||||
bool m_autoConnect;
|
|
||||||
QString m_accountId;
|
QString m_accountId;
|
||||||
QVariantHash m_credentials;
|
QVariantHash m_credentials;
|
||||||
QVariantHash m_configuration;
|
QVariantHash m_configuration;
|
||||||
|
@@ -374,7 +374,7 @@ AccountManager::hookupAndEnable( Account* account, bool startup )
|
|||||||
if ( p )
|
if ( p )
|
||||||
SipHandler::instance()->hookUpPlugin( p );
|
SipHandler::instance()->hookUpPlugin( p );
|
||||||
|
|
||||||
if ( account->enabled() && ( !startup || account->autoConnect() ) )
|
if ( account->enabled() )
|
||||||
{
|
{
|
||||||
account->authenticate();
|
account->authenticate();
|
||||||
m_enabledAccounts << account;
|
m_enabledAccounts << account;
|
||||||
|
@@ -33,7 +33,6 @@ handleAccountAdded( Tomahawk::Accounts::Account* account, bool added )
|
|||||||
if ( added )
|
if ( added )
|
||||||
{
|
{
|
||||||
account->setEnabled( true );
|
account->setEnabled( true );
|
||||||
account->setAutoConnect( true );
|
|
||||||
account->saveConfig();
|
account->saveConfig();
|
||||||
|
|
||||||
TomahawkSettings::instance()->addAccount( account->accountId() );
|
TomahawkSettings::instance()->addAccount( account->accountId() );
|
||||||
|
Reference in New Issue
Block a user