mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 06:20:53 +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:
@@ -18,6 +18,8 @@
|
||||
#include "fileelementscategory.h"
|
||||
#include "fileelementscollection.h"
|
||||
#include "fileelementdefinition.h"
|
||||
#include "qet.h"
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param path Chemin du dossier de la categorie
|
||||
@@ -412,21 +414,8 @@ bool FileElementsCategory::write() {
|
||||
document.appendChild(root);
|
||||
root.appendChild(category_names.toXml(document));
|
||||
|
||||
// repere le chemin du fichier de configuration de la categorie
|
||||
QFile directory_conf(cat_dir.absolutePath() + "/qet_directory");
|
||||
|
||||
// ouvre le fichier
|
||||
if (!directory_conf.open(QIODevice::Text | QIODevice::WriteOnly)) return(false);
|
||||
|
||||
// ecrit le fichier
|
||||
QTextStream out(&directory_conf);
|
||||
out.setCodec("UTF-8");
|
||||
out << document.toString(4);
|
||||
|
||||
// ferme le fichier
|
||||
directory_conf.close();
|
||||
|
||||
return(true);
|
||||
QString filepath = cat_dir.absolutePath() + "/qet_directory";
|
||||
return(QET::writeXmlFile(document, filepath));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user