6#include <qplatformdefs.h>
16TranslatorMessage::TranslatorMessage()
17 : m_lineNumber(-1), m_type(Unfinished), m_plural(
false)
22 const QString &sourceText,
const QString &comment,
23 const QString &userData,
24 const QString &fileName,
int lineNumber,
const QStringList &translations,
25 Type type,
bool plural)
29 m_type(type), m_plural(plural)
35 if (m_fileName.isEmpty()) {
36 m_fileName = fileName;
37 m_lineNumber = lineNumber;
39 m_extraRefs.append(
Reference(fileName, lineNumber));
45 if (m_fileName.isEmpty()) {
46 m_fileName = fileName;
47 m_lineNumber = lineNumber;
49 if (fileName == m_fileName && lineNumber == m_lineNumber)
51 if (!m_extraRefs.isEmpty()) {
52 for (
const Reference &ref : std::as_const(m_extraRefs)) {
53 if (fileName == ref.fileName() && lineNumber == ref.lineNumber())
57 m_extraRefs.append(
Reference(fileName, lineNumber));
70 if (!refs0.isEmpty()) {
73 m_fileName = ref.fileName();
84 if (!m_fileName.isEmpty()) {
85 refs.append(Reference(m_fileName, m_lineNumber));
94 return m_extra.contains(key);
104 m_extra[key] = value;
116 <<
"\nContext : " << m_context
117 <<
"\nSource : " << m_sourcetext
118 <<
"\nComment : " << m_comment
119 <<
"\nUserData : " << m_userData
120 <<
"\nExtraComment : " << m_extraComment
121 <<
"\nTranslatorComment : " << m_translatorComment
122 <<
"\nTranslations : " << m_translations
123 <<
"\nFileName : " << m_fileName
124 <<
"\nLineNumber : " << m_lineNumber
125 <<
"\nType : " << m_type
126 <<
"\nPlural : " << m_plural
127 <<
"\nExtra : " << m_extra;
QList< Reference > References
void addReference(const QString &fileName, int lineNumber)
TranslatorMessage(const QString &context, const QString &sourceText, const QString &comment, const QString &userData, const QString &fileName, int lineNumber, const QStringList &translations=QStringList(), Type type=Unfinished, bool plural=false)
void addReferenceUniq(const QString &fileName, int lineNumber)
References allReferences() const
void setReferences(const References &refs)
QString extra(const QString &ba) const
void setExtra(const QString &ba, const QString &var)
void unsetExtra(const QString &key)
bool hasExtra(const QString &ba) const