Refactor conditional checks for Master type

This commit is contained in:
Kellermorph
2026-03-31 17:50:46 +02:00
committed by GitHub
parent 79edc3fbb7
commit 89a4aaac28

View File

@@ -568,9 +568,12 @@ void ElementData::kindInfoFromXml(const QDomElement &xml_element)
}
auto name = dom_elmt.attribute(QStringLiteral("name"));
if (m_type == ElementData::Master &&
name == QLatin1String("type")) {
m_master_type = masterTypeFromString(dom_elmt.text());
if (m_type == ElementData::Master) {
if (name == QLatin1String("type")) {
m_master_type = masterTypeFromString(dom_elmt.text());
} else if (name == QLatin1String("max_slaves")) {
m_max_slaves = dom_elmt.text().toInt();
}
}
else if (m_type == ElementData::Slave ) {
if (name == QLatin1String("type")) {