If there is no value set for DESCRIPTION, also check COMMENT.

BUG:98714


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@437379 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2005-07-21 17:30:03 +00:00
parent a2972c8ae0
commit ca839d884f

View File

@ -31,6 +31,7 @@ class Ogg::XiphComment::XiphCommentPrivate
public:
FieldListMap fieldListMap;
String vendorID;
String commentField;
};
////////////////////////////////////////////////////////////////////////////////
@ -76,9 +77,17 @@ String Ogg::XiphComment::album() const
String Ogg::XiphComment::comment() const
{
if(d->fieldListMap["DESCRIPTION"].isEmpty())
return String::null;
return d->fieldListMap["DESCRIPTION"].front();
if(!d->fieldListMap["DESCRIPTION"].isEmpty()) {
d->commentField = "DESCRIPTION";
return d->fieldListMap["DESCRIPTION"].front();
}
if(!d->fieldListMap["COMMENT"].isEmpty()) {
d->commentField = "COMMENT";
return d->fieldListMap["COMMENT"].front();
}
return String::null;
}
String Ogg::XiphComment::genre() const
@ -119,7 +128,7 @@ void Ogg::XiphComment::setAlbum(const String &s)
void Ogg::XiphComment::setComment(const String &s)
{
addField("DESCRIPTION", s);
addField(d->commentField.isEmpty() ? "DESCRIPTION" : d->commentField, s);
}
void Ogg::XiphComment::setGenre(const String &s)