mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-07-30 07:44:13 +02:00
templatescollection.cpp: fix QDomDocument::ParseResult->bool conversion
Since Qt 6.5, QDomDocument::setContent() returns a ParseResult struct with an *explicit* operator bool(), so 'bool x = doc.setContent(...)' (copy-initialization) no longer compiles - explicit conversions aren't considered there. This exact issue was already fixed in titleblocktemplate.cpp by dropping the intermediate bool and testing the call directly in the if condition (contextual bool conversion in an if() is fine even for an explicit operator bool), but this second occurrence in templatescollection.cpp used the same pattern and was missed. Applying the same fix here for consistency.
This commit is contained in:
committed by
Laurent Trinques
parent
6716c267b8
commit
287b532953
@@ -454,8 +454,7 @@ QDomElement TitleBlockTemplatesFilesCollection::getTemplateXmlDescription(const
|
||||
}
|
||||
|
||||
QDomDocument *xml_document = new QDomDocument();
|
||||
bool xml_parsing = xml_document -> setContent(&xml_file);
|
||||
if (!xml_parsing) {
|
||||
if (!xml_document -> setContent(&xml_file)) {
|
||||
delete xml_document;
|
||||
return(QDomElement());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user