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:
xavier
2012-04-09 01:03:08 +00:00
parent 6ab83f3517
commit 318df55a37
8 changed files with 61 additions and 71 deletions

View File

@@ -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);