Commit 138606b3 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

More efficient conversion between Qt and TagLib strings.

parent 19acac2e
......@@ -31,6 +31,7 @@
#include <QByteArray>
#include <QImage>
#include <QCoreApplication>
#include <QVarLengthArray>
#include "genres.h"
#include "attributedata.h"
#include "pictureframe.h"
......@@ -125,6 +126,27 @@
namespace {
/** Convert QString @a s to a TagLib::String. */
TagLib::String toTString(const QString& s)
{
int len = s.length();
QVarLengthArray<wchar_t> a(len + 1);
wchar_t* ws = a.data();
len = s.toWCharArray(ws);
ws[len] = 0;
return TagLib::String(ws);
}
/** Convert TagLib::String @a s to a QString. */
inline QString toQString(const TagLib::String& s)
{
#if TAGLIB_VERSION >= 0x010900
return QString::fromWCharArray(s.toCWString(), s.size());
#else
return TStringToQString(s);
#endif
}
#if TAGLIB_VERSION >= 0x010700
/**
* Set a picture frame from a FLAC picture.
......@@ -140,9 +162,9 @@ void flacPictureToFrame(const TagLib::FLAC::Picture* pic, Frame& frame)
pic->width(), pic->height(), pic->colorDepth(),
pic->numColors(), ba);
PictureFrame::setFields(
frame, Frame::TE_ISO8859_1, QLatin1String("JPG"), TStringToQString(pic->mimeType()),
frame, Frame::TE_ISO8859_1, QLatin1String("JPG"), toQString(pic->mimeType()),
static_cast<PictureFrame::PictureType>(pic->type()),
TStringToQString(pic->description()),
toQString(pic->description()),
ba, &imgProps);
}
......@@ -164,8 +186,8 @@ void frameToFlacPicture(const Frame& frame, TagLib::FLAC::Picture* pic)
PictureFrame::getFields(frame, enc, imgFormat, mimeType, pictureType,
description, data, &imgProps);
pic->setType(static_cast<TagLib::FLAC::Picture::Type>(pictureType));
pic->setMimeType(QSTRING_TO_TSTRING(mimeType));
pic->setDescription(QSTRING_TO_TSTRING(description));
pic->setMimeType(toTString(mimeType));
pic->setDescription(toTString(description));
pic->setData(TagLib::ByteVector(data.data(), data.size()));
if (!imgProps.isValidForImage(data)) {
imgProps = PictureFrame::ImageProperties(data);
......@@ -562,7 +584,7 @@ const QTextCodec* TextCodecStringHandler::s_codec = 0;
TagLib::String TextCodecStringHandler::parse(const TagLib::ByteVector& data) const
{
return s_codec ?
QSTRING_TO_TSTRING(s_codec->toUnicode(data.data(), data.size())).stripWhiteSpace() :
toTString(s_codec->toUnicode(data.data(), data.size())).stripWhiteSpace() :
TagLib::String(data, TagLib::String::Latin1).stripWhiteSpace();
}
......@@ -574,7 +596,7 @@ TagLib::String TextCodecStringHandler::parse(const TagLib::ByteVector& data) con
TagLib::ByteVector TextCodecStringHandler::render(const TagLib::String& s) const
{
if (s_codec) {
QByteArray ba(s_codec->fromUnicode(TStringToQString(s)));
QByteArray ba(s_codec->fromUnicode(toQString(s)));
return TagLib::ByteVector(ba.data(), ba.size());
} else {
return s.data(TagLib::String::Latin1);
......@@ -1182,7 +1204,7 @@ QString TagLibFile::getTitleV1() const
makeFileOpen();
if (m_tagV1) {
TagLib::String str = m_tagV1->title();
return str.isNull() ? QLatin1String("") : TStringToQString(str);
return str.isNull() ? QLatin1String("") : toQString(str);
} else {
return QString();
}
......@@ -1200,7 +1222,7 @@ QString TagLibFile::getArtistV1() const
makeFileOpen();
if (m_tagV1) {
TagLib::String str = m_tagV1->artist();
return str.isNull() ? QLatin1String("") : TStringToQString(str);
return str.isNull() ? QLatin1String("") : toQString(str);
} else {
return QString();
}
......@@ -1218,7 +1240,7 @@ QString TagLibFile::getAlbumV1() const
makeFileOpen();
if (m_tagV1) {
TagLib::String str = m_tagV1->album();
return str.isNull() ? QLatin1String("") : TStringToQString(str);
return str.isNull() ? QLatin1String("") : toQString(str);
} else {
return QString();
}
......@@ -1239,7 +1261,7 @@ QString TagLibFile::getCommentV1() const
if (str.isNull()) {
return QLatin1String("");
} else {
QString qstr(TStringToQString(str));
QString qstr(toQString(str));
qstr.truncate(28);
return qstr;
}
......@@ -1294,7 +1316,7 @@ QString TagLibFile::getGenreV1() const
makeFileOpen();
if (m_tagV1) {
TagLib::String str = m_tagV1->genre();
return str.isNull() ? QLatin1String("") : TStringToQString(str);
return str.isNull() ? QLatin1String("") : toQString(str);
} else {
return QString();
}
......@@ -1312,7 +1334,7 @@ QString TagLibFile::getTitleV2() const
makeFileOpen();
if (m_tagV2) {
TagLib::String str = m_tagV2->title();
return str.isNull() ? QLatin1String("") : TStringToQString(str);
return str.isNull() ? QLatin1String("") : toQString(str);
} else {
return QString();
}
......@@ -1330,7 +1352,7 @@ QString TagLibFile::getArtistV2() const
makeFileOpen();
if (m_tagV2) {
TagLib::String str = m_tagV2->artist();
return str.isNull() ? QLatin1String("") : TStringToQString(str);
return str.isNull() ? QLatin1String("") : toQString(str);
} else {
return QString();
}
......@@ -1348,7 +1370,7 @@ QString TagLibFile::getAlbumV2() const
makeFileOpen();
if (m_tagV2) {
TagLib::String str = m_tagV2->album();
return str.isNull() ? QLatin1String("") : TStringToQString(str);
return str.isNull() ? QLatin1String("") : toQString(str);
} else {
return QString();
}
......@@ -1366,7 +1388,7 @@ QString TagLibFile::getCommentV2() const
makeFileOpen();
if (m_tagV2) {
TagLib::String str = m_tagV2->comment();
return str.isNull() ? QLatin1String("") : TStringToQString(str);
return str.isNull() ? QLatin1String("") : toQString(str);
} else {
return QString();
}
......@@ -1421,7 +1443,7 @@ QString TagLibFile::getTrackV2() const
static QString getGenreString(const TagLib::String& str)
{
if (!str.isNull()) {
QString qs = TStringToQString(str);
QString qs = toQString(str);
int cpPos = 0, n = 0xff;
bool ok = false;
if (qs[0] == QLatin1Char('(') && (cpPos = qs.indexOf(QLatin1Char(')'), 2)) > 1) {
......@@ -1548,11 +1570,11 @@ void TagLibFile::setTitleV1(const QString& str)
{
if (makeTagV1Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV1->title())) {
QString s = checkTruncation(str, 1ULL << Frame::FT_Title);
if (!s.isNull())
m_tagV1->setTitle(QSTRING_TO_TSTRING(s));
m_tagV1->setTitle(toTString(s));
else
m_tagV1->setTitle(tstr);
markTag1Changed(Frame::FT_Title);
......@@ -1569,11 +1591,11 @@ void TagLibFile::setArtistV1(const QString& str)
{
if (makeTagV1Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV1->artist())) {
QString s = checkTruncation(str, 1ULL << Frame::FT_Artist);
if (!s.isNull())
m_tagV1->setArtist(QSTRING_TO_TSTRING(s));
m_tagV1->setArtist(toTString(s));
else
m_tagV1->setArtist(tstr);
markTag1Changed(Frame::FT_Artist);
......@@ -1590,11 +1612,11 @@ void TagLibFile::setAlbumV1(const QString& str)
{
if (makeTagV1Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV1->album())) {
QString s = checkTruncation(str, 1ULL << Frame::FT_Album);
if (!s.isNull())
m_tagV1->setAlbum(QSTRING_TO_TSTRING(s));
m_tagV1->setAlbum(toTString(s));
else
m_tagV1->setAlbum(tstr);
markTag1Changed(Frame::FT_Album);
......@@ -1611,11 +1633,11 @@ void TagLibFile::setCommentV1(const QString& str)
{
if (makeTagV1Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV1->comment())) {
QString s = checkTruncation(str, 1ULL << Frame::FT_Comment, 28);
if (!s.isNull())
m_tagV1->setComment(QSTRING_TO_TSTRING(s));
m_tagV1->setComment(toTString(s));
else
m_tagV1->setComment(tstr);
markTag1Changed(Frame::FT_Comment);
......@@ -1666,7 +1688,7 @@ void TagLibFile::setGenreV1(const QString& str)
{
if (makeTagV1Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV1->genre())) {
m_tagV1->setGenre(tstr);
markTag1Changed(Frame::FT_Genre);
......@@ -1795,7 +1817,7 @@ void TagLibFile::setTitleV2(const QString& str)
{
if (makeTagV2Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV2->title())) {
if (!setId3v2Unicode(m_tagV2, str, tstr, "TIT2")) {
m_tagV2->setTitle(tstr);
......@@ -1814,7 +1836,7 @@ void TagLibFile::setArtistV2(const QString& str)
{
if (makeTagV2Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV2->artist())) {
if (!setId3v2Unicode(m_tagV2, str, tstr, "TPE1")) {
m_tagV2->setArtist(tstr);
......@@ -1833,7 +1855,7 @@ void TagLibFile::setAlbumV2(const QString& str)
{
if (makeTagV2Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV2->album())) {
if (!setId3v2Unicode(m_tagV2, str, tstr, "TALB")) {
m_tagV2->setAlbum(tstr);
......@@ -1852,7 +1874,7 @@ void TagLibFile::setCommentV2(const QString& str)
{
if (makeTagV2Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV2->comment())) {
if (!setId3v2Unicode(m_tagV2, str, tstr, "COMM")) {
m_tagV2->setComment(tstr);
......@@ -1881,7 +1903,7 @@ void TagLibFile::setYearV2(int num)
str = QLatin1String("");
}
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!setId3v2Unicode(m_tagV2, str, tstr, "TDRC")) {
m_tagV2->setYear(num);
}
......@@ -1909,7 +1931,7 @@ void TagLibFile::setTrackV2(const QString& track)
#endif
if (id3v2Tag) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!setId3v2Unicode(m_tagV2, str, tstr, "TRCK")) {
TagLib::ID3v2::TextIdentificationFrame* frame =
new TagLib::ID3v2::TextIdentificationFrame(
......@@ -1951,7 +1973,7 @@ void TagLibFile::setGenreV2(const QString& str)
{
if (makeTagV2Settable() && !str.isNull()) {
TagLib::String tstr = str.isEmpty() ?
TagLib::String::null : QSTRING_TO_TSTRING(str);
TagLib::String::null : toTString(str);
if (!(tstr == m_tagV2->genre())) {
if (!setId3v2Unicode(m_tagV2, str, tstr, "TCON")) {
TagLib::ID3v2::TextIdentificationFrame* frame;
......@@ -2214,7 +2236,7 @@ void TagLibFile::readAudioProperties()
{
QString trackerName;
if (TagLib::Mod::Tag* modTag = dynamic_cast<TagLib::Mod::Tag*>(m_tagV2)) {
trackerName = TStringToQString(modTag->trackerName()).trimmed();
trackerName = toQString(modTag->trackerName()).trimmed();
}
return trackerName;
}
......@@ -2510,15 +2532,15 @@ static QString getFieldsFromTextFrame(
dynamic_cast<const TagLib::ID3v2::UserTextIdentificationFrame*>(tFrame))
!= 0) {
field.m_id = Frame::ID_Description;
field.m_value = TStringToQString(txxxFrame->description());
field.m_value = toQString(txxxFrame->description());
fields.push_back(field);
TagLib::StringList slText = tFrame->fieldList();
text = slText.size() > 1 ? TStringToQString(slText[1]) : QLatin1String("");
text = slText.size() > 1 ? toQString(slText[1]) : QLatin1String("");
} else {
// if there are multiple items, put them into one string
// separated by a special separator.
text = TStringToQString(tFrame->fieldList().toString(Frame::stringListSeparator().toLatin1()));
text = toQString(tFrame->fieldList().toString(Frame::stringListSeparator().toLatin1()));
}
field.m_id = Frame::ID_Text;
if (type == Frame::FT_Genre) {
......@@ -2554,7 +2576,7 @@ static QString getFieldsFromApicFrame(
fields.push_back(field);
field.m_id = Frame::ID_MimeType;
field.m_value = TStringToQString(apicFrame->mimeType());
field.m_value = toQString(apicFrame->mimeType());
fields.push_back(field);
field.m_id = Frame::ID_PictureType;
......@@ -2562,7 +2584,7 @@ static QString getFieldsFromApicFrame(
fields.push_back(field);
field.m_id = Frame::ID_Description;
text = TStringToQString(apicFrame->description());
text = toQString(apicFrame->description());
field.m_value = text;
fields.push_back(field);
......@@ -2599,11 +2621,11 @@ static QString getFieldsFromCommFrame(
fields.push_back(field);
field.m_id = Frame::ID_Description;
field.m_value = TStringToQString(commFrame->description());
field.m_value = toQString(commFrame->description());
fields.push_back(field);
field.m_id = Frame::ID_Text;
text = TStringToQString(commFrame->toString());
text = toQString(commFrame->toString());
field.m_value = text;
fields.push_back(field);
......@@ -2624,7 +2646,7 @@ static QString getFieldsFromUfidFrame(
{
Frame::Field field;
field.m_id = Frame::ID_Owner;
field.m_value = TStringToQString(ufidFrame->owner());
field.m_value = toQString(ufidFrame->owner());
fields.push_back(field);
field.m_id = Frame::ID_Id;
......@@ -2663,15 +2685,15 @@ static QString getFieldsFromGeobFrame(
fields.push_back(field);
field.m_id = Frame::ID_MimeType;
field.m_value = TStringToQString(geobFrame->mimeType());
field.m_value = toQString(geobFrame->mimeType());
fields.push_back(field);
field.m_id = Frame::ID_Filename;
field.m_value = TStringToQString(geobFrame->fileName());
field.m_value = toQString(geobFrame->fileName());
fields.push_back(field);
field.m_id = Frame::ID_Description;
text = TStringToQString(geobFrame->description());
text = toQString(geobFrame->description());
field.m_value = text;
fields.push_back(field);
......@@ -2699,7 +2721,7 @@ static QString getFieldsFromUrlFrame(
QString text;
Frame::Field field;
field.m_id = Frame::ID_Url;
text = TStringToQString(wFrame->url());
text = toQString(wFrame->url());
field.m_value = text;
fields.push_back(field);
......@@ -2724,11 +2746,11 @@ static QString getFieldsFromUserUrlFrame(
fields.push_back(field);
field.m_id = Frame::ID_Description;
field.m_value = TStringToQString(wxxxFrame->description());
field.m_value = toQString(wxxxFrame->description());
fields.push_back(field);
field.m_id = Frame::ID_Url;
text = TStringToQString(wxxxFrame->url());
text = toQString(wxxxFrame->url());
field.m_value = text;
fields.push_back(field);
......@@ -2760,11 +2782,11 @@ static QString getFieldsFromUsltFrame(
fields.push_back(field);
field.m_id = Frame::ID_Description;
field.m_value = TStringToQString(usltFrame->description());
field.m_value = toQString(usltFrame->description());
fields.push_back(field);
field.m_id = Frame::ID_Text;
text = TStringToQString(usltFrame->toString());
text = toQString(usltFrame->toString());
field.m_value = text;
fields.push_back(field);
......@@ -2803,7 +2825,7 @@ static QString getFieldsFromSyltFrame(
fields.push_back(field);
field.m_id = Frame::ID_Description;
text = TStringToQString(syltFrame->description());
text = toQString(syltFrame->description());
field.m_value = text;
fields.push_back(field);
......@@ -2816,7 +2838,7 @@ static QString getFieldsFromSyltFrame(
it != stl.end();
++it) {
synchedData.append(static_cast<quint32>(it->time));
synchedData.append(TStringToQString(it->text));
synchedData.append(toQString(it->text));
}
field.m_value = synchedData;
fields.push_back(field);
......@@ -2874,7 +2896,7 @@ static QString getFieldsFromPrivFrame(
QString owner;
Frame::Field field;
field.m_id = Frame::ID_Owner;
owner = TStringToQString(privFrame->owner());
owner = toQString(privFrame->owner());
field.m_value = owner;
fields.push_back(field);
......@@ -2908,7 +2930,7 @@ static QString getFieldsFromPopmFrame(
{
Frame::Field field;
field.m_id = Frame::ID_Email;
field.m_value = TStringToQString(popmFrame->email());
field.m_value = toQString(popmFrame->email());
fields.push_back(field);
field.m_id = Frame::ID_Rating;
......@@ -2943,15 +2965,15 @@ static QString getFieldsFromOwneFrame(
fields.push_back(field);
field.m_id = Frame::ID_Date;
field.m_value = TStringToQString(owneFrame->datePurchased());
field.m_value = toQString(owneFrame->datePurchased());
fields.push_back(field);
field.m_id = Frame::ID_Price;
field.m_value = TStringToQString(owneFrame->pricePaid());
field.m_value = toQString(owneFrame->pricePaid());
fields.push_back(field);
field.m_id = Frame::ID_Seller;
QString text(TStringToQString(owneFrame->seller()));
QString text(toQString(owneFrame->seller()));
field.m_value = text;
fields.push_back(field);
......@@ -3183,47 +3205,47 @@ template <>
void setDescription(TagLib::ID3v2::UserTextIdentificationFrame* f,
const Frame::Field& fld)
{
f->setDescription(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setDescription(toTString(fld.m_value.toString()));
}
template <>
void setDescription(TagLib::ID3v2::AttachedPictureFrame* f,
const Frame::Field& fld)
{
f->setDescription(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setDescription(toTString(fld.m_value.toString()));
}
template <>
void setDescription(TagLib::ID3v2::CommentsFrame* f, const Frame::Field& fld)
{
f->setDescription(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setDescription(toTString(fld.m_value.toString()));
}
template <>
void setDescription(TagLib::ID3v2::GeneralEncapsulatedObjectFrame* f,
const Frame::Field& fld)
{
f->setDescription(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setDescription(toTString(fld.m_value.toString()));
}
template <>
void setDescription(TagLib::ID3v2::UserUrlLinkFrame* f, const Frame::Field& fld)
{
f->setDescription(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setDescription(toTString(fld.m_value.toString()));
}
template <>
void setDescription(TagLib::ID3v2::UnsynchronizedLyricsFrame* f,
const Frame::Field& fld)
{
f->setDescription(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setDescription(toTString(fld.m_value.toString()));
}
template <>
void setDescription(TagLib::ID3v2::SynchronizedLyricsFrame* f,
const Frame::Field& fld)
{
f->setDescription(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setDescription(toTString(fld.m_value.toString()));
}
template <class T>
......@@ -3233,14 +3255,14 @@ template <>
void setMimeType(TagLib::ID3v2::AttachedPictureFrame* f,
const Frame::Field& fld)
{
f->setMimeType(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setMimeType(toTString(fld.m_value.toString()));
}
template <>
void setMimeType(TagLib::ID3v2::GeneralEncapsulatedObjectFrame* f,
const Frame::Field& fld)
{
f->setMimeType(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setMimeType(toTString(fld.m_value.toString()));
}
template <class T>
......@@ -3300,7 +3322,7 @@ void setData(TagLib::ID3v2::SynchronizedLyricsFrame* f,
if (!it.hasNext())
break;
TagLib::String text = QSTRING_TO_TSTRING(it.next().toString());
TagLib::String text = toTString(it.next().toString());
stl.append(TagLib::ID3v2::SynchronizedLyricsFrame::SynchedText(time, text));
}
f->setSynchedText(stl);
......@@ -3356,7 +3378,7 @@ template <>
void setOwner(TagLib::ID3v2::UniqueFileIdentifierFrame* f,
const Frame::Field& fld)
{
f->setOwner(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setOwner(toTString(fld.m_value.toString()));
}
#if TAGLIB_VERSION >= 0x010600
......@@ -3364,7 +3386,7 @@ template <>
void setOwner(TagLib::ID3v2::PrivateFrame* f,
const Frame::Field& fld)
{
f->setOwner(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setOwner(toTString(fld.m_value.toString()));
}
template <>
......@@ -3394,7 +3416,7 @@ template <>
void setFilename(TagLib::ID3v2::GeneralEncapsulatedObjectFrame* f,
const Frame::Field& fld)
{
f->setFileName(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setFileName(toTString(fld.m_value.toString()));
}
template <class T>
......@@ -3403,13 +3425,13 @@ void setUrl(T*, const Frame::Field&) {}
template <>
void setUrl(TagLib::ID3v2::UrlLinkFrame* f, const Frame::Field& fld)
{
f->setUrl(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setUrl(toTString(fld.m_value.toString()));
}
template <>
void setUrl(TagLib::ID3v2::UserUrlLinkFrame* f, const Frame::Field& fld)
{
f->setUrl(QSTRING_TO_TSTRING(fld.m_value.toString()));
f->setUrl(toTString(fld.m_value.toString()));
}
template <class T>
......@@ -3449,7 +3471,7 @@ void setValue(TagLib::ID3v2::TextIdentificationFrame* f, const TagLib::String& t
template <>
void setValue(TagLib::ID3v2::UniqueFileIdentifierFrame* f, const TagLib::String& text)
{
if (AttributeData::isHexString(TStringToQString(text), 'Z')) {
if (AttributeData::isHexString(toQString(text), 'Z')) {
TagLib::ByteVector data(text.data(TagLib::String::Latin1));
data.append('\0');
f->setIdentifier(data);
......@@ -3469,8 +3491,8 @@ void setValue(TagLib::ID3v2::PrivateFrame* f, const TagLib::String& text)
QByteArray newData;
TagLib::String owner = f->owner();
if (!owner.isEmpty() &&
AttributeData(TStringToQString(owner)).
toByteArray(TStringToQString(text), newData)) {
AttributeData(toQString(owner)).
toByteArray(toQString(text), newData)) {
f->setData(TagLib::ByteVector(newData.data(), newData.size()));
}
}
......@@ -3501,7 +3523,7 @@ void setEmail(T*, const Frame::Field&) {}
template <>
void setEmail(TagLib::ID3v2::PopularimeterFrame* f, const Frame::Field& fld)
{
f->setEmail(QSTRING_TO_TSTRING(fld.m_value.toString()));