1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-02-27 05:12:34 +01:00

Ensure we have a string to show if a Tp account name is empty.

This commit is contained in:
Teo Mrnjavac 2013-06-29 12:39:07 +02:00
parent b08ba3fe40
commit 484b7ccb88

View File

@ -236,7 +236,13 @@ Tomahawk::Accounts::TelepathyConfigStorage::load( const QString& accountId, Acco
Tp::AccountPtr account = m_tpam->accountForObjectPath( accountIdToTelepathyPath( accountId ) );
cfg.accountFriendlyName = "Tp:" + account->normalizedName();
if ( !account->normalizedName().isEmpty() )
cfg.accountFriendlyName = account->normalizedName();
else if ( !account->parameters()[ "account" ].isNull() )
cfg.accountFriendlyName = account->parameters()[ "account" ].toString();
if ( cfg.accountFriendlyName.isEmpty() ) //this should never happen
cfg.accountFriendlyName = accountId;
cfg.enabled = true;
cfg.acl = QVariantMap();