mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
Fixed --demo argument, stripping domains of usernames for demo purposes.
This commit is contained in:
@@ -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
|
QString
|
||||||
Source::friendlyName() const
|
Source::friendlyName() const
|
||||||
{
|
{
|
||||||
@@ -210,15 +227,15 @@ Source::friendlyName() const
|
|||||||
if ( candidateNames.count() > 1 )
|
if ( candidateNames.count() > 1 )
|
||||||
qSort( candidateNames.begin(), candidateNames.end(), &Source::friendlyNamesLessThan );
|
qSort( candidateNames.begin(), candidateNames.end(), &Source::friendlyNamesLessThan );
|
||||||
|
|
||||||
return candidateNames.first();
|
return prettyName( candidateNames.first() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( d->friendlyname.isEmpty() )
|
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;
|
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 );
|
Q_D( const Source );
|
||||||
|
|
||||||
if( d->dbFriendlyName.isEmpty() )
|
if ( d->dbFriendlyName.isEmpty() )
|
||||||
{
|
{
|
||||||
return nodeId();
|
return nodeId();
|
||||||
}
|
}
|
||||||
|
@@ -155,6 +155,7 @@ private:
|
|||||||
SourcePrivate* d_ptr;
|
SourcePrivate* d_ptr;
|
||||||
|
|
||||||
static bool friendlyNamesLessThan( const QString& first, const QString& second ); //lessThan for sorting
|
static bool friendlyNamesLessThan( const QString& first, const QString& second ); //lessThan for sorting
|
||||||
|
QString prettyName( const QString& name ) const;
|
||||||
|
|
||||||
void updateTracks();
|
void updateTracks();
|
||||||
void reportSocialAttributesChanged( DatabaseCommand_SocialAction* action );
|
void reportSocialAttributesChanged( DatabaseCommand_SocialAction* action );
|
||||||
|
Reference in New Issue
Block a user