From ca839d884f7159d033de86328fce7b3ee0fbd6d8 Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Thu, 21 Jul 2005 17:30:03 +0000 Subject: [PATCH] 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 --- ogg/xiphcomment.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ogg/xiphcomment.cpp b/ogg/xiphcomment.cpp index 62c45ec4..e1fe67af 100644 --- a/ogg/xiphcomment.cpp +++ b/ogg/xiphcomment.cpp @@ -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)