]> granicus.if.org Git - taglib/commitdiff
Preserve source code backward compatibility
authorStephen F. Booth <me@sbooth.org>
Tue, 10 Apr 2012 22:06:58 +0000 (18:06 -0400)
committerStephen F. Booth <me@sbooth.org>
Tue, 10 Apr 2012 22:06:58 +0000 (18:06 -0400)
taglib/ape/apeitem.cpp
taglib/ape/apeitem.h
taglib/ape/apetag.cpp

index 52e0f064da1d472ad83acd02d3cb14528c21e399..1e60bc52f8b4b0d7121bc29216fb0a4154dee45b 100644 (file)
@@ -62,12 +62,16 @@ APE::Item::Item(const String &key, const StringList &values)
   d->text = values;
 }
 
-APE::Item::Item(const String &key, const ByteVector &value)
+APE::Item::Item(const String &key, const ByteVector &value, bool binary)
 {
   d = new ItemPrivate;
-  d->type = Binary;
   d->key = key;
-  d->value = value;
+  if(binary) {
+    d->type = Binary;
+    d->value = value;
+  }
+  else
+         d->text.append(value);          
 }
 
 APE::Item::Item(const Item &item)
index a42801702a24c74b6cc100b84202154ff84128f7..f7fd05e3cbe2e96d70ac060ac95f2f8c0b95431c 100644 (file)
@@ -70,9 +70,10 @@ namespace TagLib {
       Item(const String &key, const StringList &values);
 
       /*!
-       * Constructs a binary item with \a key and \a value.
+       * Constructs an item with \a key and \a value.
+       * If \a binary is true a Binary item will be created, otherwise \a value will be interpreted as text
        */
-      Item(const String &key, const ByteVector &value);
+      Item(const String &key, const ByteVector &value, bool binary);
 
       /*!
        * Construct an item as a copy of \a item.
index e925235ef2515c1aa27b116380118010f114e99a..0676c9b62b53cc12dc9d59a4fe241cffb7f3f10c 100644 (file)
@@ -294,7 +294,7 @@ void APE::Tag::setData(const String &key, const ByteVector &value)
 {
   removeItem(key);
   if(!key.isEmpty() && !value.isEmpty())
-    setItem(key, Item(key, value));
+    setItem(key, Item(key, value, true));
 }
 
 void APE::Tag::setItem(const String &key, const Item &item)