mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 18:50:52 +01:00
Implemented QET::writeXmlFile() to handle every XML file generation in a single place.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1640 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -417,17 +417,11 @@ bool TitleBlockTemplatesFilesCollection::setTemplateXmlDescription(const QString
|
||||
// prevent the watcher from emitting signals while we open and write to file
|
||||
blockSignals(true);
|
||||
|
||||
QFile xml_file(path(template_name));
|
||||
if (!xml_file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
return(false);
|
||||
}
|
||||
QDomDocument doc;
|
||||
doc.appendChild(doc.importNode(xml_element, true));
|
||||
|
||||
QTextStream out(&xml_file);
|
||||
out.setCodec("UTF-8");
|
||||
out << doc.toString(4);
|
||||
xml_file.close();
|
||||
bool writing = QET::writeXmlFile(doc, path(template_name));
|
||||
if (!writing) return(false);
|
||||
|
||||
// emit a single signal for the change
|
||||
blockSignals(false);
|
||||
|
||||
Reference in New Issue
Block a user