]> granicus.if.org Git - taglib/commitdiff
If there is no value set for DESCRIPTION, also check COMMENT.
authorScott Wheeler <wheeler@kde.org>
Thu, 21 Jul 2005 17:30:03 +0000 (17:30 +0000)
committerScott Wheeler <wheeler@kde.org>
Thu, 21 Jul 2005 17:30:03 +0000 (17:30 +0000)
BUG:98714

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@437379 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

ogg/xiphcomment.cpp

index 62c45ec41a7312a9e13107865ec8dec9ee88979c..e1fe67afc42e4f2009477612d90eca12fafe6dab 100644 (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)