Avoid using String::isNull() where it is considered to be confused with isEmpty().

This commit is contained in:
Tsuda Kageyu
2015-11-20 20:59:13 +09:00
parent 224f133d65
commit c4fe65787c
9 changed files with 14 additions and 20 deletions

View 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);
}
}
}
}

View 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);

View 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());

View 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);
}
}
}
}

View 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;