Commit af78fe8f authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Get translated display names for most non unified frames.

parent a24a5d3a
......@@ -102,20 +102,23 @@ void FrameEditorObject::selectFrame(Frame* frame, const TaggedFile* taggedFile)
{
if (taggedFile && frame) {
QStringList frameNames = taggedFile->getFrameIds();
m_displayNameMap = Frame::getDisplayNameMap(frameNames);
m_selectFrame = frame;
emit frameSelectionRequested(frameNames);
emit frameSelectionRequested(m_displayNameMap.keys());
}
}
/**
* Called when the frame selection dialog is closed.
*
* @param name name of selected frame, empty if canceled
* @param displayName name of selected frame, empty if canceled
*/
void FrameEditorObject::onFrameSelectionFinished(const QString& name)
void FrameEditorObject::onFrameSelectionFinished(const QString& displayName)
{
if (!name.isEmpty()) {
Frame::Type type = Frame::getTypeFromTranslatedName(name);
if (!displayName.isEmpty()) {
QString name = m_displayNameMap.value(displayName, displayName);
m_displayNameMap.clear();
Frame::Type type = Frame::getTypeFromName(name);
*m_selectFrame = Frame(type, QLatin1String(""), name, -1);
emit frameSelected(m_selectFrame);
} else {
......
......@@ -28,6 +28,7 @@
#define FRAMEEDITOROBJECT_H
#include <QObject>
#include <QMap>
#include "iframeeditor.h"
#include "frame.h"
......@@ -92,11 +93,11 @@ public slots:
/**
* Called when the frame selection dialog is closed.
*
* @param name name of selected frame, empty if canceled
* @param displayName name of selected frame, empty if canceled
*
* @see frameSelectionRequested()
*/
void onFrameSelectionFinished(const QString& name);
void onFrameSelectionFinished(const QString& displayName);
/**
* Called when the frame edit dialog is closed.
......@@ -146,6 +147,7 @@ private:
TaggedFile* m_editFrameTaggedFile;
FrameObjectModel* m_frameObjectModel;
Frame m_editFrame;
QMap<QString, QString> m_displayNameMap;
};
#endif // FRAMEEDITOROBJECT_H
......@@ -127,33 +127,6 @@ Qt::ItemFlags FrameTableModel::flags(const QModelIndex& index) const
return theFlags;
}
/**
* Get a display representation of the a frame name.
* For ID3v2-IDs with description, only the ID is returned.
* Other non-empty strings are translated.
*
* @param str frame name
*
* @return display representation of name.
*/
QString FrameTableModel::getDisplayName(const QString& str)
{
if (!str.isEmpty()) {
int nlPos = str.indexOf(QLatin1Char('\n'));
if (nlPos > 0) {
// probably "TXXX - User defined text information\nDescription" or
// "WXXX - User defined URL link\nDescription"
return str.mid(nlPos + 1);
} else if (str.midRef(4, 3) == QLatin1String(" - ")) {
// probably "ID3-ID - Description"
return str.left(4);
} else {
return QCoreApplication::translate("@default", str.toLatin1().data());
}
}
return str;
}
/**
* Get data for a given role.
* @param index model index
......@@ -182,7 +155,7 @@ QVariant FrameTableModel::data(const QModelIndex& index, int role) const
}
if (role == Qt::DisplayRole || role == Qt::EditRole) {
if (index.column() == CI_Enable) {
QString displayName = getDisplayName(it->getName());
QString displayName = Frame::getDisplayName(it->getName());
if (it->getType() == Frame::FT_Picture &&
it->getValue() != Frame::differentRepresentation()) {
QVariant fieldValue = it->getFieldValue(Frame::ID_PictureType);
......@@ -212,7 +185,7 @@ QVariant FrameTableModel::data(const QModelIndex& index, int role) const
} else if (role == FrameTypeRole) {
return it->getType();
} else if (role == NameRole) {
return getDisplayName(it->getName());
return Frame::getDisplayName(it->getName());
} else if (role == ValueRole) {
return it->getValue();
} else if (role == ModifiedRole) {
......
......@@ -250,17 +250,6 @@ public:
*/
void filterDifferent(FrameCollection& others);
/**
* Get a display representation of the a frame name.
* For ID3v2-IDs with description, only the ID is returned.
* Other non-empty strings are translated.
*
* @param str frame name
*
* @return display representation of name.
*/
static QString getDisplayName(const QString& str);
public slots:
/**
* Select all frames in the table.
......
......@@ -179,7 +179,7 @@ QVariant TrackDataModel::headerData(
if (typeOrProperty < FT_FirstTrackProperty) {
return typeOrProperty == Frame::FT_Track
? tr("Track") // shorter header for track number
: FrameTableModel::getDisplayName(type.getName());
: Frame::getDisplayName(type.getName());
} else {
switch (typeOrProperty) {
case FT_FilePath:
......
......@@ -26,6 +26,7 @@
#include "frame.h"
#include <QMap>
#include <QStringList>
#include <QRegExp>
#include <QCoreApplication>
#include "pictureframe.h"
......@@ -156,32 +157,6 @@ const char* getNameFromType(Frame::Type type)
return type <= Frame::FT_LastFrame ? names[type] : "Unknown";
}
/**
* Get type of frame from English name.
*
* @param name name, spaces and case are ignored
*
* @return type.
*/
Frame::Type getTypeFromName(QString name)
{
static QMap<QString, int> strNumMap;
if (strNumMap.empty()) {
// first time initialization
for (int i = 0; i <= Frame::FT_LastFrame; ++i) {
Frame::Type type = static_cast<Frame::Type>(i);
strNumMap.insert(QString::fromLatin1(getNameFromType(type)).
remove(QLatin1Char(' ')).toUpper(), type);
}
}
QMap<QString, int>::const_iterator it =
strNumMap.find(name.remove(QLatin1Char(' ')).toUpper());
if (it != strNumMap.end()) {
return static_cast<Frame::Type>(*it);
}
return Frame::FT_Other;
}
}
Frame::ExtendedType::ExtendedType(const QString& name) :
......@@ -435,26 +410,26 @@ QVariant Frame::getField(const Frame& frame, FieldId id)
}
/**
* Get type of frame from translated name.
* Get type of frame from English name.
*
* @param translatedName name, spaces and case are ignored
* @param name name, spaces and case are ignored
*
* @return type.
*/
Frame::Type Frame::getTypeFromTranslatedName(const QString& translatedName)
Frame::Type Frame::getTypeFromName(const QString& name)
{
static QMap<QString, int> strNumMap;
if (strNumMap.empty()) {
// first time initialization
for (int i = 0; i <= Frame::FT_LastFrame; ++i) {
Frame::Type type = static_cast<Frame::Type>(i);
strNumMap.insert(Frame::ExtendedType(type, QLatin1String("")).getTranslatedName().
strNumMap.insert(QString::fromLatin1(getNameFromType(type)).
remove(QLatin1Char(' ')).toUpper(), type);
}
}
QString name(translatedName);
QMap<QString, int>::const_iterator it =
strNumMap.find(name.remove(QLatin1Char(' ')).toUpper());
QString ucName(name.toUpper());
ucName.remove(QLatin1Char(' '));
QMap<QString, int>::const_iterator it = strNumMap.find(ucName);
if (it != strNumMap.end()) {
return static_cast<Frame::Type>(*it);
}
......@@ -473,6 +448,196 @@ QString Frame::getFrameTypeName(Type type)
return QCoreApplication::translate("@default", getNameFromType(type));
}
/**
* Get a display name for a frame name.
* @param name frame name as returned by getName()
* @return display name, transformed if necessary and translated.
*/
QString Frame::getDisplayName(const QString& name)
{
static const struct StrOfId {
const char* id;
const char* str;
} strOfId[] = {
{ "AENC", QT_TRANSLATE_NOOP("@default", "Audio Encryption") },
{ "ASPI", QT_TRANSLATE_NOOP("@default", "Audio Seek Point") },
{ "CHAP", QT_TRANSLATE_NOOP("@default", "Chapter") },
{ "COMR", QT_TRANSLATE_NOOP("@default", "Commercial") },
{ "CTOC", QT_TRANSLATE_NOOP("@default", "Table of Contents") },
{ "ENCR", QT_TRANSLATE_NOOP("@default", "Encryption Method") },
{ "EQU2", QT_TRANSLATE_NOOP("@default", "Equalization") },
{ "EQUA", QT_TRANSLATE_NOOP("@default", "Equalization") },
{ "ETCO", QT_TRANSLATE_NOOP("@default", "Event Timing Codes") },
{ "GEOB", QT_TRANSLATE_NOOP("@default", "General Object") },
{ "GRID", QT_TRANSLATE_NOOP("@default", "Group Identification") },
{ "LINK", QT_TRANSLATE_NOOP("@default", "Linked Information") },
{ "MCDI", QT_TRANSLATE_NOOP("@default", "Music CD Identifier") },
{ "MLLT", QT_TRANSLATE_NOOP("@default", "MPEG Lookup Table") },
{ "OWNE", QT_TRANSLATE_NOOP("@default", "Ownership") },
{ "PCNT", QT_TRANSLATE_NOOP("@default", "Play Counter") },
{ "PCST", QT_TRANSLATE_NOOP("@default", "Podcast") },
{ "POPM", QT_TRANSLATE_NOOP("@default", "Popularimeter") },
{ "POSS", QT_TRANSLATE_NOOP("@default", "Position Synchronisation") },
{ "PRIV", QT_TRANSLATE_NOOP("@default", "Private") },
{ "RBUF", QT_TRANSLATE_NOOP("@default", "Recommended Buffer Size") },
{ "RVA2", QT_TRANSLATE_NOOP("@default", "Volume Adjustment") },
{ "RVAD", QT_TRANSLATE_NOOP("@default", "Volume Adjustment") },
{ "RVRB", QT_TRANSLATE_NOOP("@default", "Reverb") },
{ "SEEK", QT_TRANSLATE_NOOP("@default", "Seek") },
{ "SIGN", QT_TRANSLATE_NOOP("@default", "Signature") },
{ "SYLT", QT_TRANSLATE_NOOP("@default", "Synchronized Lyrics") },
{ "SYTC", QT_TRANSLATE_NOOP("@default", "Synchronized Tempo Codes") },
{ "TDAT", QT_TRANSLATE_NOOP("@default", "Date") },
{ "TDEN", QT_TRANSLATE_NOOP("@default", "Encoding Time") },
{ "TDES", QT_TRANSLATE_NOOP("@default", "Podcast Description") },
{ "TDLY", QT_TRANSLATE_NOOP("@default", "Playlist Delay") },
{ "TDOR", QT_TRANSLATE_NOOP("@default", "Original Release Time") },
{ "TDRC", QT_TRANSLATE_NOOP("@default", "Recording Time") },
{ "TDRL", QT_TRANSLATE_NOOP("@default", "Release Time") },
{ "TDTG", QT_TRANSLATE_NOOP("@default", "Tagging Time") },
{ "TFLT", QT_TRANSLATE_NOOP("@default", "File Type") },
{ "TGID", QT_TRANSLATE_NOOP("@default", "Podcast Identifier") },
{ "TIME", QT_TRANSLATE_NOOP("@default", "Time") },
{ "TLEN", QT_TRANSLATE_NOOP("@default", "Length") },
{ "TOFN", QT_TRANSLATE_NOOP("@default", "Original Filename") },
{ "TOWN", QT_TRANSLATE_NOOP("@default", "File Owner") },
{ "TPRO", QT_TRANSLATE_NOOP("@default", "Produced Notice") },
{ "TRDA", QT_TRANSLATE_NOOP("@default", "Recording Date") },
{ "TRSN", QT_TRANSLATE_NOOP("@default", "Radio Station Name") },
{ "TRSO", QT_TRANSLATE_NOOP("@default", "Radio Station Owner") },
{ "TSIZ", QT_TRANSLATE_NOOP("@default", "Size") },
{ "TXXX", QT_TRANSLATE_NOOP("@default", "User-defined Text") },
{ "UFID", QT_TRANSLATE_NOOP("@default", "Unique File Identifier") },
{ "USER", QT_TRANSLATE_NOOP("@default", "Terms of Use") },
{ "WCOM", QT_TRANSLATE_NOOP("@default", "Commercial URL") },
{ "WCOP", QT_TRANSLATE_NOOP("@default", "Copyright URL") },
{ "WFED", QT_TRANSLATE_NOOP("@default", "Podcast Feed") },
{ "WORS", QT_TRANSLATE_NOOP("@default", "Official Radio Station") },
{ "WPAY", QT_TRANSLATE_NOOP("@default", "Payment") },
{ "WPUB", QT_TRANSLATE_NOOP("@default", "Official Publisher") },
{ "WXXX", QT_TRANSLATE_NOOP("@default", "User-defined URL") },
{ "BAND", QT_TRANSLATE_NOOP("@default", "Album Artist") },
{ "CONTACT", QT_TRANSLATE_NOOP("@default", "Contact") },
{ "CONTENTGROUP", QT_TRANSLATE_NOOP("@default", "Grouping") },
{ "DESCRIPTION", QT_TRANSLATE_NOOP("@default", "Description") },
{ "DISCTOTAL", QT_TRANSLATE_NOOP("@default", "Total Discs") },
{ "ENCODER", QT_TRANSLATE_NOOP("@default", "Encoder") },
{ "ENCODER_OPTIONS", QT_TRANSLATE_NOOP("@default", "Encoder Settings") },
{ "ENCODEDBY", QT_TRANSLATE_NOOP("@default", "Encoded-by") },
{ "ENCODING", QT_TRANSLATE_NOOP("@default", "Encoding") },
{ "ENGINEER", QT_TRANSLATE_NOOP("@default", "Engineer") },
{ "ENSEMBLE", QT_TRANSLATE_NOOP("@default", "Ensemble") },
{ "GUESTARTIST", QT_TRANSLATE_NOOP("@default", "Guest Artist") },
{ "IsVBR", QT_TRANSLATE_NOOP("@default", "VBR") },
{ "iTunPGAP", QT_TRANSLATE_NOOP("@default", "Gapless Playback") },
{ "LABEL", QT_TRANSLATE_NOOP("@default", "Label") },
{ "LABELNO", QT_TRANSLATE_NOOP("@default", "Label Number") },
{ "LICENSE", QT_TRANSLATE_NOOP("@default", "License") },
{ "LOCATION", QT_TRANSLATE_NOOP("@default", "Location") },
{ "OPUS", QT_TRANSLATE_NOOP("@default", "Opus") },
{ "ORIGARTIST", QT_TRANSLATE_NOOP("@default", "Original Artist") },
{ "ORGANIZATION", QT_TRANSLATE_NOOP("@default", "Organization") },
{ "PARTNUMBER", QT_TRANSLATE_NOOP("@default", "Part Number") },
{ "PRODUCER", QT_TRANSLATE_NOOP("@default", "Producer") },
{ "PRODUCTNUMBER", QT_TRANSLATE_NOOP("@default", "Product Number") },
{ "RECORDINGDATE", QT_TRANSLATE_NOOP("@default", "Recording Date") },
{ "RELEASEDATE", QT_TRANSLATE_NOOP("@default", "Release Date") },
{ "REMIXEDBY", QT_TRANSLATE_NOOP("@default", "Remixer") },
{ "Rating", QT_TRANSLATE_NOOP("@default", "Rating") },
{ "TOTALDISCS", QT_TRANSLATE_NOOP("@default", "Total Discs") },
{ "TOTALTRACKS", QT_TRANSLATE_NOOP("@default", "Total Tracks") },
{ "TRACKTOTAL", QT_TRANSLATE_NOOP("@default", "Total Tracks") },
{ "UNKNOWN", QT_TRANSLATE_NOOP("@default", "Unknown") },
{ "Unknown", QT_TRANSLATE_NOOP("@default", "Unknown") },
{ "VERSION", QT_TRANSLATE_NOOP("@default", "Version") },
{ "VOLUME", QT_TRANSLATE_NOOP("@default", "Volume") },
{ "WWW", QT_TRANSLATE_NOOP("@default", "User-defined URL") },
{ "WM/AlbumArtistSortOrder", QT_TRANSLATE_NOOP("@default", "Sort Album Artist") },
{ "WM/Comments", QT_TRANSLATE_NOOP("@default", "Comment") },
{ "WM/MCDI", QT_TRANSLATE_NOOP("@default", "MCDI") },
{ "WM/Mood", QT_TRANSLATE_NOOP("@default", "Mood") },
{ "WM/OriginalFilename", QT_TRANSLATE_NOOP("@default", "Original Filename") },
{ "WM/OriginalLyricist", QT_TRANSLATE_NOOP("@default", "Original Lyricist") },
{ "WM/PromotionURL", QT_TRANSLATE_NOOP("@default", "Commercial URL") },
{ "WM/SharedUserRating", QT_TRANSLATE_NOOP("@default", "User Rating") },
{ "WM/UserWebURL", QT_TRANSLATE_NOOP("@default", "User-defined URL") },
{ "akID", QT_TRANSLATE_NOOP("@default", "Account Type") },
{ "apID", QT_TRANSLATE_NOOP("@default", "Purchase Account") },
{ "atID", QT_TRANSLATE_NOOP("@default", "Artist ID") },
{ "catg", QT_TRANSLATE_NOOP("@default", "Category") },
{ "cnID", QT_TRANSLATE_NOOP("@default", "Catalog ID") },
{ "cond", QT_TRANSLATE_NOOP("@default", "Conductor") },
{ "desc", QT_TRANSLATE_NOOP("@default", "Description") },
{ "geID", QT_TRANSLATE_NOOP("@default", "Genre ID") },
{ "hdvd", QT_TRANSLATE_NOOP("@default", "HD Video") },
{ "keyw", QT_TRANSLATE_NOOP("@default", "Keyword") },
{ "ldes", QT_TRANSLATE_NOOP("@default", "Long Description") },
{ "pcst", QT_TRANSLATE_NOOP("@default", "Podcast") },
{ "pgap", QT_TRANSLATE_NOOP("@default", "Gapless Playback") },
{ "plID", QT_TRANSLATE_NOOP("@default", "Album ID") },
{ "purd", QT_TRANSLATE_NOOP("@default", "Purchase Date") },
{ "rtng", QT_TRANSLATE_NOOP("@default", "Rating") },
{ "sfID", QT_TRANSLATE_NOOP("@default", "Country Code") },
{ "sosn", QT_TRANSLATE_NOOP("@default", "Sort Show") },
{ "stik", QT_TRANSLATE_NOOP("@default", "Media Type") },
{ "tven", QT_TRANSLATE_NOOP("@default", "TV Episode") },
{ "tves", QT_TRANSLATE_NOOP("@default", "TV Episode Number") },
{ "tvnn", QT_TRANSLATE_NOOP("@default", "TV Network Name") },
{ "tvsh", QT_TRANSLATE_NOOP("@default", "TV Show Name") },
{ "tvsn", QT_TRANSLATE_NOOP("@default", "TV Season") },
{ "year", QT_TRANSLATE_NOOP("@default", "Year") }
};
static QMap<QByteArray, QByteArray> idStrMap;
if (idStrMap.isEmpty()) {
// first time initialization
for (unsigned int i = 0; i < sizeof(strOfId) / sizeof(strOfId[0]); ++i) {
idStrMap.insert(strOfId[i].id, strOfId[i].str);
}
}
if (name.isEmpty())
return name;
Type type = getTypeFromName(name);
if (type != FT_Other)
return QCoreApplication::translate("@default",
name.toLatin1().constData());
QString nameStr(name);
int nlPos = nameStr.indexOf(QLatin1Char('\n'));
if (nlPos > 0)
// probably "TXXX - User defined text information\nDescription" or
// "WXXX - User defined URL link\nDescription"
nameStr = nameStr.mid(nlPos + 1);
QByteArray id;
if (nameStr.mid(4, 3) == QLatin1String(" - ")) {
id = nameStr.left(4).toLatin1();
} else {
id = nameStr.toLatin1();
}
QMap<QByteArray, QByteArray>::const_iterator it = idStrMap.constFind(id);
if (it != idStrMap.constEnd()) {
return QCoreApplication::translate("@default", it->constData());
}
return nameStr;
}
/**
* Get a map with display names as keys and frame names as values.
* @param names frame names as returned by getName()
* @return mapping of display names to frame names.
*/
QMap<QString, QString> Frame::getDisplayNameMap(const QStringList& names)
{
QMap<QString, QString> map;
foreach (const QString& name, names) {
map.insert(getDisplayName(name), name);
}
return map;
}
/**
* Get a translated string for a field ID.
......
......@@ -608,13 +608,13 @@ public:
static QVariant getField(const Frame& frame, FieldId id);
/**
* Get type of frame from translated name.
* Get type of frame from English name.
*
* @param translatedName name, spaces and case are ignored
* @param name name, spaces and case are ignored
*
* @return type.
*/
static Type getTypeFromTranslatedName(const QString& translatedName);
static Type getTypeFromName(const QString& name);
/**
* Get a translated string for a frame type.
......@@ -625,6 +625,20 @@ public:
*/
static QString getFrameTypeName(Type type);
/**
* Get a display name for a frame name.
* @param name frame name as returned by getName()
* @return display name, transformed if necessary and translated.
*/
static QString getDisplayName(const QString& name);
/**
* Get a map with display names as keys and frame names as values.
* @param names frame names as returned by getName()
* @return mapping of display names to frame names.
*/
static QMap<QString, QString> getDisplayNameMap(const QStringList& names);
private:
friend class TaggedFile;
......
......@@ -926,11 +926,14 @@ void BaseMainWindowImpl::selectFrame(Frame* frame, const TaggedFile* taggedFile)
{
bool ok = false;
if (taggedFile && frame) {
QString name = QInputDialog::getItem(
QStringList frameIds = taggedFile->getFrameIds();
QMap<QString, QString> nameMap = Frame::getDisplayNameMap(frameIds);
QString displayName = QInputDialog::getItem(
m_w, tr("Add Frame"),
tr("Select the frame ID"), taggedFile->getFrameIds(), 0, true, &ok);
tr("Select the frame ID"), nameMap.keys(), 0, true, &ok);
if (ok) {
Frame::Type type = Frame::getTypeFromTranslatedName(name);
QString name = nameMap.value(displayName, displayName);
Frame::Type type = Frame::getTypeFromName(name);
*frame = Frame(type, QLatin1String(""), name, -1);
}
}
......
......@@ -128,11 +128,14 @@ void SubframesEditor::onEditClicked()
void SubframesEditor::onAddClicked()
{
bool ok = false;
QString name = QInputDialog::getItem(
QStringList frameIds = m_taggedFile->getFrameIds();
QMap<QString, QString> nameMap = Frame::getDisplayNameMap(frameIds);
QString displayName = QInputDialog::getItem(
this, tr("Add Frame"),
tr("Select the frame ID"), m_taggedFile->getFrameIds(), 0, true, &ok);
tr("Select the frame ID"), nameMap.keys(), 0, true, &ok);
if (ok) {
Frame::Type type = Frame::getTypeFromTranslatedName(name);
QString name = nameMap.value(displayName, displayName);
Frame::Type type = Frame::getTypeFromName(name);
Frame frame(type, QLatin1String(""), name, -1);
m_taggedFile->addFieldList(frame);
editFrame(frame, -1);
......
......@@ -30,7 +30,6 @@
#include <QString>
#include <QTextCodec>
#include <QByteArray>
#include <QCoreApplication>
#include <QtEndian>
#include <cstring>
......@@ -2335,14 +2334,14 @@ QStringList Mp3File::getFrameIds() const
for (int type = Frame::FT_FirstFrame; type <= Frame::FT_LastFrame; ++type) {
if (type != Frame::FT_Part) {
lst.append(Frame::ExtendedType(static_cast<Frame::Type>(type), QLatin1String("")).
getTranslatedName());
getName());
}
}
for (int i = 0; i <= ID3FID_WWWUSER; ++i) {
if (typeStrOfId[i].type == Frame::FT_Other) {
const char* s = typeStrOfId[i].str;
if (s) {
lst.append(QCoreApplication::translate("@default", s));
lst.append(QString::fromLatin1(s));
}
}
}
......
......@@ -1395,7 +1395,7 @@ QStringList M4aFile::getFrameIds() const
QStringList lst;
for (unsigned i = 0; i < sizeof(types) / sizeof(types[0]); ++i) {
lst.append(Frame::ExtendedType(static_cast<Frame::Type>(i), QLatin1String("")).
getTranslatedName());
getName());
}
lst << QLatin1String("cpil");
#if MPEG4IP_MAJOR_MINOR_VERSION >= 0x0106
......
......@@ -936,10 +936,6 @@ QStringList OggFile::getFrameIds() const
"PRODUCTNUMBER",
"RECORDINGDATE",
"RELEASEDATE",
"SOURCEARTIST",
"SOURCEMEDIUM",
"SOURCEWORK",
"SPARS",
"TRACKTOTAL",
"VERSION",
"VOLUME"
......@@ -948,7 +944,7 @@ QStringList OggFile::getFrameIds() const
QStringList lst;
for (int k = Frame::FT_FirstFrame; k <= Frame::FT_LastFrame; ++k) {
lst.append(Frame::ExtendedType(static_cast<Frame::Type>(k), QLatin1String("")).
getTranslatedName());
getName());
}
for (unsigned i = 0; i < sizeof(fieldNames) / sizeof(fieldNames[0]); ++i) {
lst.append(QString::fromLatin1(fieldNames[i]));
......
......@@ -30,7 +30,6 @@
#include <QTextCodec>
#include <QByteArray>
#include <QImage>
#include <QCoreApplication>
#include <QVarLengthArray>
#include "genres.h"
#include "attributedata.h"
......@@ -6433,12 +6432,12 @@ QStringList TagLibFile::getFrameIds() const
if (m_tagTypeV2 == TT_Id3v2) {
for (int k = Frame::FT_FirstFrame; k <= Frame::FT_LastFrame; ++k) {
lst.append(Frame::ExtendedType(static_cast<Frame::Type>(k), QLatin1String("")).
getTranslatedName());
getName());
}
for (unsigned i = 0; i < sizeof(typeStrOfId) / sizeof(typeStrOfId[0]); ++i) {
const TypeStrOfId& ts = typeStrOfId[i];
if (ts.type == Frame::FT_Other && ts.supported && ts.str) {
lst.append(QCoreApplication::translate("@default", ts.str));
lst.append(QString::fromLatin1(ts.str));
}
}
#if TAGLIB_VERSION >= 0x010600
......@@ -6453,7 +6452,7 @@ QStringList TagLibFile::getFrameIds() const
getMp4NameForType(type, name, valueType);
if (!name.isEmpty() && valueType != MVT_ByteArray &&
!(name[0] >= 'A' && name[0] <= 'Z')) {
lst.append(Frame::ExtendedType(type, QLatin1String("")).getTranslatedName());
lst.append(Frame::ExtendedType(type, QLatin1String("")).getName());
}
}
for (unsigned i = 0; i < sizeof(mp4NameTypeValues) / sizeof(mp4NameTypeValues[0]); ++i) {
......@@ -6479,7 +6478,7 @@ QStringList TagLibFile::getFrameIds() const
&& type != Frame::FT_Picture
#endif
) {
lst.append(Frame::ExtendedType(type, QLatin1String("")).getTranslatedName());
lst.append(Frame::ExtendedType(type, QLatin1String("")).getName());
}
}
for (unsigned i = 0; i < sizeof(asfNameTypeValues) / sizeof(asfNameTypeValues[0]); ++i) {
......@@ -6509,10 +6508,6 @@ QStringList TagLibFile::getFrameIds() const
"PRODUCTNUMBER",
"RECORDINGDATE",
"RELEASEDATE",
"SOURCEARTIST",
"SOURCEMEDIUM",
"SOURCEWORK",
"SPARS",
"TRACKTOTAL",
"VERSION",
"VOLUME"