Only show sub-text if we have some info
This commit is contained in:
committed by
Craig Drummond
parent
85db2b6a55
commit
7aaab192d6
@@ -487,7 +487,9 @@ QVariant PlaylistsModel::data(const QModelIndex &index, int role) const
|
||||
case Cantata::Role_MainText:
|
||||
return s->title.isEmpty() ? s->file : s->title;
|
||||
case Cantata::Role_SubText:
|
||||
return s->artist+QLatin1String(" - ")+s->displayAlbum()+QLatin1String(" - ")+Utils::formatTime(s->time);
|
||||
return (s->artist.isEmpty() ? QString() : (s->artist+QLatin1String(" - ")))+
|
||||
(s->displayAlbum().isEmpty() ? QString() : (s->displayAlbum()+QLatin1String(" - ")))+
|
||||
(s->time>0 ? Utils::formatTime(s->time) : QString());
|
||||
default:
|
||||
return ActionModel::data(index, role);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user