mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
Use virtual method for factory name
This commit is contained in:
parent
970b3e79a9
commit
2d1a036b3d
@ -456,7 +456,7 @@ AtticaManager::payloadFetched()
|
||||
if ( reply->property( "createAccount" ).toBool() )
|
||||
{
|
||||
// Do the install / add to tomahawk
|
||||
Tomahawk::Accounts::Account* resolver = Tomahawk::Accounts::ResolverAccountFactory::createFromPath( resolverPath, true );
|
||||
Tomahawk::Accounts::Account* resolver = Tomahawk::Accounts::ResolverAccountFactory::createFromPath( resolverPath, "resolveraccount", true );
|
||||
Tomahawk::Accounts::AccountManager::instance()->addAccount( resolver );
|
||||
TomahawkSettings::instance()->addAccount( resolver->accountId() );
|
||||
}
|
||||
|
@ -182,8 +182,8 @@ public:
|
||||
virtual Account* createAccount( const QString& accountId = QString() ) = 0;
|
||||
|
||||
/// If this resolver type accepts this path on disk (For general and special resolver accounts)
|
||||
virtual bool acceptsPath( const QString& path ) const { return false; }
|
||||
virtual Account* createFromPath( const QString& path ) { return 0; }
|
||||
virtual bool acceptsPath( const QString& ) const { return false; }
|
||||
virtual Account* createFromPath( const QString& ) { return 0; }
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -597,7 +597,6 @@ void
|
||||
AccountModel::accountStateChanged( Account* account , Account::ConnectionState )
|
||||
{
|
||||
// Find the factory this belongs up, and update
|
||||
AccountFactory* factory = AccountManager::instance()->factoryForAccount( account );
|
||||
for ( int i = 0; i < m_accounts.size(); i++ )
|
||||
{
|
||||
AccountModelNode* n = m_accounts.at( i );
|
||||
|
@ -118,6 +118,7 @@ struct AccountModelNode {
|
||||
{
|
||||
init();
|
||||
resolverAccount = ra;
|
||||
factory = AccountManager::instance()->factoryForAccount( ra );
|
||||
}
|
||||
|
||||
explicit AccountModelNode( Account* account ) : type( CustomAccountType )
|
||||
|
@ -48,21 +48,21 @@ ResolverAccountFactory::createAccount( const QString& accountId )
|
||||
Account*
|
||||
ResolverAccountFactory::createFromPath( const QString& path )
|
||||
{
|
||||
return createFromPath( path, false );
|
||||
return createFromPath( path, factoryId(), false );
|
||||
}
|
||||
|
||||
|
||||
Account*
|
||||
ResolverAccountFactory::createFromPath( const QString& path, bool isAttica )
|
||||
ResolverAccountFactory::createFromPath( const QString& path, const QString& factory, bool isAttica )
|
||||
{
|
||||
qDebug() << "Creating ResolverAccount from path:" << path << "is attica" << isAttica;
|
||||
if ( isAttica )
|
||||
{
|
||||
QFileInfo info( path );
|
||||
return new AtticaResolverAccount( generateId( "resolveraccount" ), path, info.baseName() );
|
||||
return new AtticaResolverAccount( generateId( factory ), path, info.baseName() );
|
||||
}
|
||||
else
|
||||
return new ResolverAccount( generateId( "resolveraccount" ), path );
|
||||
return new ResolverAccount( generateId( factory ), path );
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
virtual Account* createFromPath( const QString& path );
|
||||
|
||||
// Internal use
|
||||
static Account* createFromPath( const QString& path, bool isAttica );
|
||||
static Account* createFromPath( const QString& path, const QString& factoryId, bool isAttica );
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,7 @@ SpotifyAccountFactory::acceptsPath( const QString& path ) const
|
||||
Account*
|
||||
SpotifyAccountFactory::createFromPath( const QString& path )
|
||||
{
|
||||
return new SpotifyAccount( generateId( "spotifyaccount" ), path );
|
||||
return new SpotifyAccount( generateId( factoryId() ), path );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user