mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +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:
@@ -20,6 +20,8 @@
|
||||
#include "fileelementscategory.h"
|
||||
#include "fileelementscollection.h"
|
||||
#include "qetapp.h"
|
||||
#include "qet.h"
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param uri Chemin du fichier contenant la definition de l'element
|
||||
@@ -74,16 +76,7 @@ bool FileElementDefinition::setXml(const QDomElement &xml_element) {
|
||||
@return true si l'operation a reussi, false sinon
|
||||
*/
|
||||
bool FileElementDefinition::write() {
|
||||
QFile file(file_path);
|
||||
|
||||
// le fichier doit etre accessible en ecriture
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) return(false);
|
||||
|
||||
QTextStream out(&file);
|
||||
out.setCodec("UTF-8");
|
||||
out << xml_element_.toString(4);
|
||||
file.close();
|
||||
return(true);
|
||||
return(QET::writeXmlFile(xml_element_, file_path));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user