Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion schema/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,13 +1131,21 @@ void Parser::importSchema(ParserContext *context, const QString &location)
}

QDomDocument doc(QLatin1String("kwsdl"));
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
QString errorMsg;
int errorLine, errorColumn;
bool ok = doc.setContent(&file, false, &errorMsg, &errorLine, &errorColumn);
if (!ok) {
qDebug("Error[%d:%d] %s", errorLine, errorColumn, qPrintable(errorMsg));
return;
}
#else
if (auto result = doc.setContent(&file); !result) {
qDebug("Error[%lld:%lld] %s", result.errorLine, result.errorColumn,
qPrintable(result.errorMessage));
return;
}
#endif

QDomElement node = doc.documentElement();

Expand Down Expand Up @@ -1172,13 +1180,21 @@ void Parser::includeSchema(ParserContext *context, const QString &location)
}

QDomDocument doc(QLatin1String("kwsdl"));
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
QString errorMsg;
int errorLine, errorColumn;
bool ok = doc.setContent(&file, false, &errorMsg, &errorLine, &errorColumn);
if (!ok) {
qDebug("Error[%d:%d] %s", errorLine, errorColumn, qPrintable(errorMsg));
return;
}
#else
if (auto result = doc.setContent(&file); !result) {
qDebug("Error[%lld:%lld] %s", result.errorLine, result.errorColumn,
qPrintable(result.errorMessage));
return;
}
#endif

QDomElement node = doc.documentElement();
NSManager namespaceManager(context, node);
Expand Down Expand Up @@ -1400,13 +1416,21 @@ bool Parser::parse(ParserContext *context, QIODevice *sourceDevice)
{
QDomDocument document(QLatin1String("KWSDL"));

QDomDocument doc;
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
QString errorMsg;
int errorLine, errorCol;
QDomDocument doc;
if (!doc.setContent(sourceDevice, false, &errorMsg, &errorLine, &errorCol)) {
qDebug("%s at (%d,%d)", qPrintable(errorMsg), errorLine, errorCol);
return false;
}
#else
if (auto result = doc.setContent(sourceDevice); !result) {
qDebug("%s at (%lld,%lld)", qPrintable(result.errorMessage), result.errorLine,
result.errorColumn);
return false;
}
#endif

QDomElement element = doc.documentElement();
const QName name = element.tagName();
Expand Down