preferring a comment without an empty description.
FEATURE:137553
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@768865
283d02a7-25f6-0310-bc7c-
ecb5cbfe19da
String ID3v2::Tag::comment() const
{
- if(!d->frameListMap["COMM"].isEmpty())
- return d->frameListMap["COMM"].front()->toString();
- return String::null;
+ const FrameList &comments = d->frameListMap["COMM"];
+
+ if(comments.isEmpty())
+ return String::null;
+
+ for(FrameList::ConstIterator it = comments.begin(); it != comments.end(); ++it)
+ {
+ if(static_cast<CommentsFrame *>(*it)->description().isEmpty())
+ return (*it)->toString();
+ }
+
+ return comments.front()->toString();
}
String ID3v2::Tag::genre() const