Order genres, so that comparison works

This commit is contained in:
craig.p.drummond
2014-06-17 16:53:17 +00:00
committed by craig.p.drummond
parent 84f6548263
commit 63c45d3640
3 changed files with 11 additions and 0 deletions

View File

@@ -318,6 +318,7 @@ Song MPDParseUtils::parseSong(const QList<QByteArray> &lines, Location location)
if (Loc_Library==location) {
song.guessTags();
song.fillEmptyFields();
song.orderGenres();
} else if (Loc_Streams==location) {
song.setName(getAndRemoveStreamName(song.file));
} else {

View File

@@ -418,6 +418,15 @@ QStringList Song::genres() const
return genre.split(constGenreSep, QString::SkipEmptyParts);
}
void Song::orderGenres()
{
QStringList g=genres();
if (g.count()>1) {
qSort(g);
genre=g.join(QString()+constGenreSep);
}
}
QString Song::entryName() const
{
if (title.isEmpty()) {

View File

@@ -117,6 +117,7 @@ struct Song
virtual void clear();
void addGenre(const QString &g);
QStringList genres() const;
void orderGenres();
QString entryName() const;
QString artistOrComposer() const;
QString albumName() const;