mirror of
https://github.com/taglib/taglib.git
synced 2025-06-03 09:08:09 -04:00
Make sure that there's always a description and content even if they're empty.
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@572797 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
2f1645947a
commit
8e52873513
@ -165,7 +165,7 @@ UserTextIdentificationFrame::UserTextIdentificationFrame(String::Type encoding)
|
||||
UserTextIdentificationFrame::UserTextIdentificationFrame(const ByteVector &data) :
|
||||
TextIdentificationFrame(data)
|
||||
{
|
||||
|
||||
checkFields();
|
||||
}
|
||||
|
||||
String UserTextIdentificationFrame::toString() const
|
||||
@ -182,14 +182,9 @@ String UserTextIdentificationFrame::description() const
|
||||
|
||||
StringList UserTextIdentificationFrame::fieldList() const
|
||||
{
|
||||
StringList l = TextIdentificationFrame::fieldList();
|
||||
// TODO: remove this function
|
||||
|
||||
if(!l.isEmpty()) {
|
||||
StringList::Iterator it = l.begin();
|
||||
l.erase(it);
|
||||
}
|
||||
|
||||
return l;
|
||||
return TextIdentificationFrame::fieldList();
|
||||
}
|
||||
|
||||
void UserTextIdentificationFrame::setText(const String &text)
|
||||
@ -238,5 +233,15 @@ UserTextIdentificationFrame *UserTextIdentificationFrame::find(ID3v2::Tag *tag,
|
||||
UserTextIdentificationFrame::UserTextIdentificationFrame(const ByteVector &data, Header *h) :
|
||||
TextIdentificationFrame(data, h)
|
||||
{
|
||||
|
||||
checkFields();
|
||||
}
|
||||
|
||||
void UserTextIdentificationFrame::checkFields()
|
||||
{
|
||||
int fields = fieldList().size();
|
||||
|
||||
if(fields == 0)
|
||||
setDescription(String::null);
|
||||
if(fields <= 1)
|
||||
setText(String::null);
|
||||
}
|
||||
|
@ -232,6 +232,8 @@ namespace TagLib {
|
||||
UserTextIdentificationFrame(const TextIdentificationFrame &);
|
||||
UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &);
|
||||
|
||||
void checkFields();
|
||||
|
||||
class UserTextIdentificationFramePrivate;
|
||||
UserTextIdentificationFramePrivate *d;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user