本文整理汇总了C++中translatormessage::ExtraData::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ ExtraData::clear方法的具体用法?C++ ExtraData::clear怎么用?C++ ExtraData::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类translatormessage::ExtraData
的用法示例。
在下文中一共展示了ExtraData::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: consumeComment
void FindTrCalls::consumeComment()
{
// keep the current `trcontext'
extracomment.clear();
msgid.clear();
extra.clear();
sourcetext.clear();
}
示例2: finalizeMessage
bool XLIFFHandler::finalizeMessage(bool isPlural)
{
if (m_sources.isEmpty()) {
m_cd.appendError(QLatin1String("XLIFF syntax error: Message without source string."));
return false;
}
if (!m_translate && m_refs.size() == 1
&& m_refs.at(0).fileName() == QLatin1String(MAGIC_OBSOLETE_REFERENCE))
m_refs.clear();
TranslatorMessage::Type type
= m_translate ? (m_approved ? TranslatorMessage::Finished : TranslatorMessage::Unfinished)
: (m_approved ? TranslatorMessage::Vanished : TranslatorMessage::Obsolete);
TranslatorMessage msg(m_context, m_sources[0],
m_comment, QString(), QString(), -1,
m_translations, type, isPlural);
msg.setId(m_id);
msg.setReferences(m_refs);
msg.setOldComment(m_oldComment);
msg.setExtraComment(m_extraComment);
msg.setTranslatorComment(m_translatorComment);
if (m_sources.count() > 1 && m_sources[1] != m_sources[0])
m_extra.insert(QLatin1String("po-msgid_plural"), m_sources[1]);
if (!m_oldSources.isEmpty()) {
if (!m_oldSources[0].isEmpty())
msg.setOldSourceText(m_oldSources[0]);
if (m_oldSources.count() > 1 && m_oldSources[1] != m_oldSources[0])
m_extra.insert(QLatin1String("po-old_msgid_plural"), m_oldSources[1]);
}
msg.setExtras(m_extra);
m_translator.append(msg);
m_id.clear();
m_sources.clear();
m_oldSources.clear();
m_translations.clear();
m_comment.clear();
m_oldComment.clear();
m_extraComment.clear();
m_translatorComment.clear();
m_extra.clear();
m_refs.clear();
m_translate = true;
m_approved = true;
return true;
}