]> granicus.if.org Git - taglib/commitdiff
Avoid using String::isNull() where it is considered to be confused with isEmpty().
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 20 Nov 2015 11:59:13 +0000 (20:59 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 20 Nov 2015 11:59:13 +0000 (20:59 +0900)
taglib/ape/apetag.cpp
taglib/mod/modtag.cpp
taglib/mpeg/id3v2/frames/commentsframe.cpp
taglib/mpeg/id3v2/frames/synchronizedlyricsframe.cpp
taglib/mpeg/id3v2/frames/textidentificationframe.cpp
taglib/mpeg/id3v2/frames/unsynchronizedlyricsframe.cpp
taglib/mpeg/id3v2/frames/urllinkframe.cpp
taglib/tag.cpp
taglib/toolkit/tpropertymap.cpp

index c633d5754fd44962ea17d084618ff4777f95f49b..00e1bc779614792bb34ac7a74392ce81a0131a9a 100644 (file)
@@ -195,7 +195,7 @@ PropertyMap APE::Tag::properties() const
     String tagName = it->first.upper();
     // if the item is Binary or Locator, or if the key is an invalid string,
     // add to unsupportedData
-    if(it->second.type() != Item::Text || tagName.isNull())
+    if(it->second.type() != Item::Text || tagName.isEmpty())
       properties.unsupportedData().append(it->first);
     else {
       // Some tags need to be handled specially
@@ -232,7 +232,7 @@ PropertyMap APE::Tag::setProperties(const PropertyMap &origProps)
   for(; remIt != itemListMap().end(); ++remIt) {
     String key = remIt->first.upper();
     // only remove if a) key is valid, b) type is text, c) key not contained in new properties
-    if(!key.isNull() && remIt->second.type() == APE::Item::Text && !properties.contains(key))
+    if(!key.isEmpty() && remIt->second.type() == APE::Item::Text && !properties.contains(key))
       toRemove.append(remIt->first);
   }
 
index 4ba72117da8b88e8f7577473841bd41ce18090c5..4b180bbb6159b8f39190e91a6fe7b12872bd1979 100644 (file)
@@ -128,7 +128,7 @@ PropertyMap Mod::Tag::properties() const
   PropertyMap properties;
   properties["TITLE"] = d->title;
   properties["COMMENT"] = d->comment;
-  if(!(d->trackerName.isNull()))
+  if(!(d->trackerName.isEmpty()))
     properties["TRACKERNAME"] = d->trackerName;
   return properties;
 }
index deaa9d9a283190fa4dc8194139a2a6750acee1b0..b56183226c05f8a2be6ab12ff25772529e0fbcd4 100644 (file)
@@ -116,8 +116,6 @@ PropertyMap CommentsFrame::asProperties() const
   PropertyMap map;
   if(key.isEmpty() || key == "COMMENT")
     map.insert("COMMENT", text());
-  else if(key.isNull())
-    map.unsupportedData().append(L"COMM/" + description());
   else
     map.insert("COMMENT:" + key, text());
   return map;
@@ -164,7 +162,7 @@ void CommentsFrame::parseFields(const ByteVector &data)
     } else {
       d->description = String(l.front(), d->textEncoding);
       d->text = String(l.back(), d->textEncoding);
-    }  
+    }
   }
 }
 
index 86c11f7a42699532e746a0a953c4118dd5da813b..2ab464819b069db0c0262301268bc044054dfa8d 100644 (file)
@@ -159,7 +159,7 @@ void SynchronizedLyricsFrame::parseFields(const ByteVector &data)
   int pos = 6;
 
   d->description = readStringField(data, d->textEncoding, &pos);
-  if(d->description.isNull())
+  if(d->description.isEmpty())
     return;
 
   /*
@@ -190,7 +190,7 @@ void SynchronizedLyricsFrame::parseFields(const ByteVector &data)
       }
     }
     String text = readStringField(data, enc, &pos);
-    if(text.isNull() || pos + 4 > end)
+    if(text.isEmpty() || pos + 4 > end)
       return;
 
     uint time = data.toUInt(pos, true);
index 07bf0edea584e0b4ddb0cad3f69532ee6c6d96a0..7eacf9328c760094a989ff232b635dd5bda7cadf 100644 (file)
@@ -292,7 +292,7 @@ PropertyMap TextIdentificationFrame::makeTMCLProperties() const
   StringList l = fieldList();
   for(StringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
     String instrument = it->upper();
-    if(instrument.isNull()) {
+    if(instrument.isEmpty()) {
       // instrument is not a valid key -> frame unsupported
       map.clear();
       map.unsupportedData().append(frameID());
index 8f96cb8d0a97941880dd0f45ac4fae0e863de861..f97cdc5a4d548c514ee9fb411cff9ac2824dd499 100644 (file)
@@ -119,8 +119,6 @@ PropertyMap UnsynchronizedLyricsFrame::asProperties() const
   String key = description().upper();
   if(key.isEmpty() || key.upper() == "LYRICS")
     map.insert("LYRICS", text());
-  else if(key.isNull())
-    map.unsupportedData().append(L"USLT/" + description());
   else
     map.insert("LYRICS:" + key, text());
   return map;
@@ -164,7 +162,7 @@ void UnsynchronizedLyricsFrame::parseFields(const ByteVector &data)
     } else {
       d->description = String(l.front(), d->textEncoding);
       d->text = String(l.back(), d->textEncoding);
-    }  
+    }
   }
 }
 
index e42d64d177c5f06715a6b6622691044e70baaf82..e59a80dd115fdba177363e5786ed869da1c3f8cb 100644 (file)
@@ -159,8 +159,6 @@ PropertyMap UserUrlLinkFrame::asProperties() const
   String key = description().upper();
   if(key.isEmpty() || key.upper() == "URL")
     map.insert("URL", url());
-  else if(key.isNull())
-    map.unsupportedData().append(L"WXXX/" + description());
   else
     map.insert("URL:" + key, url());
   return map;
index eb8fab7a32b7d4fb8c5c56a9421327850a026f83..d13b248ff65b18ffc2718504200e03c3f3186d40 100644 (file)
@@ -58,15 +58,15 @@ bool Tag::isEmpty() const
 PropertyMap Tag::properties() const
 {
   PropertyMap map;
-  if(!(title().isNull()))
+  if(!(title().isEmpty()))
     map["TITLE"].append(title());
-  if(!(artist().isNull()))
+  if(!(artist().isEmpty()))
     map["ARTIST"].append(artist());
-  if(!(album().isNull()))
+  if(!(album().isEmpty()))
     map["ALBUM"].append(album());
-  if(!(comment().isNull()))
+  if(!(comment().isEmpty()))
     map["COMMENT"].append(comment());
-  if(!(genre().isNull()))
+  if(!(genre().isEmpty()))
     map["GENRE"].append(genre());
   if(!(year() == 0))
     map["DATE"].append(String::number(year()));
index 313d7fb43a609f41c571ef1a1d9bcf760e4bd3d8..2c69641761fa946b96b0bd70398b163198b1ca8b 100644 (file)
@@ -35,7 +35,7 @@ PropertyMap::PropertyMap(const SimplePropertyMap &m)
 {
   for(SimplePropertyMap::ConstIterator it = m.begin(); it != m.end(); ++it){
     String key = it->first.upper();
-    if(!key.isNull())
+    if(!key.isEmpty())
       insert(it->first, it->second);
     else
       unsupported.append(it->first);