Commit 21f8bdbf authored by Urs Fleisch's avatar Urs Fleisch
Browse files

do not set picture frames for tag formats not supporting it

parent ab4fb7bd
......@@ -652,6 +652,9 @@ QString OggFile::getTagFormatV2() const
*/
bool OggFile::setFrameV2(const Frame& frame)
{
if (frame.getType() == Frame::FT_Picture) {
return false;
}
if (frame.getType() == Frame::FT_Track) {
int numTracks = getTotalNumberOfTracksIfEnabled();
if (numTracks > 0) {
......@@ -698,6 +701,9 @@ bool OggFile::setFrameV2(const Frame& frame)
*/
bool OggFile::addFrameV2(Frame& frame)
{
if (frame.getType() == Frame::FT_Picture) {
return false;
}
// Add a new frame.
QString name(getVorbisName(frame));
m_comments.push_back(OggFile::CommentField(name, frame.getValue()));
......
......@@ -2470,6 +2470,9 @@ bool TagLibFile::setFrameV2(const Frame& frame)
return true;
}
} else if ((oggTag = dynamic_cast<TagLib::Ogg::XiphComment*>(m_tagV2)) != 0) {
if (frame.getType() == Frame::FT_Picture) {
return false;
}
TagLib::String key = QSTRING_TO_TSTRING(getVorbisName(frame));
TagLib::String value = QSTRING_TO_TSTRING(frame.getValue());
#if TAGLIB_VERSION <= 0x010400
......@@ -2509,6 +2512,9 @@ bool TagLibFile::setFrameV2(const Frame& frame)
markTag2Changed();
return true;
} else if ((apeTag = dynamic_cast<TagLib::APE::Tag*>(m_tagV2)) != 0) {
if (frame.getType() == Frame::FT_Picture) {
return false;
}
apeTag->addValue(QSTRING_TO_TSTRING(getApeName(frame)),
QSTRING_TO_TSTRING(frame.getValue()));
markTag2Changed();
......@@ -2636,6 +2642,9 @@ bool TagLibFile::addFrameV2(Frame& frame)
return true;
}
} else if ((oggTag = dynamic_cast<TagLib::Ogg::XiphComment*>(m_tagV2)) != 0) {
if (frame.getType() == Frame::FT_Picture) {
return false;
}
QString name(getVorbisName(frame));
TagLib::String tname = QSTRING_TO_TSTRING(name);
TagLib::String tvalue = QSTRING_TO_TSTRING(frame.getValue());
......@@ -2666,6 +2675,9 @@ bool TagLibFile::addFrameV2(Frame& frame)
markTag2Changed();
return true;
} else if ((apeTag = dynamic_cast<TagLib::APE::Tag*>(m_tagV2)) != 0) {
if (frame.getType() == Frame::FT_Picture) {
return false;
}
QString name(getApeName(frame));
TagLib::String tname = QSTRING_TO_TSTRING(name);
TagLib::String tvalue = QSTRING_TO_TSTRING(frame.getValue());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment