mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 21:57:41 +02:00
* Style fixes for AccountManager.
This commit is contained in:
@@ -146,8 +146,9 @@ AccountManager::loadPluginFactories( const QStringList& paths )
|
|||||||
bool
|
bool
|
||||||
AccountManager::hasPluginWithFactory( const QString& factory ) const
|
AccountManager::hasPluginWithFactory( const QString& factory ) const
|
||||||
{
|
{
|
||||||
foreach( Account* account, m_accounts ) {
|
foreach ( Account* account, m_accounts )
|
||||||
if( factoryFromId( account->accountId() ) == factory )
|
{
|
||||||
|
if ( factoryFromId( account->accountId() ) == factory )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -161,6 +162,7 @@ AccountManager::factoryFromId( const QString& accountId ) const
|
|||||||
return accountId.split( "_" ).first();
|
return accountId.split( "_" ).first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AccountFactory*
|
AccountFactory*
|
||||||
AccountManager::factoryForAccount( Account* account ) const
|
AccountManager::factoryForAccount( Account* account ) const
|
||||||
{
|
{
|
||||||
@@ -230,7 +232,7 @@ void
|
|||||||
AccountManager::connectAll()
|
AccountManager::connectAll()
|
||||||
{
|
{
|
||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
||||||
foreach( Account* acc, m_accounts )
|
foreach ( Account* acc, m_accounts )
|
||||||
{
|
{
|
||||||
if ( acc->enabled() )
|
if ( acc->enabled() )
|
||||||
{
|
{
|
||||||
@@ -247,7 +249,7 @@ void
|
|||||||
AccountManager::disconnectAll()
|
AccountManager::disconnectAll()
|
||||||
{
|
{
|
||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
|
||||||
foreach( Account* acc, m_enabledAccounts )
|
foreach ( Account* acc, m_enabledAccounts )
|
||||||
acc->deauthenticate();
|
acc->deauthenticate();
|
||||||
|
|
||||||
m_enabledAccounts.clear();
|
m_enabledAccounts.clear();
|
||||||
@@ -272,10 +274,10 @@ AccountManager::loadFromConfig()
|
|||||||
{
|
{
|
||||||
QStringList accountIds = TomahawkSettings::instance()->accounts();
|
QStringList accountIds = TomahawkSettings::instance()->accounts();
|
||||||
qDebug() << "LOADING ALL ACCOUNTS" << accountIds;
|
qDebug() << "LOADING ALL ACCOUNTS" << accountIds;
|
||||||
foreach( const QString& accountId, accountIds )
|
foreach ( const QString& accountId, accountIds )
|
||||||
{
|
{
|
||||||
QString pluginFactory = factoryFromId( accountId );
|
QString pluginFactory = factoryFromId( accountId );
|
||||||
if( m_accountFactories.contains( pluginFactory ) )
|
if ( m_accountFactories.contains( pluginFactory ) )
|
||||||
{
|
{
|
||||||
Account* account = loadPlugin( accountId );
|
Account* account = loadPlugin( accountId );
|
||||||
addAccount( account );
|
addAccount( account );
|
||||||
@@ -283,11 +285,12 @@ AccountManager::loadFromConfig()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AccountManager::initSIP()
|
AccountManager::initSIP()
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO;
|
tDebug() << Q_FUNC_INFO;
|
||||||
foreach( Account* account, accounts() )
|
foreach ( Account* account, accounts() )
|
||||||
{
|
{
|
||||||
hookupAndEnable( account, true );
|
hookupAndEnable( account, true );
|
||||||
}
|
}
|
||||||
@@ -376,7 +379,7 @@ AccountManager::accountFromPath( const QString& accountPath )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_ASSERT_X( false, "Shouldn't have had no account factory accepting a path.. at least ResolverAccount!!", "");
|
Q_ASSERT_X( false, "Shouldn't have had no account factory accepting a path.. at least ResolverAccount!", "" );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,15 +401,16 @@ AccountManager::addAccountFactory( AccountFactory* factory )
|
|||||||
Account*
|
Account*
|
||||||
AccountManager::zeroconfAccount() const
|
AccountManager::zeroconfAccount() const
|
||||||
{
|
{
|
||||||
foreach( Account* account, accounts() )
|
foreach ( Account* account, accounts() )
|
||||||
{
|
{
|
||||||
if( account->sipPlugin() && account->sipPlugin()->serviceName() == "zeroconf" )
|
if ( account->sipPlugin() && account->sipPlugin()->serviceName() == "zeroconf" )
|
||||||
return account;
|
return account;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AccountManager::hookupAccount( Account* account ) const
|
AccountManager::hookupAccount( Account* account ) const
|
||||||
{
|
{
|
||||||
@@ -450,16 +454,18 @@ AccountManager::onError( int code, const QString& msg )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AccountManager::onSettingsChanged()
|
AccountManager::onSettingsChanged()
|
||||||
{
|
{
|
||||||
foreach( Account* account, m_accounts )
|
foreach ( Account* account, m_accounts )
|
||||||
{
|
{
|
||||||
if ( account->types() & Accounts::SipType && account->sipPlugin() )
|
if ( account->types() & Accounts::SipType && account->sipPlugin() )
|
||||||
account->sipPlugin()->checkSettings();
|
account->sipPlugin()->checkSettings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AccountManager::onStateChanged( Account::ConnectionState state )
|
AccountManager::onStateChanged( Account::ConnectionState state )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user