Compare commits

...

3 Commits

Author SHA1 Message Date
plc-user e2e0df784b fix deprecation-warning about "setContent" with qt >= 6.5 2026-08-17 10:25:44 +02:00
plc-user cfc64dfad0 fix whitespace 2026-08-17 10:23:28 +02:00
Laurent Trinques eb095f9a10 Update start_options.cmake restore -DQET_ALLOW_OVERRIDE_DD_OPTION 2026-08-17 06:57:18 +02:00
2 changed files with 16 additions and 4 deletions
+3
View File
@@ -25,6 +25,9 @@ add_definitions(-DQET_ALLOW_OVERRIDE_CTBTD_OPTION)
# Comment the line below to deactivate the --config-dir option
add_definitions(-DQET_ALLOW_OVERRIDE_CD_OPTION)
# Comment the line below to deactivate the --data-dir option
add_definitions(-DQET_ALLOW_OVERRIDE_DD_OPTION)
# Enable project database export when requested by the build system.
option(QET_EXPORT_PROJECT_DB "Enable project database export" OFF)
+13 -4
View File
@@ -45,11 +45,11 @@ QList<QPair<QString, QString>> langDict(const QString &value)
for (int i = 0; i < marks.size(); ++i) {
const QRegularExpressionMatch &m = marks.at(i);
const QString code = value.mid(m.capturedStart(),
m.capturedLength() - 1); // drop '@'
m.capturedLength() - 1); // drop '@'
const int text_start = m.capturedEnd();
const int text_end = (i + 1 < marks.size())
? marks.at(i + 1).capturedStart()
: value.size();
? marks.at(i + 1).capturedStart()
: value.size();
QString text = value.mid(text_start, text_end - text_start);
while (!text.isEmpty() && text.back().isSpace()) {
text.chop(1);
@@ -77,7 +77,7 @@ QString pickLang(const QString &value)
return value.trimmed();
}
for (const QString &code : {QStringLiteral("en_EN"), QStringLiteral("en_US"),
QStringLiteral("en_GB")}) {
QStringLiteral("en_GB")}) {
for (const auto &p : d) {
if (p.first == code && !p.second.isEmpty()) {
return p.second;
@@ -158,11 +158,20 @@ bool EdzPart::parse(const QString &part_xml_path)
return false;
}
QDomDocument doc;
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0) // TODO Qt 6.5: remove
QString parse_err;
int line = 0, col = 0;
if (!doc.setContent(&file, &parse_err, &line, &col)) {
m_error = QStringLiteral("Malformed part.xml (line %1): %2")
.arg(line).arg(parse_err);
#else
const auto result = doc.setContent(&file);
if (!result) {
m_error = QStringLiteral("Malformed part.xml (line %1, column %2): %3")
.arg(result.errorLine)
.arg(result.errorColumn)
.arg(result.errorMessage);
#endif
return false;
}
file.close();