Fix indentation code

This commit is contained in:
Laurent Trinques
2020-07-15 20:20:07 +02:00
parent 6313319f80
commit 68e78a0de9
38 changed files with 2625 additions and 2625 deletions

View File

@@ -561,35 +561,35 @@ bool QET::compareCanonicalFilePaths(const QString &first, const QString &second)
*/
bool QET::writeXmlFile(QDomDocument &xml_doc, const QString &filepath, QString *error_message)
{
QSaveFile file(filepath);
// Note: we do not set QIODevice::Text to avoid generating CRLF end of lines
bool file_opening = file.open(QIODevice::WriteOnly);
if (!file_opening)
{
if (error_message)
{
*error_message = QString(QObject::tr("Impossible d'ouvrir le fichier %1 en écriture, erreur %2 rencontrée.",
"error message when attempting to write an XML file")).arg(filepath).arg(file.error());
}
return(false);
}
QTextStream out(&file);
out.setCodec("UTF-8");
out.setGenerateByteOrderMark(false);
out << xml_doc.toString(4);
if (!file.commit())
{
if (error_message) {
*error_message = QString(QObject::tr("Une erreur est survenue lors de l'écriture du fichier %1, erreur %2 rencontrée.",
"error message when attempting to write an XML file")).arg(filepath).arg(file.error());
}
return false;
}
return(true);
QSaveFile file(filepath);
// Note: we do not set QIODevice::Text to avoid generating CRLF end of lines
bool file_opening = file.open(QIODevice::WriteOnly);
if (!file_opening)
{
if (error_message)
{
*error_message = QString(QObject::tr("Impossible d'ouvrir le fichier %1 en écriture, erreur %2 rencontrée.",
"error message when attempting to write an XML file")).arg(filepath).arg(file.error());
}
return(false);
}
QTextStream out(&file);
out.setCodec("UTF-8");
out.setGenerateByteOrderMark(false);
out << xml_doc.toString(4);
if (!file.commit())
{
if (error_message) {
*error_message = QString(QObject::tr("Une erreur est survenue lors de l'écriture du fichier %1, erreur %2 rencontrée.",
"error message when attempting to write an XML file")).arg(filepath).arg(file.error());
}
return false;
}
return(true);
}
/**