forked from qt-creator/qt-creator
Qt6: Sprinkle QLatin1Strings for QStringView comparisons
Task-number: QTCREATORBUG-24098 Change-Id: I2fb79bcfd0537a6704a1ee8db840401d6beca7a0 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -728,11 +728,11 @@ namespace ADS
|
|||||||
while (stateReader.readNextStartElement()) {
|
while (stateReader.readNextStartElement()) {
|
||||||
QWidget *childNode = nullptr;
|
QWidget *childNode = nullptr;
|
||||||
bool result = true;
|
bool result = true;
|
||||||
if (stateReader.name() == "splitter") {
|
if (stateReader.name() == QLatin1String("splitter")) {
|
||||||
result = restoreSplitter(stateReader, childNode, testing);
|
result = restoreSplitter(stateReader, childNode, testing);
|
||||||
} else if (stateReader.name() == "area") {
|
} else if (stateReader.name() == QLatin1String("area")) {
|
||||||
result = restoreDockArea(stateReader, childNode, testing);
|
result = restoreDockArea(stateReader, childNode, testing);
|
||||||
} else if (stateReader.name() == "sizes") {
|
} else if (stateReader.name() == QLatin1String("sizes")) {
|
||||||
QString size = stateReader.readElementText().trimmed();
|
QString size = stateReader.readElementText().trimmed();
|
||||||
qCInfo(adsLog) << "Size: " << size;
|
qCInfo(adsLog) << "Size: " << size;
|
||||||
QTextStream textStream(&size);
|
QTextStream textStream(&size);
|
||||||
@@ -797,7 +797,7 @@ namespace ADS
|
|||||||
dockArea = new DockAreaWidget(m_dockManager, q);
|
dockArea = new DockAreaWidget(m_dockManager, q);
|
||||||
|
|
||||||
while (stateReader.readNextStartElement()) {
|
while (stateReader.readNextStartElement()) {
|
||||||
if (stateReader.name() != "widget")
|
if (stateReader.name() != QLatin1String("widget"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto objectName = stateReader.attributes().value("name");
|
auto objectName = stateReader.attributes().value("name");
|
||||||
@@ -849,10 +849,10 @@ namespace ADS
|
|||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
while (stateReader.readNextStartElement()) {
|
while (stateReader.readNextStartElement()) {
|
||||||
if (stateReader.name() == "splitter") {
|
if (stateReader.name() == QLatin1String("splitter")) {
|
||||||
result = restoreSplitter(stateReader, createdWidget, testing);
|
result = restoreSplitter(stateReader, createdWidget, testing);
|
||||||
qCInfo(adsLog) << "Splitter";
|
qCInfo(adsLog) << "Splitter";
|
||||||
} else if (stateReader.name() == "area") {
|
} else if (stateReader.name() == QLatin1String("area")) {
|
||||||
result = restoreDockArea(stateReader, createdWidget, testing);
|
result = restoreDockArea(stateReader, createdWidget, testing);
|
||||||
qCInfo(adsLog) << "DockAreaWidget";
|
qCInfo(adsLog) << "DockAreaWidget";
|
||||||
} else {
|
} else {
|
||||||
@@ -1302,7 +1302,7 @@ namespace ADS
|
|||||||
|
|
||||||
if (isFloating) {
|
if (isFloating) {
|
||||||
qCInfo(adsLog) << "Restore floating widget";
|
qCInfo(adsLog) << "Restore floating widget";
|
||||||
if (!stateReader.readNextStartElement() || stateReader.name() != "geometry")
|
if (!stateReader.readNextStartElement() || stateReader.name() != QLatin1String("geometry"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QByteArray geometryString = stateReader
|
QByteArray geometryString = stateReader
|
||||||
|
@@ -191,7 +191,7 @@ namespace ADS
|
|||||||
if (!stateReader.readNextStartElement())
|
if (!stateReader.readNextStartElement())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (stateReader.name() != "QtAdvancedDockingSystem")
|
if (stateReader.name() != QLatin1String("QtAdvancedDockingSystem"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
qCInfo(adsLog) << stateReader.attributes().value("version");
|
qCInfo(adsLog) << stateReader.attributes().value("version");
|
||||||
@@ -219,7 +219,7 @@ namespace ADS
|
|||||||
#endif
|
#endif
|
||||||
int dockContainerCount = 0;
|
int dockContainerCount = 0;
|
||||||
while (stateReader.readNextStartElement()) {
|
while (stateReader.readNextStartElement()) {
|
||||||
if (stateReader.name() == "container") {
|
if (stateReader.name() == QLatin1String("container")) {
|
||||||
result = restoreContainer(dockContainerCount, stateReader, testing);
|
result = restoreContainer(dockContainerCount, stateReader, testing);
|
||||||
if (!result)
|
if (!result)
|
||||||
break;
|
break;
|
||||||
|
@@ -143,16 +143,16 @@ void CatchOutputReader::processOutputLine(const QByteArray &outputLineWithNewLin
|
|||||||
case QXmlStreamReader::EndElement: {
|
case QXmlStreamReader::EndElement: {
|
||||||
const auto currentTag = m_xmlReader.name();
|
const auto currentTag = m_xmlReader.name();
|
||||||
|
|
||||||
if (currentTag == CatchXml::SectionElement) {
|
if (currentTag == QLatin1String(CatchXml::SectionElement)) {
|
||||||
sendResult(ResultType::TestEnd);
|
sendResult(ResultType::TestEnd);
|
||||||
testOutputNodeFinished(SectionNode);
|
testOutputNodeFinished(SectionNode);
|
||||||
} else if (currentTag == CatchXml::TestCaseElement) {
|
} else if (currentTag == QLatin1String(CatchXml::TestCaseElement)) {
|
||||||
sendResult(ResultType::TestEnd);
|
sendResult(ResultType::TestEnd);
|
||||||
testOutputNodeFinished(TestCaseNode);
|
testOutputNodeFinished(TestCaseNode);
|
||||||
} else if (currentTag == CatchXml::GroupElement) {
|
} else if (currentTag == QLatin1String(CatchXml::GroupElement)) {
|
||||||
testOutputNodeFinished(GroupNode);
|
testOutputNodeFinished(GroupNode);
|
||||||
} else if (currentTag == CatchXml::ExpressionElement
|
} else if (currentTag == QLatin1String(CatchXml::ExpressionElement)
|
||||||
|| currentTag == CatchXml::BenchmarkResults) {
|
|| currentTag == QLatin1String(CatchXml::BenchmarkResults)) {
|
||||||
sendResult(m_currentResult);
|
sendResult(m_currentResult);
|
||||||
m_currentExpression.clear();
|
m_currentExpression.clear();
|
||||||
m_testCaseInfo.pop();
|
m_testCaseInfo.pop();
|
||||||
|
@@ -249,7 +249,7 @@ void DeviceSelectionModel::parsePackage(const QString &packageFile)
|
|||||||
QXmlStreamReader in(&f);
|
QXmlStreamReader in(&f);
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == "package")
|
if (elementName == QLatin1String("package"))
|
||||||
parsePackage(in, packageFile);
|
parsePackage(in, packageFile);
|
||||||
else
|
else
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
@@ -265,18 +265,18 @@ void DeviceSelectionModel::parsePackage(QXmlStreamReader &in, const QString &pac
|
|||||||
child->version = extractPackVersion(packageFile);
|
child->version = extractPackVersion(packageFile);
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == "name") {
|
if (elementName == QLatin1String("name")) {
|
||||||
fillElementProperty(in, child->name);
|
fillElementProperty(in, child->name);
|
||||||
} else if (elementName == "description") {
|
} else if (elementName == QLatin1String("description")) {
|
||||||
fillElementProperty(in, child->desc);
|
fillElementProperty(in, child->desc);
|
||||||
} else if (elementName == "vendor") {
|
} else if (elementName == QLatin1String("vendor")) {
|
||||||
fillVendor(in, child->vendorName, child->vendorId);
|
fillVendor(in, child->vendorName, child->vendorId);
|
||||||
} else if (elementName == "url") {
|
} else if (elementName == QLatin1String("url")) {
|
||||||
fillElementProperty(in, child->url);
|
fillElementProperty(in, child->url);
|
||||||
} else if (elementName == "devices") {
|
} else if (elementName == QLatin1String("devices")) {
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == "family")
|
if (elementName == QLatin1String("family"))
|
||||||
parseFamily(in, child);
|
parseFamily(in, child);
|
||||||
else
|
else
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
@@ -297,17 +297,17 @@ void DeviceSelectionModel::parseFamily(QXmlStreamReader &in, DeviceSelectionItem
|
|||||||
fillVendor(attrs.value("Dvendor").toString(), child->vendorName, child->vendorId);
|
fillVendor(attrs.value("Dvendor").toString(), child->vendorName, child->vendorId);
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == "processor") {
|
if (elementName == QLatin1String("processor")) {
|
||||||
fillCpu(in, child->cpu);
|
fillCpu(in, child->cpu);
|
||||||
} else if (elementName == "algorithm") {
|
} else if (elementName == QLatin1String("algorithm")) {
|
||||||
fillAlgorithms(in, child->algorithms);
|
fillAlgorithms(in, child->algorithms);
|
||||||
} else if (elementName == "memory") {
|
} else if (elementName == QLatin1String("memory")) {
|
||||||
fillMemories(in, child->memories);
|
fillMemories(in, child->memories);
|
||||||
} else if (elementName == "description") {
|
} else if (elementName == QLatin1String("description")) {
|
||||||
fillElementProperty(in, child->desc);
|
fillElementProperty(in, child->desc);
|
||||||
} else if (elementName == "subFamily") {
|
} else if (elementName == QLatin1String("subFamily")) {
|
||||||
parseSubFamily(in, child);
|
parseSubFamily(in, child);
|
||||||
} else if (elementName == "device") {
|
} else if (elementName == QLatin1String("device")) {
|
||||||
parseDevice(in, child);
|
parseDevice(in, child);
|
||||||
} else {
|
} else {
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
@@ -324,11 +324,11 @@ void DeviceSelectionModel::parseSubFamily(QXmlStreamReader &in, DeviceSelectionI
|
|||||||
child->name = attrs.value("DsubFamily").toString();
|
child->name = attrs.value("DsubFamily").toString();
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == "processor") {
|
if (elementName == QLatin1String("processor")) {
|
||||||
fillCpu(in, child->cpu);
|
fillCpu(in, child->cpu);
|
||||||
} else if (elementName == "debug") {
|
} else if (elementName == QLatin1String("debug")) {
|
||||||
fillSvd(in, child->svd);
|
fillSvd(in, child->svd);
|
||||||
} else if (elementName == "device") {
|
} else if (elementName == QLatin1String("device")) {
|
||||||
parseDevice(in, child);
|
parseDevice(in, child);
|
||||||
} else {
|
} else {
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
@@ -345,17 +345,17 @@ void DeviceSelectionModel::parseDevice(QXmlStreamReader &in, DeviceSelectionItem
|
|||||||
child->name = attrs.value("Dname").toString();
|
child->name = attrs.value("Dname").toString();
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == "processor") {
|
if (elementName == QLatin1String("processor")) {
|
||||||
fillCpu(in, child->cpu);
|
fillCpu(in, child->cpu);
|
||||||
} else if (elementName == "debug") {
|
} else if (elementName == QLatin1String("debug")) {
|
||||||
fillSvd(in, child->svd);
|
fillSvd(in, child->svd);
|
||||||
} else if (elementName == "description") {
|
} else if (elementName == QLatin1String("description")) {
|
||||||
fillElementProperty(in, child->desc);
|
fillElementProperty(in, child->desc);
|
||||||
} else if (elementName == "memory") {
|
} else if (elementName == QLatin1String("memory")) {
|
||||||
fillMemories(in, child->memories);
|
fillMemories(in, child->memories);
|
||||||
} else if (elementName == "algorithm") {
|
} else if (elementName == QLatin1String("algorithm")) {
|
||||||
fillAlgorithms(in, child->algorithms);
|
fillAlgorithms(in, child->algorithms);
|
||||||
} else if (elementName == "variant") {
|
} else if (elementName == QLatin1String("variant")) {
|
||||||
parseDeviceVariant(in, child);
|
parseDeviceVariant(in, child);
|
||||||
} else {
|
} else {
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
@@ -372,11 +372,11 @@ void DeviceSelectionModel::parseDeviceVariant(QXmlStreamReader &in, DeviceSelect
|
|||||||
child->name = attrs.value("Dvariant").toString();
|
child->name = attrs.value("Dvariant").toString();
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == "processor") {
|
if (elementName == QLatin1String("processor")) {
|
||||||
fillCpu(in, child->cpu);
|
fillCpu(in, child->cpu);
|
||||||
} else if (elementName == "memory") {
|
} else if (elementName == QLatin1String("memory")) {
|
||||||
fillMemories(in, child->memories);
|
fillMemories(in, child->memories);
|
||||||
} else if (elementName == "algorithm") {
|
} else if (elementName == QLatin1String("algorithm")) {
|
||||||
fillAlgorithms(in, child->algorithms);
|
fillAlgorithms(in, child->algorithms);
|
||||||
} else {
|
} else {
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
|
@@ -319,7 +319,7 @@ void AbstractSettings::readDocumentation()
|
|||||||
QXmlStreamReader xml(&file);
|
QXmlStreamReader xml(&file);
|
||||||
if (!xml.readNextStartElement())
|
if (!xml.readNextStartElement())
|
||||||
return;
|
return;
|
||||||
if (xml.name() != Constants::DOCUMENTATION_XMLROOT) {
|
if (xml.name() != QLatin1String(Constants::DOCUMENTATION_XMLROOT)) {
|
||||||
BeautifierPlugin::showError(tr("The file \"%1\" is not a valid documentation file.")
|
BeautifierPlugin::showError(tr("The file \"%1\" is not a valid documentation file.")
|
||||||
.arg(filename));
|
.arg(filename));
|
||||||
return;
|
return;
|
||||||
|
@@ -352,11 +352,11 @@ static void localizedText(const QStringList &locales, QXmlStreamReader *reader,
|
|||||||
static bool parseOutputAttribute(const QString &attribute, QXmlStreamReader *reader, ExternalTool::OutputHandling *value)
|
static bool parseOutputAttribute(const QString &attribute, QXmlStreamReader *reader, ExternalTool::OutputHandling *value)
|
||||||
{
|
{
|
||||||
const auto output = reader->attributes().value(attribute);
|
const auto output = reader->attributes().value(attribute);
|
||||||
if (output == kOutputShowInPane) {
|
if (output == QLatin1String(kOutputShowInPane)) {
|
||||||
*value = ExternalTool::ShowInPane;
|
*value = ExternalTool::ShowInPane;
|
||||||
} else if (output == kOutputReplaceSelection) {
|
} else if (output == QLatin1String(kOutputReplaceSelection)) {
|
||||||
*value = ExternalTool::ReplaceSelection;
|
*value = ExternalTool::ReplaceSelection;
|
||||||
} else if (output == kOutputIgnore) {
|
} else if (output == QLatin1String(kOutputIgnore)) {
|
||||||
*value = ExternalTool::Ignore;
|
*value = ExternalTool::Ignore;
|
||||||
} else {
|
} else {
|
||||||
reader->raiseError("Allowed values for output attribute are 'showinpane','replaceselection','ignore'");
|
reader->raiseError("Allowed values for output attribute are 'showinpane','replaceselection','ignore'");
|
||||||
@@ -374,19 +374,19 @@ ExternalTool * ExternalTool::createFromXml(const QByteArray &xml, QString *error
|
|||||||
auto tool = new ExternalTool;
|
auto tool = new ExternalTool;
|
||||||
QXmlStreamReader reader(xml);
|
QXmlStreamReader reader(xml);
|
||||||
|
|
||||||
if (!reader.readNextStartElement() || reader.name() != kExternalTool)
|
if (!reader.readNextStartElement() || reader.name() != QLatin1String(kExternalTool))
|
||||||
reader.raiseError("Missing start element <externaltool>");
|
reader.raiseError("Missing start element <externaltool>");
|
||||||
tool->m_id = reader.attributes().value(kId).toString();
|
tool->m_id = reader.attributes().value(kId).toString();
|
||||||
if (tool->m_id.isEmpty())
|
if (tool->m_id.isEmpty())
|
||||||
reader.raiseError("Missing or empty id attribute for <externaltool>");
|
reader.raiseError("Missing or empty id attribute for <externaltool>");
|
||||||
while (reader.readNextStartElement()) {
|
while (reader.readNextStartElement()) {
|
||||||
if (reader.name() == kDescription) {
|
if (reader.name() == QLatin1String(kDescription)) {
|
||||||
localizedText(locales, &reader, &descriptionLocale, &tool->m_description);
|
localizedText(locales, &reader, &descriptionLocale, &tool->m_description);
|
||||||
} else if (reader.name() == kDisplayName) {
|
} else if (reader.name() == QLatin1String(kDisplayName)) {
|
||||||
localizedText(locales, &reader, &nameLocale, &tool->m_displayName);
|
localizedText(locales, &reader, &nameLocale, &tool->m_displayName);
|
||||||
} else if (reader.name() == kCategory) {
|
} else if (reader.name() == QLatin1String(kCategory)) {
|
||||||
localizedText(locales, &reader, &categoryLocale, &tool->m_displayCategory);
|
localizedText(locales, &reader, &categoryLocale, &tool->m_displayCategory);
|
||||||
} else if (reader.name() == kOrder) {
|
} else if (reader.name() == QLatin1String(kOrder)) {
|
||||||
if (tool->m_order >= 0) {
|
if (tool->m_order >= 0) {
|
||||||
reader.raiseError("only one <order> element allowed");
|
reader.raiseError("only one <order> element allowed");
|
||||||
break;
|
break;
|
||||||
@@ -395,7 +395,7 @@ ExternalTool * ExternalTool::createFromXml(const QByteArray &xml, QString *error
|
|||||||
tool->m_order = reader.readElementText().toInt(&ok);
|
tool->m_order = reader.readElementText().toInt(&ok);
|
||||||
if (!ok || tool->m_order < 0)
|
if (!ok || tool->m_order < 0)
|
||||||
reader.raiseError("<order> element requires non-negative integer value");
|
reader.raiseError("<order> element requires non-negative integer value");
|
||||||
} else if (reader.name() == kExecutable) {
|
} else if (reader.name() == QLatin1String(kExecutable)) {
|
||||||
if (reader.attributes().hasAttribute(kOutput)) {
|
if (reader.attributes().hasAttribute(kOutput)) {
|
||||||
if (!parseOutputAttribute(kOutput, &reader, &tool->m_outputHandling))
|
if (!parseOutputAttribute(kOutput, &reader, &tool->m_outputHandling))
|
||||||
break;
|
break;
|
||||||
@@ -406,9 +406,9 @@ ExternalTool * ExternalTool::createFromXml(const QByteArray &xml, QString *error
|
|||||||
}
|
}
|
||||||
if (reader.attributes().hasAttribute(kModifiesDocument)) {
|
if (reader.attributes().hasAttribute(kModifiesDocument)) {
|
||||||
const auto value = reader.attributes().value(kModifiesDocument);
|
const auto value = reader.attributes().value(kModifiesDocument);
|
||||||
if (value == kYes || value == kTrue) {
|
if (value == QLatin1String(kYes) || value == QLatin1String(kTrue)) {
|
||||||
tool->m_modifiesCurrentDocument = true;
|
tool->m_modifiesCurrentDocument = true;
|
||||||
} else if (value == kNo || value == kFalse) {
|
} else if (value == QLatin1String(kNo) || value == QLatin1String(kFalse)) {
|
||||||
tool->m_modifiesCurrentDocument = false;
|
tool->m_modifiesCurrentDocument = false;
|
||||||
} else {
|
} else {
|
||||||
reader.raiseError("Allowed values for modifiesdocument attribute are 'yes','true','no','false'");
|
reader.raiseError("Allowed values for modifiesdocument attribute are 'yes','true','no','false'");
|
||||||
@@ -416,33 +416,33 @@ ExternalTool * ExternalTool::createFromXml(const QByteArray &xml, QString *error
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (reader.readNextStartElement()) {
|
while (reader.readNextStartElement()) {
|
||||||
if (reader.name() == kPath) {
|
if (reader.name() == QLatin1String(kPath)) {
|
||||||
tool->m_executables.append(reader.readElementText());
|
tool->m_executables.append(reader.readElementText());
|
||||||
} else if (reader.name() == kArguments) {
|
} else if (reader.name() == QLatin1String(kArguments)) {
|
||||||
if (!tool->m_arguments.isEmpty()) {
|
if (!tool->m_arguments.isEmpty()) {
|
||||||
reader.raiseError("only one <arguments> element allowed");
|
reader.raiseError("only one <arguments> element allowed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tool->m_arguments = reader.readElementText();
|
tool->m_arguments = reader.readElementText();
|
||||||
} else if (reader.name() == kInput) {
|
} else if (reader.name() == QLatin1String(kInput)) {
|
||||||
if (!tool->m_input.isEmpty()) {
|
if (!tool->m_input.isEmpty()) {
|
||||||
reader.raiseError("only one <input> element allowed");
|
reader.raiseError("only one <input> element allowed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tool->m_input = reader.readElementText();
|
tool->m_input = reader.readElementText();
|
||||||
} else if (reader.name() == kWorkingDirectory) {
|
} else if (reader.name() == QLatin1String(kWorkingDirectory)) {
|
||||||
if (!tool->m_workingDirectory.isEmpty()) {
|
if (!tool->m_workingDirectory.isEmpty()) {
|
||||||
reader.raiseError("only one <workingdirectory> element allowed");
|
reader.raiseError("only one <workingdirectory> element allowed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tool->m_workingDirectory = reader.readElementText();
|
tool->m_workingDirectory = reader.readElementText();
|
||||||
} else if (reader.name() == kBaseEnvironmentId) {
|
} else if (reader.name() == QLatin1String(kBaseEnvironmentId)) {
|
||||||
if (tool->m_baseEnvironmentProviderId.isValid()) {
|
if (tool->m_baseEnvironmentProviderId.isValid()) {
|
||||||
reader.raiseError("only one <baseEnvironmentId> element allowed");
|
reader.raiseError("only one <baseEnvironmentId> element allowed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tool->m_baseEnvironmentProviderId = Id::fromString(reader.readElementText());
|
tool->m_baseEnvironmentProviderId = Id::fromString(reader.readElementText());
|
||||||
} else if (reader.name() == kEnvironment) {
|
} else if (reader.name() == QLatin1String(kEnvironment)) {
|
||||||
if (!tool->m_environment.isEmpty()) {
|
if (!tool->m_environment.isEmpty()) {
|
||||||
reader.raiseError("only one <environment> element allowed");
|
reader.raiseError("only one <environment> element allowed");
|
||||||
break;
|
break;
|
||||||
|
@@ -96,12 +96,12 @@ static QString findResourceInFile(const QString &resName, const QString &filePat
|
|||||||
while (!xmlr.atEnd() && !xmlr.hasError()) {
|
while (!xmlr.atEnd() && !xmlr.hasError()) {
|
||||||
const QXmlStreamReader::TokenType token = xmlr.readNext();
|
const QXmlStreamReader::TokenType token = xmlr.readNext();
|
||||||
if (token == QXmlStreamReader::StartElement) {
|
if (token == QXmlStreamReader::StartElement) {
|
||||||
if (xmlr.name() == "qresource") {
|
if (xmlr.name() == QLatin1String("qresource")) {
|
||||||
const QXmlStreamAttributes sa = xmlr.attributes();
|
const QXmlStreamAttributes sa = xmlr.attributes();
|
||||||
const QString prefixName = sa.value("prefix").toString();
|
const QString prefixName = sa.value("prefix").toString();
|
||||||
if (!prefixName.isEmpty())
|
if (!prefixName.isEmpty())
|
||||||
prefixStack.push_back(prefixName);
|
prefixStack.push_back(prefixName);
|
||||||
} else if (xmlr.name() == "file") {
|
} else if (xmlr.name() == QLatin1String("file")) {
|
||||||
const QXmlStreamAttributes sa = xmlr.attributes();
|
const QXmlStreamAttributes sa = xmlr.attributes();
|
||||||
const QString aliasName = sa.value("alias").toString();
|
const QString aliasName = sa.value("alias").toString();
|
||||||
const QString fileName = xmlr.readElementText();
|
const QString fileName = xmlr.readElementText();
|
||||||
@@ -117,7 +117,7 @@ static QString findResourceInFile(const QString &resName, const QString &filePat
|
|||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
} else if (token == QXmlStreamReader::EndElement) {
|
} else if (token == QXmlStreamReader::EndElement) {
|
||||||
if (xmlr.name() == "qresource") {
|
if (xmlr.name() == QLatin1String("qresource")) {
|
||||||
if (!prefixStack.isEmpty())
|
if (!prefixStack.isEmpty())
|
||||||
prefixStack.pop_back();
|
prefixStack.pop_back();
|
||||||
}
|
}
|
||||||
|
@@ -568,13 +568,13 @@ static void handleField(QXmlStreamReader &in, PeripheralRegister ®)
|
|||||||
PeripheralRegisterField fld;
|
PeripheralRegisterField fld;
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == kName) {
|
if (elementName == QLatin1String(kName)) {
|
||||||
fld.name = in.readElementText();
|
fld.name = in.readElementText();
|
||||||
} else if (elementName == kDescription) {
|
} else if (elementName == QLatin1String(kDescription)) {
|
||||||
fld.description = in.readElementText();
|
fld.description = in.readElementText();
|
||||||
} else if (elementName == kAccess) {
|
} else if (elementName == QLatin1String(kAccess)) {
|
||||||
fld.access = decodeAccess(in.readElementText());
|
fld.access = decodeAccess(in.readElementText());
|
||||||
} else if (elementName == kBitRange) {
|
} else if (elementName == QLatin1String(kBitRange)) {
|
||||||
const QString elementText = in.readElementText();
|
const QString elementText = in.readElementText();
|
||||||
const int startBracket = elementText.indexOf('[');
|
const int startBracket = elementText.indexOf('[');
|
||||||
const int endBracket = elementText.indexOf(']');
|
const int endBracket = elementText.indexOf(']');
|
||||||
@@ -589,9 +589,9 @@ static void handleField(QXmlStreamReader &in, PeripheralRegister ®)
|
|||||||
const int to = int(decodeNumeric(items.at(MaxBit)));
|
const int to = int(decodeNumeric(items.at(MaxBit)));
|
||||||
fld.bitOffset = from;
|
fld.bitOffset = from;
|
||||||
fld.bitWidth = to - from + 1;
|
fld.bitWidth = to - from + 1;
|
||||||
} else if (elementName == kBitOffset) {
|
} else if (elementName == QLatin1String(kBitOffset)) {
|
||||||
fld.bitOffset = int(decodeNumeric(in.readElementText()));
|
fld.bitOffset = int(decodeNumeric(in.readElementText()));
|
||||||
} else if (elementName == kBitWidth) {
|
} else if (elementName == QLatin1String(kBitWidth)) {
|
||||||
fld.bitWidth = int(decodeNumeric(in.readElementText()));
|
fld.bitWidth = int(decodeNumeric(in.readElementText()));
|
||||||
} else {
|
} else {
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
@@ -611,24 +611,24 @@ static void handleRegister(QXmlStreamReader &in, PeripheralRegisterGroup &group)
|
|||||||
PeripheralRegister reg;
|
PeripheralRegister reg;
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == kName) {
|
if (elementName == QLatin1String(kName)) {
|
||||||
reg.name = in.readElementText();
|
reg.name = in.readElementText();
|
||||||
} else if (elementName == kDisplayName) {
|
} else if (elementName == QLatin1String(kDisplayName)) {
|
||||||
reg.displayName = in.readElementText();
|
reg.displayName = in.readElementText();
|
||||||
} else if (elementName == kDescription) {
|
} else if (elementName == QLatin1String(kDescription)) {
|
||||||
reg.description = in.readElementText();
|
reg.description = in.readElementText();
|
||||||
} else if (elementName == kAddressOffset) {
|
} else if (elementName == QLatin1String(kAddressOffset)) {
|
||||||
reg.addressOffset = decodeNumeric(in.readElementText());
|
reg.addressOffset = decodeNumeric(in.readElementText());
|
||||||
} else if (elementName == kSize) {
|
} else if (elementName == QLatin1String(kSize)) {
|
||||||
reg.size = int(decodeNumeric(in.readElementText()));
|
reg.size = int(decodeNumeric(in.readElementText()));
|
||||||
} else if (elementName == kAccess) {
|
} else if (elementName == QLatin1String(kAccess)) {
|
||||||
reg.access = decodeAccess(in.readElementText());
|
reg.access = decodeAccess(in.readElementText());
|
||||||
} else if (elementName == kResetvalue) {
|
} else if (elementName == QLatin1String(kResetvalue)) {
|
||||||
reg.resetValue = decodeNumeric(in.readElementText());
|
reg.resetValue = decodeNumeric(in.readElementText());
|
||||||
} else if (elementName == kFields) {
|
} else if (elementName == QLatin1String(kFields)) {
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == kField)
|
if (elementName == QLatin1String(kField))
|
||||||
handleField(in, reg);
|
handleField(in, reg);
|
||||||
else
|
else
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
@@ -657,22 +657,22 @@ static void handleGroup(QXmlStreamReader &in, PeripheralRegisterGroups &groups)
|
|||||||
|
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == kName) {
|
if (elementName == QLatin1String(kName)) {
|
||||||
group.name = in.readElementText();
|
group.name = in.readElementText();
|
||||||
} else if (elementName == kDescription) {
|
} else if (elementName == QLatin1String(kDescription)) {
|
||||||
group.description = in.readElementText();
|
group.description = in.readElementText();
|
||||||
} else if (elementName == kGroupName) {
|
} else if (elementName == QLatin1String(kGroupName)) {
|
||||||
group.displayName = in.readElementText();
|
group.displayName = in.readElementText();
|
||||||
} else if (elementName == kBaseAddress) {
|
} else if (elementName == QLatin1String(kBaseAddress)) {
|
||||||
group.baseAddress = decodeNumeric(in.readElementText());
|
group.baseAddress = decodeNumeric(in.readElementText());
|
||||||
} else if (elementName == kSize) {
|
} else if (elementName == QLatin1String(kSize)) {
|
||||||
group.size = int(decodeNumeric(in.readElementText()));
|
group.size = int(decodeNumeric(in.readElementText()));
|
||||||
} else if (elementName == kAccess) {
|
} else if (elementName == QLatin1String(kAccess)) {
|
||||||
group.access = decodeAccess(in.readElementText());
|
group.access = decodeAccess(in.readElementText());
|
||||||
} else if (elementName == kRegisters) {
|
} else if (elementName == QLatin1String(kRegisters)) {
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == kRegister)
|
if (elementName == QLatin1String(kRegister))
|
||||||
handleRegister(in, group);
|
handleRegister(in, group);
|
||||||
else
|
else
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
@@ -694,13 +694,13 @@ static PeripheralRegisterGroups availablePeripheralRegisterGroups(const FilePath
|
|||||||
PeripheralRegisterGroups groups;
|
PeripheralRegisterGroups groups;
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == kDevice) {
|
if (elementName == QLatin1String(kDevice)) {
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == kPeripherals) {
|
if (elementName == QLatin1String(kPeripherals)) {
|
||||||
while (in.readNextStartElement()) {
|
while (in.readNextStartElement()) {
|
||||||
const auto elementName = in.name();
|
const auto elementName = in.name();
|
||||||
if (elementName == kPeripheral)
|
if (elementName == QLatin1String(kPeripheral))
|
||||||
handleGroup(in, groups);
|
handleGroup(in, groups);
|
||||||
else
|
else
|
||||||
in.skipCurrentElement();
|
in.skipCurrentElement();
|
||||||
|
@@ -137,7 +137,9 @@ bool navigateToSlot(const QString &uiFileName,
|
|||||||
SearchFunction searchFunc(setupUiC);
|
SearchFunction searchFunc(setupUiC);
|
||||||
const SearchFunction::FunctionList funcs = searchFunc(generatedHeaderDoc);
|
const SearchFunction::FunctionList funcs = searchFunc(generatedHeaderDoc);
|
||||||
if (funcs.size() != 1) {
|
if (funcs.size() != 1) {
|
||||||
*errorMessage = QString::fromLatin1("Internal error: The function \"%1\" could not be found in %2").arg(setupUiC, generatedHeaderFile);
|
*errorMessage = QString::fromLatin1(
|
||||||
|
"Internal error: The function \"%1\" could not be found in %2")
|
||||||
|
.arg(QLatin1String(setupUiC), generatedHeaderFile);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@@ -214,7 +214,7 @@ bool ScxmlDocument::load(QIODevice *io)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (token == QXmlStreamReader::StartElement) {
|
if (token == QXmlStreamReader::StartElement) {
|
||||||
if (xml.name() == "scxml") {
|
if (xml.name() == QLatin1String("scxml")) {
|
||||||
// Get and add namespaces
|
// Get and add namespaces
|
||||||
QXmlStreamNamespaceDeclarations ns = xml.namespaceDeclarations();
|
QXmlStreamNamespaceDeclarations ns = xml.namespaceDeclarations();
|
||||||
for (int i = 0; i < ns.count(); ++i)
|
for (int i = 0; i < ns.count(); ++i)
|
||||||
|
@@ -579,7 +579,7 @@ void ScxmlTag::readXml(QXmlStreamReader &xml, bool checkCopyId)
|
|||||||
// Read and set attributes
|
// Read and set attributes
|
||||||
QXmlStreamAttributes attributes = xml.attributes();
|
QXmlStreamAttributes attributes = xml.attributes();
|
||||||
for (int i = 0; i < attributes.count(); ++i) {
|
for (int i = 0; i < attributes.count(); ++i) {
|
||||||
if (m_tagType == Scxml && attributes[i].qualifiedName() == "initial")
|
if (m_tagType == Scxml && attributes[i].qualifiedName() == QLatin1String("initial"))
|
||||||
scxmlInitial = attributes[i].value().toString();
|
scxmlInitial = attributes[i].value().toString();
|
||||||
else {
|
else {
|
||||||
QString key = attributes[i].qualifiedName().toString();
|
QString key = attributes[i].qualifiedName().toString();
|
||||||
|
@@ -304,13 +304,13 @@ XWhat Parser::Private::parseXWhat()
|
|||||||
if (reader.isEndElement())
|
if (reader.isEndElement())
|
||||||
break;
|
break;
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "text")
|
if (name == QLatin1String("text"))
|
||||||
what.text = blockingReadElementText();
|
what.text = blockingReadElementText();
|
||||||
else if (name == "leakedbytes")
|
else if (name == QLatin1String("leakedbytes"))
|
||||||
what.leakedbytes = parseInt64(blockingReadElementText(), "error/xwhat[memcheck]/leakedbytes");
|
what.leakedbytes = parseInt64(blockingReadElementText(), "error/xwhat[memcheck]/leakedbytes");
|
||||||
else if (name == "leakedblocks")
|
else if (name == QLatin1String("leakedblocks"))
|
||||||
what.leakedblocks = parseInt64(blockingReadElementText(), "error/xwhat[memcheck]/leakedblocks");
|
what.leakedblocks = parseInt64(blockingReadElementText(), "error/xwhat[memcheck]/leakedblocks");
|
||||||
else if (name == "hthreadid")
|
else if (name == QLatin1String("hthreadid"))
|
||||||
what.hthreadid = parseInt64(blockingReadElementText(), "error/xwhat[memcheck]/hthreadid");
|
what.hthreadid = parseInt64(blockingReadElementText(), "error/xwhat[memcheck]/hthreadid");
|
||||||
else if (reader.isStartElement())
|
else if (reader.isStartElement())
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
@@ -326,15 +326,15 @@ XauxWhat Parser::Private::parseXauxWhat()
|
|||||||
if (reader.isEndElement())
|
if (reader.isEndElement())
|
||||||
break;
|
break;
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "text")
|
if (name == QLatin1String("text"))
|
||||||
what.text = blockingReadElementText();
|
what.text = blockingReadElementText();
|
||||||
else if (name == "file")
|
else if (name == QLatin1String("file"))
|
||||||
what.file = blockingReadElementText();
|
what.file = blockingReadElementText();
|
||||||
else if (name == "dir")
|
else if (name == QLatin1String("dir"))
|
||||||
what.dir = blockingReadElementText();
|
what.dir = blockingReadElementText();
|
||||||
else if (name == "line")
|
else if (name == QLatin1String("line"))
|
||||||
what.line = parseInt64(blockingReadElementText(), "error/xauxwhat/line");
|
what.line = parseInt64(blockingReadElementText(), "error/xauxwhat/line");
|
||||||
else if (name == "hthreadid")
|
else if (name == QLatin1String("hthreadid"))
|
||||||
what.hthreadid = parseInt64(blockingReadElementText(), "error/xauxwhat/hthreadid");
|
what.hthreadid = parseInt64(blockingReadElementText(), "error/xauxwhat/hthreadid");
|
||||||
else if (reader.isStartElement())
|
else if (reader.isStartElement())
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
@@ -434,27 +434,27 @@ void Parser::Private::parseError()
|
|||||||
if (reader.isStartElement())
|
if (reader.isStartElement())
|
||||||
lastAuxWhat++;
|
lastAuxWhat++;
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "unique") {
|
if (name == QLatin1String("unique")) {
|
||||||
e.setUnique(parseHex(blockingReadElementText(), "unique"));
|
e.setUnique(parseHex(blockingReadElementText(), "unique"));
|
||||||
} else if (name == "tid") {
|
} else if (name == QLatin1String("tid")) {
|
||||||
e.setTid(parseInt64(blockingReadElementText(), "error/tid"));
|
e.setTid(parseInt64(blockingReadElementText(), "error/tid"));
|
||||||
} else if (name == "kind") { //TODO this is memcheck-specific:
|
} else if (name == QLatin1String("kind")) { //TODO this is memcheck-specific:
|
||||||
e.setKind(parseErrorKind(blockingReadElementText()));
|
e.setKind(parseErrorKind(blockingReadElementText()));
|
||||||
} else if (name == "suppression") {
|
} else if (name == QLatin1String("suppression")) {
|
||||||
e.setSuppression(parseSuppression());
|
e.setSuppression(parseSuppression());
|
||||||
} else if (name == "xwhat") {
|
} else if (name == QLatin1String("xwhat")) {
|
||||||
const XWhat xw = parseXWhat();
|
const XWhat xw = parseXWhat();
|
||||||
e.setWhat(xw.text);
|
e.setWhat(xw.text);
|
||||||
e.setLeakedBlocks(xw.leakedblocks);
|
e.setLeakedBlocks(xw.leakedblocks);
|
||||||
e.setLeakedBytes(xw.leakedbytes);
|
e.setLeakedBytes(xw.leakedbytes);
|
||||||
e.setHelgrindThreadId(xw.hthreadid);
|
e.setHelgrindThreadId(xw.hthreadid);
|
||||||
} else if (name == "what") {
|
} else if (name == QLatin1String("what")) {
|
||||||
e.setWhat(blockingReadElementText());
|
e.setWhat(blockingReadElementText());
|
||||||
} else if (name == "xauxwhat") {
|
} else if (name == QLatin1String("xauxwhat")) {
|
||||||
if (!currentAux.text.isEmpty())
|
if (!currentAux.text.isEmpty())
|
||||||
auxs.push_back(currentAux);
|
auxs.push_back(currentAux);
|
||||||
currentAux = parseXauxWhat();
|
currentAux = parseXauxWhat();
|
||||||
} else if (name == "auxwhat") {
|
} else if (name == QLatin1String("auxwhat")) {
|
||||||
const QString aux = blockingReadElementText();
|
const QString aux = blockingReadElementText();
|
||||||
//concatenate multiple consecutive <auxwhat> tags
|
//concatenate multiple consecutive <auxwhat> tags
|
||||||
if (lastAuxWhat > 1) {
|
if (lastAuxWhat > 1) {
|
||||||
@@ -468,7 +468,7 @@ void Parser::Private::parseError()
|
|||||||
currentAux.text.append(aux);
|
currentAux.text.append(aux);
|
||||||
}
|
}
|
||||||
lastAuxWhat = 0;
|
lastAuxWhat = 0;
|
||||||
} else if (name == "stack") {
|
} else if (name == QLatin1String("stack")) {
|
||||||
frames.push_back(parseStack());
|
frames.push_back(parseStack());
|
||||||
} else if (reader.isStartElement()) {
|
} else if (reader.isStartElement()) {
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
@@ -505,17 +505,17 @@ Frame Parser::Private::parseFrame()
|
|||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "ip")
|
if (name == QLatin1String("ip"))
|
||||||
frame.setInstructionPointer(parseHex(blockingReadElementText(), "error/frame/ip"));
|
frame.setInstructionPointer(parseHex(blockingReadElementText(), "error/frame/ip"));
|
||||||
else if (name == "obj")
|
else if (name == QLatin1String("obj"))
|
||||||
frame.setObject(blockingReadElementText());
|
frame.setObject(blockingReadElementText());
|
||||||
else if (name == "fn")
|
else if (name == QLatin1String("fn"))
|
||||||
frame.setFunctionName( blockingReadElementText());
|
frame.setFunctionName( blockingReadElementText());
|
||||||
else if (name == "dir")
|
else if (name == QLatin1String("dir"))
|
||||||
frame.setDirectory(blockingReadElementText());
|
frame.setDirectory(blockingReadElementText());
|
||||||
else if (name == "file")
|
else if (name == QLatin1String("file"))
|
||||||
frame.setFileName(blockingReadElementText());
|
frame.setFileName(blockingReadElementText());
|
||||||
else if (name == "line")
|
else if (name == QLatin1String("line"))
|
||||||
frame.setLine(parseInt64(blockingReadElementText(), "error/frame/line"));
|
frame.setLine(parseInt64(blockingReadElementText(), "error/frame/line"));
|
||||||
else if (reader.isStartElement())
|
else if (reader.isStartElement())
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
@@ -535,9 +535,9 @@ void Parser::Private::parseAnnounceThread()
|
|||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "hthreadid")
|
if (name == QLatin1String("hthreadid"))
|
||||||
at.setHelgrindThreadId(parseInt64(blockingReadElementText(), "announcethread/hthreadid"));
|
at.setHelgrindThreadId(parseInt64(blockingReadElementText(), "announcethread/hthreadid"));
|
||||||
else if (name == "stack")
|
else if (name == QLatin1String("stack"))
|
||||||
at.setStack(parseStack());
|
at.setStack(parseStack());
|
||||||
else if (reader.isStartElement())
|
else if (reader.isStartElement())
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
@@ -554,7 +554,7 @@ void Parser::Private::parseErrorCounts()
|
|||||||
if (reader.isEndElement())
|
if (reader.isEndElement())
|
||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
if (reader.name() == "pair") {
|
if (reader.name() == QLatin1String("pair")) {
|
||||||
qint64 unique = 0;
|
qint64 unique = 0;
|
||||||
qint64 count = 0;
|
qint64 count = 0;
|
||||||
while (notAtEnd()) {
|
while (notAtEnd()) {
|
||||||
@@ -563,17 +563,16 @@ void Parser::Private::parseErrorCounts()
|
|||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "unique")
|
if (name == QLatin1String("unique"))
|
||||||
unique = parseHex(blockingReadElementText(), "errorcounts/pair/unique");
|
unique = parseHex(blockingReadElementText(), "errorcounts/pair/unique");
|
||||||
else if (name == "count")
|
else if (name == QLatin1String("count"))
|
||||||
count = parseInt64(blockingReadElementText(), "errorcounts/pair/count");
|
count = parseInt64(blockingReadElementText(), "errorcounts/pair/count");
|
||||||
else if (reader.isStartElement())
|
else if (reader.isStartElement())
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit q->errorCount(unique, count);
|
emit q->errorCount(unique, count);
|
||||||
}
|
} else if (reader.isStartElement())
|
||||||
else if (reader.isStartElement())
|
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -587,7 +586,7 @@ void Parser::Private::parseSuppressionCounts()
|
|||||||
if (reader.isEndElement())
|
if (reader.isEndElement())
|
||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
if (reader.name() == "pair") {
|
if (reader.name() == QLatin1String("pair")) {
|
||||||
QString pairName;
|
QString pairName;
|
||||||
qint64 count = 0;
|
qint64 count = 0;
|
||||||
while (notAtEnd()) {
|
while (notAtEnd()) {
|
||||||
@@ -596,17 +595,16 @@ void Parser::Private::parseSuppressionCounts()
|
|||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "name")
|
if (name == QLatin1String("name"))
|
||||||
pairName = blockingReadElementText();
|
pairName = blockingReadElementText();
|
||||||
else if (name == "count")
|
else if (name == QLatin1String("count"))
|
||||||
count = parseInt64(blockingReadElementText(), "suppcounts/pair/count");
|
count = parseInt64(blockingReadElementText(), "suppcounts/pair/count");
|
||||||
else if (reader.isStartElement())
|
else if (reader.isStartElement())
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
emit q->suppressionCount(pairName, count);
|
emit q->suppressionCount(pairName, count);
|
||||||
}
|
} else if (reader.isStartElement())
|
||||||
else if (reader.isStartElement())
|
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -622,9 +620,9 @@ void Parser::Private::parseStatus()
|
|||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "state")
|
if (name == QLatin1String("state"))
|
||||||
s.setState(parseState(blockingReadElementText()));
|
s.setState(parseState(blockingReadElementText()));
|
||||||
else if (name == "time")
|
else if (name == QLatin1String("time"))
|
||||||
s.setTime(blockingReadElementText());
|
s.setTime(blockingReadElementText());
|
||||||
else if (reader.isStartElement())
|
else if (reader.isStartElement())
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
@@ -642,7 +640,7 @@ QVector<Frame> Parser::Private::parseStack()
|
|||||||
if (reader.isEndElement())
|
if (reader.isEndElement())
|
||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
if (reader.name() == "frame")
|
if (reader.name() == QLatin1String("frame"))
|
||||||
frames.append(parseFrame());
|
frames.append(parseFrame());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -660,9 +658,9 @@ SuppressionFrame Parser::Private::parseSuppressionFrame()
|
|||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "obj")
|
if (name == QLatin1String("obj"))
|
||||||
frame.setObject(blockingReadElementText());
|
frame.setObject(blockingReadElementText());
|
||||||
else if (name == "fun")
|
else if (name == QLatin1String("fun"))
|
||||||
frame.setFunction( blockingReadElementText());
|
frame.setFunction( blockingReadElementText());
|
||||||
else if (reader.isStartElement())
|
else if (reader.isStartElement())
|
||||||
reader.skipCurrentElement();
|
reader.skipCurrentElement();
|
||||||
@@ -682,15 +680,15 @@ Suppression Parser::Private::parseSuppression()
|
|||||||
break;
|
break;
|
||||||
if (reader.isStartElement()) {
|
if (reader.isStartElement()) {
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "sname")
|
if (name == QLatin1String("sname"))
|
||||||
supp.setName(blockingReadElementText());
|
supp.setName(blockingReadElementText());
|
||||||
else if (name == "skind")
|
else if (name == QLatin1String("skind"))
|
||||||
supp.setKind(blockingReadElementText());
|
supp.setKind(blockingReadElementText());
|
||||||
else if (name == "skaux")
|
else if (name == QLatin1String("skaux"))
|
||||||
supp.setAuxKind(blockingReadElementText());
|
supp.setAuxKind(blockingReadElementText());
|
||||||
else if (name == "rawtext")
|
else if (name == QLatin1String("rawtext"))
|
||||||
supp.setRawText(blockingReadElementText());
|
supp.setRawText(blockingReadElementText());
|
||||||
else if (name == "sframe")
|
else if (name == QLatin1String("sframe"))
|
||||||
frames.push_back(parseSuppressionFrame());
|
frames.push_back(parseSuppressionFrame());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -708,19 +706,19 @@ void Parser::Private::parse(QIODevice *device)
|
|||||||
while (notAtEnd()) {
|
while (notAtEnd()) {
|
||||||
blockingReadNext();
|
blockingReadNext();
|
||||||
const auto name = reader.name();
|
const auto name = reader.name();
|
||||||
if (name == "error")
|
if (name == QLatin1String("error"))
|
||||||
parseError();
|
parseError();
|
||||||
else if (name == "announcethread")
|
else if (name == QLatin1String("announcethread"))
|
||||||
parseAnnounceThread();
|
parseAnnounceThread();
|
||||||
else if (name == "status")
|
else if (name == QLatin1String("status"))
|
||||||
parseStatus();
|
parseStatus();
|
||||||
else if (name == "errorcounts")
|
else if (name == QLatin1String("errorcounts"))
|
||||||
parseErrorCounts();
|
parseErrorCounts();
|
||||||
else if (name == "suppcounts")
|
else if (name == QLatin1String("suppcounts"))
|
||||||
parseSuppressionCounts();
|
parseSuppressionCounts();
|
||||||
else if (name == "protocolversion")
|
else if (name == QLatin1String("protocolversion"))
|
||||||
checkProtocolVersion(blockingReadElementText());
|
checkProtocolVersion(blockingReadElementText());
|
||||||
else if (name == "protocoltool")
|
else if (name == QLatin1String("protocoltool"))
|
||||||
checkTool(blockingReadElementText());
|
checkTool(blockingReadElementText());
|
||||||
}
|
}
|
||||||
} catch (const ParserException &e) {
|
} catch (const ParserException &e) {
|
||||||
|
Reference in New Issue
Block a user