mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-19 07:19:42 +01:00
Fixed --demo argument, stripping domains of usernames for demo purposes.
This commit is contained in:
parent
8f28228061
commit
6b7a9e274b
@ -191,6 +191,23 @@ Source::nodeId() const
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Source::prettyName( const QString& name ) const
|
||||
{
|
||||
Q_D( const Source );
|
||||
|
||||
if ( d->scrubFriendlyName )
|
||||
{
|
||||
if ( name.indexOf( "@" ) > 0 )
|
||||
{
|
||||
return name.split( "@" ).first();
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
Source::friendlyName() const
|
||||
{
|
||||
@ -210,15 +227,15 @@ Source::friendlyName() const
|
||||
if ( candidateNames.count() > 1 )
|
||||
qSort( candidateNames.begin(), candidateNames.end(), &Source::friendlyNamesLessThan );
|
||||
|
||||
return candidateNames.first();
|
||||
return prettyName( candidateNames.first() );
|
||||
}
|
||||
|
||||
if ( d->friendlyname.isEmpty() )
|
||||
{
|
||||
return dbFriendlyName();
|
||||
return prettyName( dbFriendlyName() );
|
||||
}
|
||||
|
||||
return d->friendlyname;
|
||||
return prettyName( d->friendlyname );
|
||||
}
|
||||
|
||||
|
||||
@ -347,13 +364,6 @@ Source::setFriendlyName( const QString& fname )
|
||||
}
|
||||
|
||||
d->friendlyname = fname;
|
||||
if ( d->scrubFriendlyName )
|
||||
{
|
||||
if ( d->friendlyname.indexOf( "@" ) > 0 )
|
||||
{
|
||||
d->friendlyname = d->friendlyname.split( "@" ).first();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -362,7 +372,7 @@ Source::dbFriendlyName() const
|
||||
{
|
||||
Q_D( const Source );
|
||||
|
||||
if( d->dbFriendlyName.isEmpty() )
|
||||
if ( d->dbFriendlyName.isEmpty() )
|
||||
{
|
||||
return nodeId();
|
||||
}
|
||||
|
@ -155,6 +155,7 @@ private:
|
||||
SourcePrivate* d_ptr;
|
||||
|
||||
static bool friendlyNamesLessThan( const QString& first, const QString& second ); //lessThan for sorting
|
||||
QString prettyName( const QString& name ) const;
|
||||
|
||||
void updateTracks();
|
||||
void reportSocialAttributesChanged( DatabaseCommand_SocialAction* action );
|
||||
|
Loading…
x
Reference in New Issue
Block a user